Skip to content
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

[ExecuTorch][Weight Sharing][XNNPACK] Serialize constant tensors into named data map #9295

Merged
merged 1 commit into from
Mar 15, 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: #9153 by @mcr229
^ 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/mcr229/9/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/mcr229/9/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/mcr229/8/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/mcr229/9/orig
@diff-train-skip-merge

… named data map

Pull Request resolved: #9153

We serialize tensors into the named data map, and return the output in preprocess result. Allowing for XNNPACK to share tensors with the same name (instead of duplicating).

A key change here is with fused tensors. For BN and Convolution Fusion, we fuse the conv weights and bias with the BN parameters creating new tensors. We then create get_attr nodes for these new parameters. Due to the graph.fx interpreter in export pass base, the new names we create for these new tensors are lost each time. As a result, at the end we introduce a new pass to preserve the names we created. This seems a little hacky for now, but is the only way to preserve the new fused names.

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D70315207/)!
ghstack-source-id: 271732046
Copy link

pytorch-bot bot commented Mar 14, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit c646522 with merge base 630d0cc (image):

NEW FAILURE - The following job has failed:

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 Mar 14, 2025
@SS-JIA SS-JIA merged commit 5f05cf7 into gh/mcr229/8/orig Mar 15, 2025
74 of 75 checks passed
@SS-JIA SS-JIA deleted the gh/mcr229/9/orig branch March 15, 2025 01:16
@SS-JIA SS-JIA restored the gh/mcr229/9/orig branch March 15, 2025 02:36
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.

4 participants