Skip to content

[ET-VK][int4] Wrap int4 linear calls with view_copy nodes to squeeze/unsqueeze inputs #8226

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

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

nathanaelsee
Copy link
Contributor

@nathanaelsee nathanaelsee commented Feb 5, 2025

Stack from ghstack (oldest at bottom):

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.

Differential Revision: D69065866

…unsqueeze inputs

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Feb 5, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8226

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 30e966c with merge base 7805229 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@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 Feb 5, 2025
@facebook-github-bot
Copy link
Contributor

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

nathanaelsee pushed a commit that referenced this pull request Feb 5, 2025
…unsqueeze inputs

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)

ghstack-source-id: 264874724
Pull Request resolved: #8226
@nathanaelsee nathanaelsee added the release notes: vulkan Changes to the Vulkan backend delegate label Feb 5, 2025
…to squeeze/unsqueeze inputs"

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

nathanaelsee pushed a commit that referenced this pull request Feb 5, 2025
…unsqueeze inputs

Pull Request resolved: #8226

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.
ghstack-source-id: 264908152
@exported-using-ghexport

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)
…to squeeze/unsqueeze inputs"

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

nathanaelsee pushed a commit that referenced this pull request Feb 5, 2025
…unsqueeze inputs

Pull Request resolved: #8226

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.
ghstack-source-id: 264915710
@exported-using-ghexport

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)
…to squeeze/unsqueeze inputs"

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

nathanaelsee pushed a commit that referenced this pull request Feb 6, 2025
…unsqueeze inputs

Pull Request resolved: #8226

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.
ghstack-source-id: 264952606
@exported-using-ghexport

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)
@facebook-github-bot facebook-github-bot merged commit 2ba4ab2 into gh/nathanaelsee/3/base Feb 6, 2025
45 of 47 checks passed
@facebook-github-bot facebook-github-bot deleted the gh/nathanaelsee/3/head branch February 6, 2025 03:41
kirklandsign pushed a commit that referenced this pull request Feb 6, 2025
…unsqueeze inputs

Pull Request resolved: #8226

This is done automatically for full-precision linear/mm nodes in the graph at torch.export graph tracing time, but is not done for the int4 op.

The new pass adds view_copy nodes, as there are subsequent passes which can fuse view_copy nodes if redundant, and convert view_copy nodes to squeeze/unsqueeze nodes.
ghstack-source-id: 264952606
@exported-using-ghexport

Differential Revision: [D69065866](https://our.internmc.facebook.com/intern/diff/D69065866/)

---------

Co-authored-by: Nathanael See <[email protected]>
nathanaelsee pushed a commit that referenced this pull request Feb 6, 2025
See T214560872
#8226 added the pass to the partition preprocess pass list, so now it runs on all exports.
This uncovered a bug in the squeeze dims finding function in the mobilenet test case.

Differential Revision: [D69254910](https://our.internmc.facebook.com/intern/diff/D69254910/)

[ghstack-poisoned]
nathanaelsee pushed a commit that referenced this pull request Feb 6, 2025
See T214560872
#8226 added the pass to the partition preprocess pass list, so now it runs on all exports.
This uncovered a bug in the squeeze dims finding function in the mobilenet test case.

Differential Revision: [D69254910](https://our.internmc.facebook.com/intern/diff/D69254910/)

ghstack-source-id: 265078517
Pull Request resolved: #8281
nathanaelsee pushed a commit that referenced this pull request Feb 7, 2025
…queezeUnsqueezePass"

See T214560872
#8226 added the pass to the partition preprocess pass list, so now it runs on all exports.
This uncovered a bug in the squeeze dims finding function in the mobilenet test case.

Differential Revision: [D69254910](https://our.internmc.facebook.com/intern/diff/D69254910/)

[ghstack-poisoned]
nathanaelsee pushed a commit that referenced this pull request Feb 7, 2025
…ass"

See T214560872
#8226 added the pass to the partition preprocess pass list, so now it runs on all exports.
This uncovered a bug in the squeeze dims finding function in the mobilenet test case.

Differential Revision: [D69254910](https://our.internmc.facebook.com/intern/diff/D69254910/)

[ghstack-poisoned]
nathanaelsee pushed a commit that referenced this pull request Feb 7, 2025
Pull Request resolved: #8281

See T214560872
#8226 added the pass to the partition preprocess pass list, so now it runs on all exports.
This uncovered a bug in the squeeze dims finding function in the mobilenet test case.
ghstack-source-id: 265183421
@exported-using-ghexport

Differential Revision: [D69254910](https://our.internmc.facebook.com/intern/diff/D69254910/)
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 release notes: vulkan Changes to the Vulkan backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants