Skip to content

Conversation

@voznesenskym
Copy link
Collaborator

@voznesenskym voznesenskym commented Jan 4, 2024

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

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 4, 2024

🔗 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 Failures

As of commit 4c302a1 with merge base 7562a00 (image):

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.

@facebook-github-bot
Copy link
Contributor

@voznesenskym has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@voznesenskym voznesenskym changed the title Re-PR of PR for internal sync - update title Support tensors as Dict keys Re-PR of #111196 Jan 5, 2024
facebook-github-bot pushed a commit to pytorch/benchmark that referenced this pull request Jan 6, 2024
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
@voznesenskym voznesenskym added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels Jan 6, 2024
@facebook-github-bot
Copy link
Contributor

@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)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

@voznesenskym voznesenskym reopened this Jan 6, 2024
@facebook-github-bot
Copy link
Contributor

@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).)

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request Jan 6, 2024
This reverts commit 1badad9.

Reverted #116785 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally ([comment](#116785 (comment)))
@pytorchmergebot
Copy link
Collaborator

@voznesenskym your PR has been successfully reverted.

@albanD albanD removed their request for review January 6, 2024 13:10
@github-actions
Copy link
Contributor

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 Mar 25, 2024
@github-actions github-actions bot closed this Apr 24, 2024
@github-actions github-actions bot deleted the voz/re-pr-dict-refactor branch May 30, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants