-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Support tensors as Dict keys Re-PR of #111196 #116785
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/116785
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 3 Unrelated FailuresAs of commit 4c302a1 with merge base 7562a00 ( NEW FAILURE - The following job has failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@voznesenskym has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This prepares the PR where we implement sets in terms of dicts. To do so, rather than storing internally a dictionary that maps literals to VariableTrackers, it stores (pretty much) a dictionary from VTs to VTs. To do so, keys are wrapped in an opaque internal class _Hashable. The Hashable class is opaque on purpose so that it fails hard if if it inadvertently leaks back into user code. We also found and fixed a number of latent bugs and inconsistencies in the way dynamo checked what can be a dict key. More generally, we make much clearer what are the things that need to be modified to add a new supported key type to Dicts. Fixes #107595 Fixes #111603 Re-PR of pytorch/pytorch#111196 - sadly due to reverts, we could not reuse lezcano's original PR. X-link: pytorch/pytorch#116785 Reviewed By: jansel, mlazos Differential Revision: D52546937 Pulled By: voznesenskym fbshipit-source-id: f82b977ab110b54aeaa802858107fda24f9ee7f9
|
@pytorchbot merge -f 'Landed internally' (Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally) |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot revert -m="Diff reverted internally" -c="ghfirst" This Pull Request has been reverted by a revert inside Meta. To re-land this change, please open another pull request, assign the same reviewers, fix the CI failures that caused the revert and make sure that the failing CI runs on the PR by applying the proper ciflow label (e.g., ciflow/trunk).) |
|
@pytorchbot successfully started a revert job. Check the current status here. |
This reverts commit 1badad9. Reverted #116785 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally ([comment](#116785 (comment)))
|
@voznesenskym your PR has been successfully reverted. |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
This prepares the PR where we implement sets in terms of dicts.
To do so, rather than storing internally a dictionary that maps literals
to VariableTrackers, it stores (pretty much) a dictionary from VTs to VTs.
To do so, keys are wrapped in an opaque internal class _Hashable.
The Hashable class is opaque on purpose so that it fails hard if
if it inadvertently leaks back into user code.
We also found and fixed a number of latent bugs and inconsistencies
in the way dynamo checked what can be a dict key. More generally, we
make much clearer what are the things that need to be modified to add
a new supported key type to Dicts.
Fixes #107595
Fixes #111603
Re-PR of #111196 sadly due to reverts, we could not reuse @lezcano's original PR.
cc @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @aakhundov