-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Preserve reshapes in AOTAutograd #88361
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
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 <[email protected]> [ghstack-poisoned]
🔗 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]
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]
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]
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
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
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 [email protected]