aifartist commited on
Commit
899c9cb
·
verified ·
1 Parent(s): 878a641

Update gradio-app.py

Browse files

See if I can eliminate the "not enough sm's" error on this T4 during compile with max-autotune.

Files changed (1) hide show
  1. gradio-app.py +6 -4
gradio-app.py CHANGED
@@ -32,10 +32,12 @@ pipe.unet.to(memory_format=torch.channels_last)
32
  pipe.set_progress_bar_config(disable=True)
33
 
34
  if TORCH_COMPILE:
35
- pipe.text_encoder = torch.compile(pipe.text_encoder, mode="max-autotune")
36
- pipe.tokenizer = torch.compile(pipe.tokenizer, mode="max-autotune")
37
- pipe.unet = torch.compile(pipe.unet, mode="max-autotune")
38
- pipe.vae = torch.compile(pipe.vae, mode="max-autotune")
 
 
39
 
40
 
41
  def predict(prompt1, prompt2, merge_ratio, guidance, steps, sharpness, seed=1231231):
 
32
  pipe.set_progress_bar_config(disable=True)
33
 
34
  if TORCH_COMPILE:
35
+ #optmode = 'max-autotune'
36
+ optmode = 'reduce-overhead'
37
+ pipe.text_encoder = torch.compile(pipe.text_encoder, mode=optmode)
38
+ pipe.tokenizer = torch.compile(pipe.tokenizer, mode=optmode)
39
+ pipe.unet = torch.compile(pipe.unet, mode=optmode)
40
+ pipe.vae = torch.compile(pipe.vae, mode=optmode)
41
 
42
 
43
  def predict(prompt1, prompt2, merge_ratio, guidance, steps, sharpness, seed=1231231):