-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[tests] fix broken xformers tests #9206
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
@@ -2011,6 +2011,11 @@ def __call__( | |||
key = attn.head_to_batch_dim(key).contiguous() | |||
value = attn.head_to_batch_dim(value).contiguous() | |||
|
|||
if attn.norm_q is not None: |
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.
Which test is this meant to fix?
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.
The CogVideoX tests. This was needed because we added QK norm in Attn2.0 and FusedAttn2.0.
However, after the new CogVideoX-5B PR, I think we can no longer support XFormers due to needing a custom attention processor. Maybe we can skip the test here because otherwise we'd need a custom XFormers processor variant for it?
@@ -1687,7 +1687,15 @@ def _test_xformers_attention_forwardGenerator_pass( | |||
self.assertLess(max_diff, expected_max_diff, "XFormers attention should not affect the inference results") | |||
|
|||
if test_mean_pixel_difference: | |||
assert_mean_pixel_difference(output_with_offload[0], output_without_offload[0]) | |||
if torch.is_tensor(output_without_offload): |
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.
If the issue is the output shapes it would be better to redefine the tests for that output shape inside the pipeline test modules. Similar to what's done here:
def test_xformers_attention_forwardGenerator_pass(self): |
* fix xformers tests * remove unnecessary modifications to cogvideox tests * update
* fix xformers tests * remove unnecessary modifications to cogvideox tests * update
What does this PR do?
Context: https://github.com/huggingface/diffusers/actions/runs/10414785958/job/28844261331#logs
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@DN6