Skip to content

[while_loop] fix constant tensor used as carried inputs#158381

Closed
ydwu4 wants to merge 3 commits intogh/ydwu4/281/basefrom
gh/ydwu4/281/head
Closed

[while_loop] fix constant tensor used as carried inputs#158381
ydwu4 wants to merge 3 commits intogh/ydwu4/281/basefrom
gh/ydwu4/281/head

Conversation

@ydwu4
Copy link
Contributor

@ydwu4 ydwu4 commented Jul 15, 2025

Stack from ghstack (oldest at bottom):

Address second part of #158366, where torch.tensor(0), is treated as a constant tensor and its .item() gets specailized to 0 which causes a silent specialization. The fix is to unspecialize the constant carries and make them non-constant.

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

@ydwu4 ydwu4 requested a review from zou3519 as a code owner July 15, 2025 20:53
@pytorch-bot
Copy link

pytorch-bot bot commented Jul 15, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158381

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 7b5c235 with merge base 5b10b0a (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

):
export(M(), (torch.randn(2, 3),), strict=False)

@testing.expectedFailureTrainingIRToRunDecomp # Could not guard on data-dependent expression -u0 > 16 (unhinted: -u0 > 16)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the first issue in #158366. Need a separate fix.


Address second part of #158366, where torch.tensor(0), is treated as a constant tensor and its .item() gets specailized to 0 which causes a silent specialization. The fix is to unspecialize the constant carries and make them non-constant.


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

[ghstack-poisoned]
@ydwu4 ydwu4 added the topic: not user facing topic category label Jul 15, 2025

Address second part of #158366, where torch.tensor(0), is treated as a constant tensor and its .item() gets specailized to 0 which causes a silent specialization. The fix is to unspecialize the constant carries and make them non-constant.


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

[ghstack-poisoned]
ydwu4 added a commit that referenced this pull request Jul 15, 2025
@ydwu4
Copy link
Contributor Author

ydwu4 commented Jul 18, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 18, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

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

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actions github-actions bot deleted the gh/ydwu4/281/head branch August 18, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants