Skip to content

Add lift constant tensors passes after aten_to_edge #359

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

Closed
wants to merge 1 commit into from

Conversation

angelayi
Copy link
Contributor

Summary:
When exporting using enable_aot (through the torch.export path), we want to lift all constant tensors as buffers to the exported program. The ScalarToTensor pass in EXIR's aten_to_edge passes will create some constant tensors in the graph, so we will need to run a lift_constant_tensors pass afterwards.

Note that this only needs to be applied when exporting using the torch.export path because in the original path, nothing is lifted.

Differential Revision: D49207492

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 15, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49207492

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49207492

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49207492

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49207492

angelayi pushed a commit to angelayi/pytorch that referenced this pull request Sep 18, 2023
…09382)

Summary:

X-link: pytorch/executorch#359

When exporting using enable_aot (through the torch.export path), we want to lift all constant tensors as buffers to the exported program. The ScalarToTensor pass in EXIR's aten_to_edge passes will create some constant tensors in the graph, so we will need to run a lift_constant_tensors pass afterwards.

Note that this only needs to be applied when exporting using the torch.export path because in the original path, nothing is lifted.

Test Plan: CI

Reviewed By: cccclai

Differential Revision: D49207492
Summary:
X-link: pytorch/pytorch#109382


When exporting using enable_aot (through the torch.export path), we want to lift all constant tensors as buffers to the exported program. The ScalarToTensor pass in EXIR's aten_to_edge passes will create some constant tensors in the graph, so we will need to run a lift_constant_tensors pass afterwards.

Note that this only needs to be applied when exporting using the torch.export path because in the original path, nothing is lifted.

Reviewed By: cccclai

Differential Revision: D49207492
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49207492

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in e03bd6c.

pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Sep 19, 2023
Summary:
X-link: pytorch/executorch#359

When exporting using enable_aot (through the torch.export path), we want to lift all constant tensors as buffers to the exported program. The ScalarToTensor pass in EXIR's aten_to_edge passes will create some constant tensors in the graph, so we will need to run a lift_constant_tensors pass afterwards.

Note that this only needs to be applied when exporting using the torch.export path because in the original path, nothing is lifted.

Test Plan: CI

Differential Revision: D49207492

Pull Request resolved: #109382
Approved by: https://github.com/cccclai
Gasoonjia pushed a commit that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants