Skip to content

Commit 453fb38

Browse files
committed
Update compile options for sdxl
1 parent 6ca109a commit 453fb38

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

models/turbine_models/custom_models/sd_inference/utils.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
"--iree-preprocessing-pass-pipeline=builtin.module(iree-preprocessing-transpose-convolution-pipeline, iree-global-opt-raise-special-ops, util.func(iree-preprocessing-pad-to-intrinsics, iree-linalg-ext-pad-attention{pad-to-multiple-of=0,64,0,32,0}))",
2626
],
2727
"punet": [
28-
"--iree-preprocessing-pass-pipeline=builtin.module(util.func(iree-global-opt-raise-special-ops, iree-flow-canonicalize), iree-preprocessing-transpose-convolution-pipeline, util.func(iree-preprocessing-pad-to-intrinsics, iree-preprocessing-generalize-linalg-matmul-experimental))"
28+
"--iree-preprocessing-pass-pipeline=builtin.module(util.func(iree-global-opt-raise-special-ops, iree-dispatch-creation-canonicalize), iree-preprocessing-transpose-convolution-pipeline, iree-preprocessing-pad-to-intrinsics, util.func(iree-preprocessing-generalize-linalg-matmul-experimental))"
2929
],
3030
"vae_preprocess": [
31-
"--iree-preprocessing-pass-pipeline=builtin.module(util.func(iree-global-opt-raise-special-ops, iree-flow-canonicalize), iree-preprocessing-transpose-convolution-pipeline, util.func(iree-preprocessing-pad-to-intrinsics, iree-preprocessing-generalize-linalg-matmul-experimental))"
31+
"--iree-preprocessing-pass-pipeline=builtin.module(util.func(iree-global-opt-raise-special-ops, iree-dispatch-creation-canonicalize), iree-preprocessing-transpose-convolution-pipeline, iree-preprocessing-pad-to-intrinsics, util.func(iree-preprocessing-generalize-linalg-matmul-experimental))"
3232
],
3333
"preprocess_default": [
34-
"--iree-preprocessing-pass-pipeline=builtin.module(iree-preprocessing-transpose-convolution-pipeline, util.func(iree-preprocessing-pad-to-intrinsics))",
34+
"--iree-preprocessing-pass-pipeline=builtin.module(iree-preprocessing-transpose-convolution-pipeline, iree-preprocessing-pad-to-intrinsics)",
3535
],
3636
"unet": [
37-
"--iree-flow-enable-aggressive-fusion",
37+
"--iree-dispatch-creation-enable-aggressive-fusion",
3838
"--iree-opt-aggressively-propagate-transposes=true",
3939
"--iree-codegen-llvmgpu-use-vector-distribution=true",
4040
"--iree-opt-outer-dim-concat=true",
@@ -43,16 +43,16 @@
4343
"--iree-vm-target-truncate-unsupported-floats",
4444
],
4545
"clip": [
46-
"--iree-flow-enable-aggressive-fusion",
47-
"--iree-flow-enable-fuse-horizontal-contractions=true",
46+
"--iree-dispatch-creation-enable-aggressive-fusion",
47+
"--iree-dispatch-creation-enable-fuse-horizontal-contractions=true",
4848
"--iree-opt-aggressively-propagate-transposes=true",
4949
"--iree-opt-outer-dim-concat=true",
5050
"--iree-rocm-waves-per-eu=2",
5151
"--iree-codegen-llvmgpu-use-vector-distribution=true",
5252
],
5353
"vae": [
54-
"--iree-flow-enable-aggressive-fusion",
55-
"--iree-flow-enable-fuse-horizontal-contractions",
54+
"--iree-dispatch-creation-enable-aggressive-fusion",
55+
"--iree-dispatch-creation-enable-fuse-horizontal-contractions",
5656
"--iree-opt-aggressively-propagate-transposes=true",
5757
"--iree-codegen-llvmgpu-use-vector-distribution=true",
5858
"--iree-opt-data-tiling=false",
@@ -70,7 +70,7 @@
7070
"--iree-opt-data-tiling=false",
7171
"--iree-opt-const-eval=false",
7272
"--iree-opt-aggressively-propagate-transposes=true",
73-
"--iree-flow-enable-aggressive-fusion",
73+
"--iree-dispatch-creation-enable-aggressive-fusion",
7474
"--iree-codegen-gpu-native-math-precision=true",
7575
"--iree-codegen-llvmgpu-use-vector-distribution=true",
7676
],
@@ -80,12 +80,12 @@
8080
"--iree-codegen-llvmgpu-enable-transform-dialect-jit=false",
8181
],
8282
"punet": [
83-
"--iree-preprocessing-pass-pipeline=builtin.module(util.func(iree-global-opt-raise-special-ops, iree-flow-canonicalize), iree-preprocessing-transpose-convolution-pipeline, iree-preprocessing-pad-to-intrinsics, util.func(iree-preprocessing-generalize-linalg-matmul-experimental))"
84-
"--iree-flow-enable-fuse-horizontal-contractions=true",
83+
"--iree-preprocessing-pass-pipeline=builtin.module(util.func(iree-global-opt-raise-special-ops, iree-dispatch-creation-canonicalize), iree-preprocessing-transpose-convolution-pipeline, iree-preprocessing-pad-to-intrinsics, util.func(iree-preprocessing-generalize-linalg-matmul-experimental))"
84+
"--iree-dispatch-creation-enable-fuse-horizontal-contractions=true",
8585
"--iree-codegen-llvmgpu-enable-transform-dialect-jit=false",
8686
],
8787
"preprocess_default": [
88-
"--iree-preprocessing-pass-pipeline=builtin.module(iree-preprocessing-transpose-convolution-pipeline, iree-global-opt-raise-special-ops, util.func(iree-preprocessing-pad-to-intrinsics))",
88+
"--iree-preprocessing-pass-pipeline=builtin.module(iree-preprocessing-transpose-convolution-pipeline, iree-global-opt-raise-special-ops, iree-preprocessing-pad-to-intrinsics)",
8989
"--iree-codegen-llvmgpu-enable-transform-dialect-jit=false",
9090
],
9191
"unet": [""],
@@ -98,9 +98,9 @@
9898
"--iree-llvmcpu-target-cpu=znver4",
9999
"--iree-opt-const-eval=false",
100100
"--iree-llvmcpu-enable-ukernels=mmt4d,pack,unpack",
101-
"--iree-flow-collapse-reduction-dims",
101+
"--iree-dispatch-creation-collapse-reduction-dims",
102102
"--iree-opt-const-expr-max-size-increase-threshold=1000000000000000",
103-
"--iree-flow-enable-fuse-padding-into-linalg-consumer-ops",
103+
"--iree-dispatch-creation-enable-fuse-padding-into-linalg-consumer-ops",
104104
],
105105
"bf16": [
106106
"--iree-preprocessing-pass-pipeline=builtin.module(util.func(iree-global-opt-demote-contraction-inputs-to-bf16))",
@@ -288,15 +288,15 @@ def compile_to_vmfb(
288288
"--iree-stream-resource-max-allocation-size=" + max_alloc,
289289
"--iree-stream-resource-index-bits=64",
290290
"--iree-vm-target-index-bits=64",
291-
"--iree-flow-inline-constants-max-byte-length=1",
291+
"--iree-dispatch-creation-inline-constants-max-byte-length=1",
292292
]
293293
)
294294
device = "vulkan-spirv"
295295
elif device in ["rocm", "hip"]:
296296
flags.extend(
297297
[
298298
"--iree-hal-target-backends=rocm",
299-
"--iree-rocm-target-chip=" + target_triple,
299+
"--iree-hip-target=" + target_triple,
300300
"--iree-vm-bytecode-module-output-format=flatbuffer-binary",
301301
]
302302
)

models/turbine_models/tests/sdxl_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def setUp(self):
9393
decomp_attn = {
9494
"text_encoder": True,
9595
"unet": False,
96-
"vae": True,
96+
"vae": False,
9797
}
9898
self.pipe = SharkSDPipeline(
9999
arguments["hf_model_name"],
@@ -358,6 +358,8 @@ def test06_t2i_generate_images_punet(self):
358358
self.pipe.use_punet = True
359359
self.pipe.use_i8_punet = True
360360
self.pipe.setup_punet()
361+
if arguments["iree_target_triple"] != "gfx942":
362+
self.pipe.map["unet"]["export_args"]["attn_spec"] = None
361363
self.pipe.prepare_all()
362364
self.pipe.load_map()
363365
output = self.pipe.generate_images(

0 commit comments

Comments
 (0)