Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[dynamo][super variable] Fix bug to use correct source#151154

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@anijain2305
Copy link
Contributor

@anijain2305anijain2305 commentedApr 12, 2025
edited
Loading

Stack fromghstack (oldest at bottom):

Fixes#150994

We should cherry-pick to 2.7 branch if possible, because this breaks torch.compile on some HF models. Look at the issue referenced here.

cc@voznesenskym@penguinwu@EikanWang@jgong5@Guobing-Chen@XiaobingSuper@zhuhaozhe@blzheng@wenzhe-nrv@jiayisunx@chenyang78@kadeng@chauhang@amjames

Will add test in a follow up PR, because this PR might need to becherry-picked to 2.7. So keeping the PR very simple to cherry-pick[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-botbot commentedApr 12, 2025
edited
Loading

🔗 Helpful Links

🧪 See artifacts and rendered test results athud.pytorch.org/pr/151154

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commitbf0eb70 with merge base2653498 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@anijain2305
Copy link
ContributorAuthor

Asked for review too early. CI failures say that something is really wrong. Converting to draft.

ydshieh reacted with thumbs up emoji

@anijain2305anijain2305 removed the request for review fromjanselApril 12, 2025 04:47
Will add test in a follow up PR, because this PR might need to becherry-picked to 2.7. So keeping the PR very simple to cherry-pickFixes#150994cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames[ghstack-poisoned]
Will add test in a follow up PR, because this PR might need to becherry-picked to 2.7. So keeping the PR very simple to cherry-pickFixes#150994cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames[ghstack-poisoned]
Will add test in a follow up PR, because this PR might need to becherry-picked to 2.7. So keeping the PR very simple to cherry-pickFixes#150994cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames[ghstack-poisoned]
anijain2305 added a commit that referenced this pull requestApr 12, 2025
Will add test in a follow up PR, because this PR might need to becherry-picked to 2.7. So keeping the PR very simple to cherry-pickghstack-source-id:7d03594Pull Requestresolved:#151154
@anijain2305anijain2305 added topic: not user facingtopic category keep-goingDon't stop on first failure, keep running tests until the end labelsApr 12, 2025
Fixes#150994We should cherry-pick to 2.7 branch if possible, because this breaks torch.compile on some HF models. Look at the issue referenced here.cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames[ghstack-poisoned]


LayoutLMForSequenceClassification,pass,5
LayoutLMForSequenceClassification,pass,6
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Both GPT2 and Layout are correct increases. There is a legit recompilation

image

we were not guarding on self.config.problem_type which isNone in the first run, and initiailaized there.

Fixes#150994We should cherry-pick to 2.7 branch if possible, because this breaks torch.compile on some HF models. Look at the issue referenced here.cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames[ghstack-poisoned]
anijain2305 added a commit that referenced this pull requestApr 12, 2025
Will add test in a follow up PR, because this PR might need to becherry-picked to 2.7. So keeping the PR very simple to cherry-pickghstack-source-id:4a519e6Pull Requestresolved:#151154
@anijain2305anijain2305 marked this pull request as ready for reviewApril 12, 2025 17:37
@anijain2305anijain2305 added the ciflow/trunkTrigger trunk jobs on your pull request labelApr 12, 2025
@anijain2305
Copy link
ContributorAuthor

@pytorchbot merge

pytorch-bot[bot] reacted with thumbs up emoji

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in thewiki.

Questions? Feedback? Please reach out to thePyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@anijain2305
Copy link
ContributorAuthor

@pytorchbot cherry-pick --onto release/2.7 -c critical

pytorch-bot[bot] reacted with thumbs up emoji

@pytorchbot
Copy link
Collaborator

Cherry picking#151154

Commandgit -C /home/runner/work/pytorch/pytorch cherry-pick -x 7b1a2373e87f5a2a3582cb4e37e47a7c544edf7a returned non-zero exit code 1

Auto-merging test/dynamo/test_misc.pyAuto-merging torch/_dynamo/guards.pyAuto-merging torch/_dynamo/source.pyAuto-merging torch/_dynamo/variables/misc.pyCONFLICT (content): Merge conflict in torch/_dynamo/variables/misc.pyAuto-merging torch/csrc/dynamo/guards.cpperror: could not apply 7b1a2373e87... [dynamo][super variable] Fix bug to use correct source (#151154)hint: After resolving the conflicts, mark them withhint: "git add/rm <pathspec>", then runhint: "git cherry-pick --continue".hint: You can instead skip this commit with "git cherry-pick --skip".hint: To abort and get back to the state before "git cherry-pick",hint: run "git cherry-pick --abort".hint: Disable this message with "git config set advice.mergeConflict false"
Details for Dev Infra teamRaised byworkflow job

@ydshieh
Copy link

Hi@anijain2305 Thank you a lot for the fix. If I want to try the fix, what would the best approach? Like a wheel for torch 2.7 RC with this fix included? Or checkout to branch/tagrelease/2.7 and build torch from there? I can't seerelease/2.7 with this fix applied despite I saw you commentedcherry-pick --onto release/2.7 -c critical

timocafe pushed a commit to timocafe/pytorch that referenced this pull requestApr 16, 2025
Fixespytorch#150994We should cherry-pick to 2.7 branch if possible, because this breaks torch.compile on some HF models. Look at the issue referenced here.Pull Requestresolved:pytorch#151154Approved by:https://github.com/jansel
amathewc pushed a commit to amathewc/pytorch that referenced this pull requestApr 17, 2025
Fixespytorch#150994We should cherry-pick to 2.7 branch if possible, because this breaks torch.compile on some HF models. Look at the issue referenced here.Pull Requestresolved:pytorch#151154Approved by:https://github.com/jansel
@gante
Copy link

👋 I have the same question as@ydshieh -- what's the best way to try the fix?

We noticed thattorch.compile on HF VLMs/LLMs, with torch 2.7, results in large slowdowns, so we're pinning the max version to torch 2.6 for now:huggingface/transformers#37760

@atalmanatalman added this to the2.7.1 milestoneApr 25, 2025
@atalman
Copy link
Contributor

adding to 2.7.1

@anijain2305
Copy link
ContributorAuthor

@gante@ydshieh We apologize for the regression with 2.7. Please allow us till Monday to check if this PR indeed resolves the regression. We can figure out how to proceed then.

ydshieh and gante reacted with thumbs up emoji

@ydshieh
Copy link

Hi, share an observation I found. Today I tried to update our docker images to use torch 2.7(+cpu), and find we find the same issues happens for 6 tests, seethis run

For example: running

python -m pytest -v tests/models/gemma3/test_modeling_gemma3.py::Gemma3Vision2TextModelTest::test_generate_compilation_all_outputs

gives

FAILED tests/models/gemma3/test_modeling_gemma3.py::Gemma3Vision2TextModelTest::test_generate_compilation_all_outputs - torch._dynamo.exc.Unsupported: Unexpectedtypein sourceless builder transformers.models.gemma3.configuration_gemma3.Gemma3TextConfigfrom user code:   File"/usr/local/lib/python3.9/site-packages/transformers/utils/generic.py", line 969,in wrapper    output = func(self,*args,**kwargs)  File"/usr/local/lib/python3.9/site-packages/transformers/models/gemma3/modeling_gemma3.py", line 1320,in forward    causal_mask = self._update_causal_mask(  File"/usr/local/lib/python3.9/site-packages/transformers/models/gemma3/modeling_gemma3.py", line 1115,in _update_causal_maskif self.config.text_config._attn_implementation =="flash_attention_2":  File"/usr/local/lib/python3.9/site-packages/transformers/configuration_utils.py", line 211,in __getattribute__returnsuper().__getattribute__(key)Set TORCHDYNAMO_VERBOSE=1for the internal stack trace (pleasedo this especiallyif you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"FAILED tests/models/gemma3/test_modeling_gemma3.py::Gemma3Vision2TextModelTest::test_generate_compile_model_forward - torch._dynamo.exc.Unsupported: Unexpected type in sourceless builder transformers.models.gemma3.configuration_gemma3.Gemma3TextConfigfrom user code:   File "/usr/local/lib/python3.9/site-packages/transformers/utils/generic.py", line 969, in wrapper    output = func(self, *args, **kwargs)  File "/usr/local/lib/python3.9/site-packages/transformers/models/gemma3/modeling_gemma3.py", line 1320, in forward    causal_mask = self._update_causal_mask(  File "/usr/local/lib/python3.9/site-packages/transformers/models/gemma3/modeling_gemma3.py", line 1115, in _update_causal_mask    if self.config.text_config._attn_implementation == "flash_attention_2":  File "/usr/local/lib/python3.9/site-packages/transformers/configuration_utils.py", line 211, in __getattribute__    return super().__getattribute__(key)Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context,set TORCH_LOGS="+dynamo"===== 2 failed, 1267 passed, 406 skipped, 46 warningsin 143.60s (0:02:23) =====

@anijain2305
Copy link
ContributorAuthor

@ydshieh@gante We are cherry-picking this PR (along with the other cudagraph bug PR) for 2.7.1 -#152774

I have tested above test passes with the PR built on top of 2.7 (and I verified that if failed on 2.7). Once the PR is merged to a release branch, it would be really helpful to do some extra testing from your side.

ydshieh and gante reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@janseljanseljansel approved these changes

@zou3519zou3519Awaiting requested review from zou3519

@tugsbayasgalantugsbayasgalanAwaiting requested review from tugsbayasgalan

@StrongerXiStrongerXiAwaiting requested review from StrongerXi

Assignees

No one assigned

Labels

ciflow/inductorciflow/trunkTrigger trunk jobs on your pull requestkeep-goingDon't stop on first failure, keep running tests until the endMergedmodule: dynamotopic: not user facingtopic category

Projects

None yet

Milestone

2.7.1

Development

Successfully merging this pull request may close these issues.

8 participants

@anijain2305@pytorchmergebot@pytorchbot@ydshieh@gante@atalman@jansel

[8]ページ先頭

©2009-2025 Movatter.jp