Skip to content

[pytree][Easy] preserve dict keys in insertion order in CXX pytree #130140

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 102 commits into from

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jul 5, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit c21880a with merge base 6a9a02a (image):
💚 Looks good so far! There are no failures yet. 💚

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

[ghstack-poisoned]
XuehaiPan added 12 commits July 5, 2024 16:37
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jul 7, 2024
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jul 9, 2024
[ghstack-poisoned]
@XuehaiPan XuehaiPan changed the title [pytree] preserve dict keys in insertion order in CXX pytree [pytree][Easy] preserve dict keys in insertion order in CXX pytree Jan 9, 2025
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jan 9, 2025
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jan 10, 2025
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Feb 4, 2025
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Feb 9, 2025
Comment on lines +64 to +65
__TORCH_DICT_SESSION = optree.dict_insertion_ordered(True, namespace="torch")
__TORCH_DICT_SESSION.__enter__() # enable globally and permanently
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

If you're sure about this. The fun thing is if someone imports torch cxx_pytree and uses optree then they will override the optree behavior

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It only affects optree functions that passed with namespace="torch".

@XuehaiPan
Copy link
Collaborator Author

@pytorchbot merge

@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/XuehaiPan/108/head branch March 23, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged module: pytree open source topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants