This repository was archived by the owner on Aug 21, 2025. It is now read-only.
Conversation
bdhirsh
added a commit
to pytorch/pytorch
that referenced
this pull request
May 19, 2022
…ton bug" This should fix the remaining dynamo <> functionalization integration issue. I had a fix earlier for JIT containers not correctly having singleton instances [here](#76085), which fixed a bug in this code for functionalization: ``` def f(a, b): return a[b] functionalize(foo)(torch.arange(3), torch.ones(2, dtype=torch.long)) ``` But apparently the following code is still broken: ``` def f(a, b): return torch.ops.aten.index(a, b) functionalize(foo)(torch.arange(3), torch.ones(2, dtype=torch.long)) ``` Why? we have separate schema parsing logic for the ops in `torch.ops.aten`, and that logic circumvented my fix, creating its own singleton instance for Optional[Tensor]. We can't test this in core for the same reason as the last fix, so companion functorch tests here: pytorch/functorch#820 [ghstack-poisoned]
bdhirsh
added a commit
to pytorch/pytorch
that referenced
this pull request
May 19, 2022
This should fix the remaining dynamo <> functionalization integration issue. I had a fix earlier for JIT containers not correctly having singleton instances [here](#76085), which fixed a bug in this code for functionalization: ``` def f(a, b): return a[b] functionalize(foo)(torch.arange(3), torch.ones(2, dtype=torch.long)) ``` But apparently the following code is still broken: ``` def f(a, b): return torch.ops.aten.index(a, b) functionalize(foo)(torch.arange(3), torch.ones(2, dtype=torch.long)) ``` Why? we have separate schema parsing logic for the ops in `torch.ops.aten`, and that logic circumvented my fix, creating its own singleton instance for Optional[Tensor]. We can't test this in core for the same reason as the last fix, so companion functorch tests here: pytorch/functorch#820 [ghstack-poisoned]
Contributor
|
(should give this a rebase before merge to check the test passes when the change makes it into pytorch/pytorch. Yay co-development) |
Contributor
|
Rebased; will merge on green |
zou3519
added a commit
to zou3519/pytorch
that referenced
this pull request
Jul 20, 2022
* add functionalize index tests * Update expecttest Co-authored-by: Richard Zou <zou3519@gmail.com>
bigfootjon
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Jul 21, 2022
* add functionalize index tests * Update expecttest Co-authored-by: Richard Zou <zou3519@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a bug with JIT container types that caused a problem with List[Optional[Tensor]] arguments, that only actually surfaces in functorch (basically
libtorch.soandfunctorch.sowill each get their own static singleton instance of that type). Adding tests for it here.companion core patch: pytorch/pytorch#77846