Skip to content

Conversation

@ezyang
Copy link
Contributor

@ezyang ezyang commented Nov 2, 2022

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:

  • 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]

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]
@pytorch-bot
Copy link

pytorch-bot bot commented 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 Failures

As of commit aedbe33:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@ezyang ezyang requested a review from ngimel November 2, 2022 20:40
@ezyang ezyang added topic: new features topic category release notes: torch.func release notes category for torch.vmap or torch.func.* APIs labels Nov 2, 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-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
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2023

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 Jan 3, 2023
@github-actions github-actions bot closed this Feb 2, 2023
@facebook-github-bot facebook-github-bot deleted the gh/ezyang/1495/head branch June 8, 2023 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor release notes: torch.func release notes category for torch.vmap or torch.func.* APIs Stale topic: new features topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant