Skip to content

[test_models_transformer_hunyuan_video] help us test torch.compile() for impactful models #11431

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 4 commits into from
Apr 30, 2025

Conversation

tongyu0924
Copy link
Contributor

@tongyu0924 tongyu0924 commented Apr 28, 2025

What does this PR do?

Part of #11430

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.

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 for the PR! I just ran the tests but ran into errors: https://pastebin.com/A6c4gnwd.

@a-r-r-o-w possible to take a look when you have a moment?

Comment on lines 93 to 95
def test_gradient_checkpointing_is_applied(self):
expected_set = {"HunyuanVideoTransformer3DModel"}
super().test_gradient_checkpointing_is_applied(expected_set=expected_set)
Copy link
Member

Choose a reason for hiding this comment

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

This can be done in a separate PR.

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

Yeah, our Hunyuan implementation is not compatible with torch.compile back from when we integrated it. I'll open a PR rewriting the attention mask implementation

@sayakpaul
Copy link
Member

Reopening as this PR has the test case.

@sayakpaul sayakpaul reopened this Apr 30, 2025
@sayakpaul
Copy link
Member

I have run the tests and they also pass:

export RUN_SLOW=1
export RUN_COMPILE=1
pytest tests/models/transformers/test_models_transformer_hunyuan_video.py -k "test_torch_compile_recompilation_and_graph_break"

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!

@sayakpaul sayakpaul merged commit 38ced7e into huggingface:main Apr 30, 2025
7 of 8 checks passed
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