Skip to content

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

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 3 commits into from
Feb 6, 2025

Conversation

pytorchbot
Copy link
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #8226
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/nathanaelsee/3/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/nathanaelsee/3/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/nathanaelsee/2/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/nathanaelsee/3/orig
@diff-train-skip-merge

Nathanael See added 3 commits February 5, 2025 16:56
…linear modules with biases

Pull Request resolved: #8224

While LLaMa does not have biases, there are some models which will have biases in their linear modules.

Add support in the source transform quantizer for biases.
ghstack-source-id: 264952608
@exported-using-ghexport

Differential Revision: [D69072087](https://our.internmc.facebook.com/intern/diff/D69072087/)
Pull Request resolved: #8225

If the partitioner is using channels-packed setting for activations, then the checks will throw.

Remove the checks and conditionally re-pack the input/output tensors if they are not width-packed.
ghstack-source-id: 264952605
@exported-using-ghexport

Differential Revision: [D68813946](https://our.internmc.facebook.com/intern/diff/D68813946/)
…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/)
Copy link

pytorch-bot bot commented Feb 6, 2025

🔗 Helpful Links

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

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 13da2d5 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 6, 2025
Base automatically changed from gh/nathanaelsee/2/orig to main February 6, 2025 18:16
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants