Preserve reshapes in AOTAutograd#88361
Closed
ezyang wants to merge 8 commits intogh/ezyang/1495/basefrom
Closed
Conversation
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
This was referenced Nov 2, 2022
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/88361
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit aedbe33: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
ezyang
added a commit
that referenced
this pull request
Nov 3, 2022
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> ghstack-source-id: d94a05d Pull Request resolved: #88361
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
ezyang
added a commit
that referenced
this pull request
Nov 3, 2022
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> ghstack-source-id: 5e464fc Pull Request resolved: #88361
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
ezyang
added a commit
that referenced
this pull request
Nov 4, 2022
This commit adds a configuration knob to AOTAutograd to make it transform reshape calls into reshape_copy by default, making the reshape work even if the striding of tensors changes on subsequent runs. This is not sound if the input/output get modified after this change, so for safety, we use the new functionalization "freeze storage" feature to detect if this case happened. TODO: - Plumb this as a configuration option so backends can pick what they want - Figure out what the fallback strategy should be if the user actually did mutate the input/output of reshape. One possibility is to try tracing again but this time without preserving reshapes. - Teach backends how to compile _reshape_copy Signed-off-by: Edward Z. Yang <ezyangfb.com> ghstack-source-id: 9665ddd Pull Request resolved: #88361
Contributor
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack from ghstack (oldest at bottom):
This commit adds a configuration knob to AOTAutograd to make it
transform reshape calls into reshape_copy by default, making the
reshape work even if the striding of tensors changes on subsequent
runs. This is not sound if the input/output get modified after this
change, so for safety, we use the new functionalization "freeze storage"
feature to detect if this case happened.
TODO:
want
did mutate the input/output of reshape. One possibility is to try
tracing again but this time without preserving reshapes.
Signed-off-by: Edward Z. Yang ezyang@fb.com