Skip to content

Commit

Permalink
Import env vars first
Browse files Browse the repository at this point in the history
  • Loading branch information
powderluv committed Dec 16, 2022
1 parent 831f206 commit 72976a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shark/examples/shark_inference/stable_diffusion/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import os

os.environ["AMD_ENABLE_LLPC"] = "1"

from transformers import CLIPTextModel, CLIPTokenizer
import torch
from PIL import Image
Expand All @@ -15,11 +19,8 @@
from opt_params import get_unet, get_vae, get_clip
import time
import sys
import os
from shark.iree_utils.compile_utils import dump_isas

os.environ["AMD_ENABLE_LLPC"] = "1"

# Helper function to profile the vulkan device.
def start_profiling(file_path="foo.rdc", profiling_mode="queue"):
if args.vulkan_debug_utils and "vulkan" in args.device:
Expand Down
4 changes: 4 additions & 0 deletions web/index.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import os

os.environ["AMD_ENABLE_LLPC"] = "1"

# from models.resnet50 import resnet_inf
# from models.albert_maskfill import albert_maskfill_inf
from models.stable_diffusion.main import stable_diff_inf
Expand Down

0 comments on commit 72976a2

Please sign in to comment.