KEMBAR78
[tests] add a test on torch compile for varied resolutions by sayakpaul · Pull Request #11776 · huggingface/diffusers · GitHub
Skip to content

Conversation

sayakpaul
Copy link
Member

What does this PR do?

After #11360 and #11297, we can notice how torch.compile() can also benefit scenarios that go through shape changes.

This PR adds a test to catch recompilation errors on shape changes when compilation was performed with dynamic=True. I think it mimics many practical user workflows.

Requesting a review from Yiyi as you were interested in this feature.

Cc: @anijain2305 @StrongerXi for visibility.

@sayakpaul sayakpaul requested review from DN6 and yiyixuxu June 23, 2025 09:35
@sayakpaul sayakpaul added performance Anything related to performance improvements, profiling and benchmarking torch.compile labels Jun 23, 2025
Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks
we also can update the doc for hot swap lora then?

@sayakpaul
Copy link
Member Author

we also can update the doc for hot swap lora then?

I haven't added a test for this in our Hotswap + Compilation tests:

class LoraHotSwappingForModelTesterMixin:

I will do so in a future PR. But meanwhile, let me update the docs:
https://huggingface.co/docs/diffusers/en/optimization/torch2.0#torchcompile

@sayakpaul sayakpaul requested a review from stevhliu June 24, 2025 03:43
@sayakpaul
Copy link
Member Author

Cc: @AstraliteHeart this is how I envisioned the test for dynamic compilation. If you have time, it'd be great to have these tests enabled for AuraFlow, too :)

@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.

Copy link
Member

@stevhliu stevhliu 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 a185e1a into main Jun 26, 2025
29 of 30 checks passed
@sayakpaul sayakpaul deleted the test-torch-compile-varied-res branch June 26, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Anything related to performance improvements, profiling and benchmarking torch.compile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants