Skip to content
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

[pytree] update treespec dict keys access #116372

Open
wants to merge 37 commits into
base: gh/XuehaiPan/20/base
Choose a base branch
from

Conversation

XuehaiPan
Copy link
Collaborator

@XuehaiPan XuehaiPan commented Dec 24, 2023

Stack from ghstack (oldest at bottom):

  1. Add a new method treespec.entries()
  2. Change treespec.context access to treespec.entries() to hide the implementation details for the dict treespec.

cc @zou3519

Copy link

pytorch-bot bot commented Dec 24, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit fe223f4 with merge base 92ca17d (image):
💚 Looks good so far! There are no failures yet. 💚

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

1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jan 20, 2024
ghstack-source-id: 2eed5972c318ce90be375b13d9be2d9df3c78cf0
Pull Request resolved: pytorch#116372
@zou3519
Copy link
Contributor

zou3519 commented Jan 26, 2024

The motivation is to provide an explicit API for accessing the keys of a dict spec. Because the implementation details for context may change (i.e. in #114947 the context is changed original_keys -> (sorted_keys, original_copy)). This new API allows us to prevent torch and downstream packages from relying on spec.context to provide better backward compatibility.

It might be too late for this, we are able to serialize TreeSpec and that means that the context is a part of the public contract

1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jan 27, 2024
ghstack-source-id: 6f72467e3368ecfa89b2036347bd91ccf74e71b2
Pull Request resolved: pytorch#116372
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jan 31, 2024
ghstack-source-id: 596034f298efc5cf9f0a84fd44df4e87c720de71
Pull Request resolved: pytorch#116372
1. Add a new method `treespec.entries()`
2. Change `treespec.context` access to `treespec.entries()` to hide the implementation details for the `dict` treespec.

cc zou3519

[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Feb 14, 2024
ghstack-source-id: 74f2dd1fb40952911c66928c38688fdbff499787
Pull Request resolved: pytorch#116372
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Mar 10, 2024
ghstack-source-id: 943b1094692a00185c5d6d36291d1c7432a8f72a
Pull Request resolved: pytorch#116372
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Apr 21, 2024
ghstack-source-id: 261e5051ee8e80c2fe894ec1b9c809465c97a575
Pull Request resolved: pytorch#116372
[ghstack-poisoned]
[ghstack-poisoned]
@XuehaiPan XuehaiPan added the ciflow/trunk Trigger trunk jobs on your pull request label May 22, 2024
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request May 22, 2024
ghstack-source-id: a055c56ada5bbac024a994d2834eb2ca48a977ec
Pull Request resolved: pytorch#116372
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jun 21, 2024
ghstack-source-id: dac35c4a1d21efb02adb1bdd2079ccf7169214a0
Pull Request resolved: pytorch#116372
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jun 22, 2024
ghstack-source-id: dac35c4a1d21efb02adb1bdd2079ccf7169214a0
Pull Request resolved: pytorch#116372
Copy link

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Aug 21, 2024
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 module: pytree open source release notes: fx release notes category Stale topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants