Skip to content

Commit

Permalink
Improve torch compile performance (#1082)
Browse files Browse the repository at this point in the history
Co-authored-by: regisss <[email protected]>
  • Loading branch information
libinta and regisss authored Jun 16, 2024
1 parent 8028af7 commit 595cc3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/stable-diffusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ python text_to_image_generation.py \
> The first batch of images entails a performance penalty. All subsequent batches will be generated much faster.
> You can enable this mode with `--use_hpu_graphs`.
> Please note: there is a regression with "--guidance_scale 0.0" for the latest release.

### ControlNet

ControlNet was introduced in [Adding Conditional Control to Text-to-Image Diffusion Models ](https://huggingface.co/papers/2302.05543) by Lvmin Zhang and Maneesh Agrawala.
Expand Down
2 changes: 1 addition & 1 deletion examples/text-generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def patch_scoped_linear_all_reduce(model):


def get_torch_compiled_model(model):
model.model = torch.compile(model.model, backend="hpu_backend")
model.model = torch.compile(model.model, backend="hpu_backend", options={"keep_input_mutations": True})
return model


Expand Down

0 comments on commit 595cc3e

Please sign in to comment.