-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix functionalize() input metadata mutations, migrate core test to use functionalize() #82601
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
…e functionalize() [ghstack-poisoned]
🔗 Helpful links
❌ 14 New Failures, 1 Flaky FailuresAs of commit 6830320 (more details on the Dr. CI page): Expand to see more
🕵️ 14 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
… test to use functionalize()" [ghstack-poisoned]
| from torch.utils._pytree import tree_map | ||
| from torch.fx.experimental.proxy_tensor import make_fx | ||
| from torch.fx.passes.reinplace import reinplace | ||
| from functorch.experimental import functionalize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the build systems are not unified yet, ideally you should test if functorch is actually importable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, looks like CI is actually failing for that reason....
Any idea on the timeline for unifying build systems? Otherwise I guess I could try to import functionalize(), and fall back to the roll-your-own version that was in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to test in CI, just update the CI to start building functorch after regular pytorch
@zou3519 knows unified build timeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, A short fix is to install functorch in all CI configurations so that it's available for testing.
Unified build timeline: by 1.13, unless people have reasons for it earlier
ezyang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
short and sweet (well maybe not the expect test updates lol)
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
…n inputs" A version of this PR was sitting at #82601 but that PR some other cleanup that relies on being able to use functorch in pytorch/pytorch CI tests, which isn't ready yet. I pulled the change out here to unblock functionalization for some models run with inductor (see pytorch/torchdynamo#964 (comment)). [ghstack-poisoned]
A version of this PR was sitting at #82601 but that PR some other cleanup that relies on being able to use functorch in pytorch/pytorch CI tests, which isn't ready yet. I pulled the change out here to unblock functionalization for some models run with inductor (see pytorch/torchdynamo#964 (comment)). [ghstack-poisoned]
…n inputs" A version of this PR was sitting at #82601 but that PR some other cleanup that relies on being able to use functorch in pytorch/pytorch CI tests, which isn't ready yet. I pulled the change out here to unblock functionalization for some models run with inductor (see pytorch/torchdynamo#964 (comment)). [ghstack-poisoned]
A version of this PR was sitting at #82601 but that PR some other cleanup that relies on being able to use functorch in pytorch/pytorch CI tests, which isn't ready yet. I pulled the change out here to unblock functionalization for some models run with inductor (see pytorch/torchdynamo#964 (comment)). [ghstack-poisoned]
A version of this PR was sitting at #82601 but that PR some other cleanup that relies on being able to use functorch in pytorch/pytorch CI tests, which isn't ready yet. I pulled the change out here to unblock functionalization for some models run with inductor (see pytorch/torchdynamo#964 (comment)). Pull Request resolved: #83993 Approved by: https://github.com/ezyang
Summary: A version of this PR was sitting at pytorch/pytorch#82601 but that PR some other cleanup that relies on being able to use functorch in pytorch/pytorch CI tests, which isn't ready yet. I pulled the change out here to unblock functionalization for some models run with inductor (see pytorch/torchdynamo#964 (comment)). X-link: pytorch/pytorch#83993 Approved by: https://github.com/ezyang Reviewed By: malfet Differential Revision: D39034436 Pulled By: bdhirsh fbshipit-source-id: a419018f4306e8dc2e7542d793c0520bf821fb1d
Summary: A version of this PR was sitting at #82601 but that PR some other cleanup that relies on being able to use functorch in pytorch/pytorch CI tests, which isn't ready yet. I pulled the change out here to unblock functionalization for some models run with inductor (see pytorch/torchdynamo#964 (comment)). Pull Request resolved: #83993 Approved by: https://github.com/ezyang Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/b82c74da07430ba4a221403d383eeb27de04f7f7 Reviewed By: malfet Differential Revision: D39034436 Pulled By: bdhirsh fbshipit-source-id: a419018f4306e8dc2e7542d793c0520bf821fb1d
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/82601
Note: Links to docs will display an error until the docs builds have been completed. ❌ 7 Failures, 1 PendingAs of commit a75a5f2: The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
… test to use functionalize()" Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use `as_strided_()` to mutate input metadata when necessary, similar to how it uses `copy_()` to handle input data mutations. I also switched the functionalization tests over to using the proper `functionalize()` from functorch, which resulted in a few expect test changes. [ghstack-poisoned]
|
/easycla As part of the transition to the PyTorch Foundation, this project now requires contributions be covered under the new CLA. See #85559 for additional details. This comment will trigger a new check of this PR. If you are already covered, you will simply see a new "EasyCLA" check that passes. If you are not covered, a bot will leave a new comment with a link to sign. |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Although this won't fully solve the "input metadata mutations" issue for AOTAutograd, there's no reason functionalization should break on input metadata mutations - this PR updates functionalization to use
as_strided_()to mutate input metadata when necessary, similar to how it usescopy_()to handle input data mutations.I also switched the functionalization tests over to using the proper
functionalize()from functorch, which resulted in a few expect test changes.Stack from ghstack: