Skip to content

[Tests] Improve transformers model test suite coverage - Hunyuan DiT #8916

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

Merged
merged 12 commits into from
Aug 6, 2024

Conversation

rootonchair
Copy link
Contributor

What does this PR do?

Part of #8907

@DN6 @sayakpaul

Before submitting

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.

@rootonchair
Copy link
Contributor Author

The model use HunyuanAttnProcessor2_0 so two tests test_set_xformers_attn_processor_for_determinism and test_set_attn_processor_for_determinism are failing

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think it's okay to skip the xformers tests for this model.

Comment on lines 42 to 43
sequence_length = 77
sequence_length_t5 = 256
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two could be further reduced?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried but it cause the tests to fail

"sample_size": 16,
"patch_size": 2,
"in_channels": 4,
"num_layers": 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can fix the num_layers to 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@sayakpaul sayakpaul requested a review from DN6 July 21, 2024 10:57
Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two additional comments. Thanks for your changes related to xformers.

"in_channels": 4,
"num_layers": 1,
"attention_head_dim": 8,
"num_attention_heads": 3,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep it to 2, I guess?

"cross_attention_dim": 32,
"cross_attention_dim_t5": 32,
"pooled_projection_dim": 16,
"hidden_size": 24,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further reduction possible?

@rootonchair rootonchair requested a review from sayakpaul July 29, 2024 14:53
@rootonchair
Copy link
Contributor Author

Hi @sayakpaul could you help me if this PR is ok?

@sayakpaul
Copy link
Member

Oh sorry. I think the PR is very nice. Will merge once the CI is green.

@sayakpaul sayakpaul merged commit 87e50a2 into huggingface:main Aug 6, 2024
11 checks passed
sayakpaul added a commit that referenced this pull request Dec 23, 2024
…8916)

* add hunyuan model test

* apply suggestions

* reduce dims further

* reduce dims further

* run make style

---------

Co-authored-by: Sayak Paul <[email protected]>
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.

2 participants