Skip to content
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

Merged
merged 4 commits into from
Aug 22, 2024
Merged

[tests] fix broken xformers tests #9206

merged 4 commits into from
Aug 22, 2024

Conversation

a-r-r-o-w
Copy link
Member

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

@HuggingFaceDocBuilderDev

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.

@yiyixuxu yiyixuxu requested a review from DN6 August 17, 2024 06:11
@@ -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:
Copy link
Collaborator

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?

Copy link
Member Author

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):
Copy link
Collaborator

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):

@DN6 DN6 merged commit 0ec64fe into main Aug 22, 2024
14 checks passed
yiyixuxu pushed a commit that referenced this pull request Aug 24, 2024
* fix xformers tests

* remove unnecessary modifications to cogvideox tests

* update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants