Skip to content

Instantly share code, notes, and snippets.

@brucethemoose
Last active March 15, 2023 22:28
Show Gist options
  • Select an option

  • Save brucethemoose/ea64f498b0aa51adcc88f543bf80ed97 to your computer and use it in GitHub Desktop.

Select an option

Save brucethemoose/ea64f498b0aa51adcc88f543bf80ed97 to your computer and use it in GitHub Desktop.
InvokeAI torch.compile
# Insert Here:
https://github.com/invoke-ai/InvokeAI/blob/d9dab1b6c770b49771ab30cb66fd1348a5639cd3/invokeai/backend/stable_diffusion/diffusers_pipeline.py#L346
odict = {
'aggressive_fusion': True,
'benchmark_harness': True,
'dce': True,
'developer_warnings': True,
'disable_progress': True,
'epilogue_fusion': True,
'epilogue_fusion_first': True,
'kernel_name_max_ops': 10,
'max_autotune': False,
'max_fusion_size': 64,
'permute_fusion': True,
'pick_loop_orders': True,
'profile_bandwidth': False,
'reordering': True,
'search_autotune_cache': True,
'shape_padding': False,
'triton.dense_indexing': False,
'tune_layout': False,
'unroll_reductions_threshold': 8,
'verbose_progress': False
}
self.unet = torch.compile(self.unet, options = odict)
self.vae = torch.compile(self.vae, options = odict)
#self.text_encoder = torch.compile(self.text_encoder, options = odict)
self.tokenizer.tokenize = torch.compile(self.tokenizer.tokenize, options = odict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment