{{ message }}
Repository navigation
Fix Dynamo lru_cache warnings during torch.compile - #13384
Merged
Merged
Conversation
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Contributor
Author
sayakpaul
reviewed
Apr 2, 2026
| "_parallel_config": parallel_config, | ||
| } | ||
| if is_torch_version(">=", "2.5.0"): | ||
| if _CAN_USE_FLEX_ATTN: |
Member
There was a problem hiding this comment.
Is this a safe replacement? If so, could you elaborate further?
Contributor
Author
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
Added comments for it.
sayakpaul
reviewed
Apr 2, 2026
sayakpaul
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR. Left one comment.
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
|
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. |
Contributor
Author
sayakpaul
approved these changes
Apr 3, 2026
sayakpaul
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR! Failing test is unrelated.
terarachang
pushed a commit
to terarachang/diffusers
that referenced
this pull request
Apr 30, 2026
…3384) * fix compile issue Signed-off-by: jiqing-feng <jiqing.feng@intel.com> * compile friendly Signed-off-by: jiqing-feng <jiqing.feng@intel.com> * add comments Signed-off-by: jiqing-feng <jiqing.feng@intel.com> --------- Signed-off-by: jiqing-feng <jiqing.feng@intel.com> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Fixes Dynamo
lru_cachewarnings when usingtorch.compileon diffusion pipelines. Two changes:attention_dispatch.py:dispatch_attention_fncallsis_torch_version(">=", "2.5.0")at runtime, which is@lru_cache-wrapped. Replace with the existing module-level constant_CAN_USE_FLEX_ATTNso Dynamo never traces into it.torch_utils.py:lru_cache_unless_exportonly bypasseslru_cacheduringtorch.export(is_exporting). Addis_compilingcheck sotorch.compilealso bypasses the cache wrapper.Reproduce
out before fix:
out after fix: