Skip to content

Commit f0fc4ae

Browse files
committed
re-enabled SD pipeline test
1 parent a86fa63 commit f0fc4ae

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

.github/workflows/run-op-by-op-model-tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ jobs:
104104
"
105105
},
106106
{
107-
runs-on: wormhole_b0, name: "stable-diffusion", tests: "
107+
runs-on: wormhole_b0, name: "stable-diffusion-pipe", tests: "
108108
tests/models/stable_diffusion/test_stable_diffusion.py::test_stable_diffusion
109-
tests/models/stable_diffusion/test_stable_diffusion_v2.py::test_stable_diffusion_v2
109+
"
110+
},
111+
{
112+
runs-on: wormhole_b0, name: "stable-diffusion-unet", tests: "
113+
tests/models/stable_diffusion/test_stable_diffusion_unet.py::test_stable_diffusion_unet
110114
"
111115
},
112116
{

tests/models/stable_diffusion/test_stable_diffusion.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import torch
77
import pytest
88
from tests.utils import ModelTester
9-
from tt_torch.tools.utils import OpByOpBackend
9+
from tt_torch.tools.utils import CompilerConfig, CompileDepth, OpByOpBackend
1010

1111

1212
class ThisTester(ModelTester):
@@ -16,24 +16,37 @@ def _load_model(self):
1616
return pipe
1717

1818
def _load_inputs(self):
19-
prompt = "a photo of an astronaut riding a horse on mars"
19+
prompt = [
20+
"a photo of an astronaut riding a horse on mars",
21+
]
2022
return prompt
2123

2224

2325
@pytest.mark.parametrize(
2426
"mode",
2527
["eval"],
2628
)
27-
@pytest.mark.skip(reason="Dynamo cannot support pipeline.")
2829
@pytest.mark.parametrize(
2930
"op_by_op",
3031
[OpByOpBackend.STABLEHLO, OpByOpBackend.TORCH, None],
3132
ids=["op_by_op_stablehlo", "op_by_op_torch", "full"],
3233
)
34+
@pytest.mark.xfail(
35+
reason="Fails due to pt2 compile issue when finishing generation, but we can still generate a graph"
36+
)
3337
def test_stable_diffusion(record_property, mode, op_by_op):
3438
model_name = "Stable Diffusion"
3539

36-
tester = ThisTester(model_name, mode, record_property_handle=record_property)
40+
cc = CompilerConfig()
41+
cc.enable_consteval = True
42+
cc.consteval_parameters = True
43+
if op_by_op:
44+
cc.compile_depth = CompileDepth.EXECUTE_OP_BY_OP
45+
if op_by_op == OpByOpBackend.STABLEHLO:
46+
cc.op_by_op_backend = OpByOpBackend.STABLEHLO
47+
tester = ThisTester(
48+
model_name, mode, compiler_config=cc, record_property_handle=record_property
49+
)
3750
results = tester.test_model()
3851
if mode == "eval":
3952
image = results.images[0]

tests/models/stable_diffusion/test_stable_diffusion_v2.py renamed to tests/models/stable_diffusion/test_stable_diffusion_unet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def _load_inputs(self):
6969
[OpByOpBackend.STABLEHLO, OpByOpBackend.TORCH, None],
7070
ids=["op_by_op_stablehlo", "op_by_op_torch", "full"],
7171
)
72-
def test_stable_diffusion_v2(record_property, mode, op_by_op):
73-
model_name = "Stable Diffusion V2"
72+
def test_stable_diffusion_unet(record_property, mode, op_by_op):
73+
model_name = "Stable Diffusion UNET"
7474

7575
cc = CompilerConfig()
7676
cc.enable_consteval = True

0 commit comments

Comments
 (0)