Skip to content

[tests] add a test on torch compile for varied resolutions - #11776

Merged
sayakpaul merged 9 commits into
mainfrom
test-torch-compile-varied-res
Jun 26, 2025
Merged

[tests] add a test on torch compile for varied resolutions#11776
sayakpaul merged 9 commits into
mainfrom
test-torch-compile-varied-res

Conversation

@sayakpaul

Copy link
Copy Markdown
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 yiyixuxuJune 23, 2025 09:35
@sayakpaulsayakpaul added performance Anything related to performance improvements, profiling and benchmarking torch.compile labels Jun 23, 2025

@yiyixuxuyiyixuxu left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

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

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

classLoraHotSwappingForModelTesterMixin:

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 stevhliuJune 24, 2025 03:43
@sayakpaul

Copy link
Copy Markdown
MemberAuthor

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

Copy link
Copy Markdown

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.

@stevhliustevhliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment threaddocs/source/en/optimization/fp16.md Outdated
Comment threaddocs/source/en/optimization/fp16.md Outdated
Comment threaddocs/source/en/optimization/fp16.md Outdated
Comment threaddocs/source/en/optimization/fp16.md Outdated
@sayakpaul
sayakpaul merged commit a185e1a into mainJun 26, 2025
@sayakpaul
sayakpaul deleted the test-torch-compile-varied-res branch June 26, 2025 04:37
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performanceAnything related to performance improvements, profiling and benchmarkingtorch.compile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sayakpaul@HuggingFaceDocBuilderDev@yiyixuxu@stevhliu