Repository navigation
[ci] fix compilation CI. #15092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[ci] fix compilation CI. #15092
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| import torch | ||
|
|
||
| from diffusers import Kandinsky6SRTransformer3DModel | ||
| from diffusers.utils import is_torch_version | ||
| from diffusers.utils.torch_utils import randn_tensor | ||
|
|
||
| from ...testing_utils import enable_full_determinism, torch_device | ||
|
|
@@ -60,10 +61,11 @@ def get_init_dict(self) -> dict: | |
| "out_visual_dim": 8, | ||
| "time_dim": 16, | ||
| "patch_size": (1, 2, 2), | ||
| "model_dim": 24, | ||
| "model_dim": 32, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To satisfy the requirements of Flex + compile. |
||
| "ff_dim": 32, | ||
| "num_visual_blocks": 2, | ||
| "axes_dims": (4, 4, 4), | ||
| # head_dim = sum(axes_dims); Inductor lowers flex attention only for head dims of at least 16 | ||
| "axes_dims": (4, 6, 6), | ||
| } | ||
|
|
||
| def _build_dummy_inputs(self, batch_size: int, num_frames: int, height: int, width: int) -> dict: | ||
|
|
@@ -106,6 +108,35 @@ def different_shapes_for_compilation(self): | |
| def get_dummy_inputs(self, height: int = 16, width: int = 16) -> dict: | ||
| return self._build_dummy_inputs(batch_size=1, num_frames=2, height=height, width=width) | ||
|
|
||
| @pytest.mark.xfail( | ||
| condition=is_torch_version("<", "2.12"), | ||
| reason="torch < 2.12 cannot trace `AttentionBackendName(backend)` in `dispatch_attention_fn` in a full graph.", | ||
| raises=torch._dynamo.exc.Unsupported, | ||
| strict=True, | ||
| ) | ||
| def test_torch_compile_recompilation_and_graph_break(self): | ||
| super().test_torch_compile_recompilation_and_graph_break() | ||
|
|
||
| @pytest.mark.xfail( | ||
| condition=is_torch_version("<", "2.12"), | ||
| reason="torch < 2.12 cannot trace `AttentionBackendName(backend)` in `dispatch_attention_fn` in a full graph.", | ||
| raises=torch._dynamo.exc.Unsupported, | ||
| strict=True, | ||
| ) | ||
| def test_torch_compile_repeated_blocks(self): | ||
| super().test_torch_compile_repeated_blocks() | ||
|
|
||
| @pytest.mark.xfail( | ||
| reason=( | ||
| "The token grid is split into 8x8 blocks and `sliding_tile_mask` sizes its table by `max(...)` of the block " | ||
| "counts, so the compiled graph specializes on the input shape and recompiles." | ||
| ), | ||
| raises=(torch._dynamo.exc.Unsupported, torch._dynamo.exc.RecompileError), | ||
| strict=True, | ||
| ) | ||
| def test_compile_on_different_shapes(self): | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can make it work with some modeling-level changes but not a priority for this model at the moment IMO. |
||
| super().test_compile_on_different_shapes() | ||
|
|
||
|
|
||
| @pytest.mark.skipif(torch_device == "cpu", reason="FlexAttention does not support backward on CPU.") | ||
| class TestKandinsky6SRTransformerTraining(Kandinsky6SRTransformerTesterConfig, TrainingTesterMixin): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we fix this in
dispatch_attention_fn? Our min supported version is torch 2.6 so if this can be addressed in src, we should handle it.