Skip to content

[dynamo, 3.15] Minimal sentinel support - #189592

Closed
rtimpe wants to merge 10 commits into
gh/rtimpe/80/basefrom
gh/rtimpe/80/head
Closed

rtimpe wants to merge 10 commits into
gh/rtimpe/80/basefrom
gh/rtimpe/80/head

Conversation

@rtimpe

@rtimpe rtimpe commented Jul 11, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

This adds support for sentinels created outside of the compiled region and basic operations on them (identity comparsion
and attribute access). Creating sentinels, as well as other operations, are not supported yet. This is the minimal
amount of support needed for #185682

Generated with AI assistance

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

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 12 Unrelated Failures

As of commit ef22feb with merge base 12c0042 (image):

NEW FAILURE - The following job has failed:

CRCR (non-blocking) - The following CRCR downstream CI jobs failed but are non-blocking:

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

rtimpe added 2 commits July 14, 2026 23:25
[ghstack-poisoned]
[ghstack-poisoned]
@rtimpe
rtimpe marked this pull request as ready for review July 15, 2026 16:13
rtimpe added 2 commits July 15, 2026 16:14
[ghstack-poisoned]
[ghstack-poisoned]
Comment on lines +2246 to +2247
def python_type(self) -> type[builtins.sentinel]:
return self._cpython_type

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.

we should unify _cpython_type and python_type.

@guilhermeleobas

Copy link
Copy Markdown
Collaborator

Do you know if cpython migrated object() -> sentinel? If yes, we should migrate as well.

@rtimpe

rtimpe commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Do you know if cpython migrated object() -> sentinel? If yes, we should migrate as well.

It looks like some parts have, but not all. From the pep:

Note: Changing all existing sentinels in the stdlib to be implemented this way is not deemed necessary, and whether to do so is left to the discretion of the maintainers.

Claude identified dataclasses.MISSING as another place that started using sentinel, but that doesn't require any changes on dynamo's side.

We could start migrating dynamo-internal sentinels, but I don't think it's worthwhile - since it's a new feature in 3.15 we'd need a fallback to object until 3.14 support is dropped, and the main advantage is a cleaner repr, which seems relatively minor to me

@rtimpe

rtimpe commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 15, 2026
@pytorchmergebot

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

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: Merge rule check failed for stacked PR #188029:

Approvers from one of the following sets are needed:

  • Metamates (8Keep, aditvenk, AmesingFlank, andrewor14, andyanwang, ...)
  • Core Reviewers (mruberry, lezcano, Skylion007, ngimel, peterbell10, ...)
  • Core Maintainers (soumith, gchanan, ezyang, malfet, albanD, ...)
Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #190312

1 similar comment
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #190312

pytorchmergebot pushed a commit that referenced this pull request Jul 28, 2026
Fix pygen_yf to account for virtual iterators in python 3.15

Pull Request resolved: #190312
Approved by: https://github.com/Skylion007
ghstack dependencies: #188029, #189592
pytorchmergebot added a commit that referenced this pull request Jul 28, 2026
This reverts commit 7ac8666.

Reverted #189592 on behalf of https://github.com/pytorch-auto-revert due to Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable ([comment](#188029 (comment)))
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@rtimpe your PR has been reverted as part of the stack under #188029.

[ghstack-poisoned]
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
This adds support for sentinels created outside of the compiled region and basic operations on them (identity comparsion
and attribute access).  Creating sentinels, as well as other operations, are not supported yet.  This is the minimal
amount of support needed for pytorch#185682

Generated with AI assistance

Pull Request resolved: pytorch#189592
Approved by: https://github.com/guilhermeleobas
ghstack dependencies: pytorch#188029
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
Fix pygen_yf to account for virtual iterators in python 3.15

Pull Request resolved: pytorch#190312
Approved by: https://github.com/Skylion007
ghstack dependencies: pytorch#188029, pytorch#189592
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
This reverts commit 7ac8666.

Reverted pytorch#189592 on behalf of https://github.com/pytorch-auto-revert due to Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable ([comment](pytorch#188029 (comment)))
rtimpe added 3 commits July 29, 2026 18:09
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #190312

pytorchmergebot pushed a commit that referenced this pull request Jul 30, 2026
Fix pygen_yf to account for virtual iterators in python 3.15

Pull Request resolved: #190312
Approved by: https://github.com/Skylion007
ghstack dependencies: #188029, #189592
MelindaTan pushed a commit to MelindaTan/pytorch that referenced this pull request Jul 31, 2026
This adds support for sentinels created outside of the compiled region and basic operations on them (identity comparsion
and attribute access).  Creating sentinels, as well as other operations, are not supported yet.  This is the minimal
amount of support needed for pytorch#185682

Generated with AI assistance

Pull Request resolved: pytorch#189592
Approved by: https://github.com/guilhermeleobas
ghstack dependencies: pytorch#188029
MelindaTan pushed a commit to MelindaTan/pytorch that referenced this pull request Jul 31, 2026
Fix pygen_yf to account for virtual iterators in python 3.15

Pull Request resolved: pytorch#190312
Approved by: https://github.com/Skylion007
ghstack dependencies: pytorch#188029, pytorch#189592
MelindaTan pushed a commit to MelindaTan/pytorch that referenced this pull request Jul 31, 2026
This reverts commit 7ac8666.

Reverted pytorch#189592 on behalf of https://github.com/pytorch-auto-revert due to Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable ([comment](pytorch#188029 (comment)))
@atalman atalman mentioned this pull request Aug 31, 2026
60 of 63 tasks
@github-actions
github-actions Bot deleted the gh/rtimpe/80/head branch October 28, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request Merged module: dynamo open source Reverted topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants