Skip to content

Conversation

lucylq
Copy link
Contributor

@lucylq lucylq commented Aug 22, 2025

Currently, the xnnpack + lora + program-data separation flow moves all delegated constants to the .ptd file. This change moves the undelegated constants as well, reducing the pte file size.

Run export_lora.sh from meta-pytorch/executorch-examples#54

-rw-r--r-- 1 lfq users 5994013600 Aug 22 13:32 foundation.ptd
-rw-r--r-- 1 lfq users   27628928 Aug 22 13:32 llama_3_2_1B_lora.pte
-rw-r--r-- 1 lfq users 5994013600 Aug 22 13:30 llama_3_2_1B.ptd
-rw-r--r-- 1 lfq users     317248 Aug 22 13:30 llama_3_2_1B.pte

fp32 Weights: ~6GB
Program: ~300KB
Lora adapter weights: ~27MB

Copy link

pytorch-bot bot commented Aug 22, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 168d750 with merge base 49bc664 (image):

NEW FAILURE - The following job has failed:

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

@meta-cla meta-cla 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 Aug 22, 2025
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

SpecPropPass(),
# ExecuTorch backend ops are unable to handle unbacked symints. So after
# this pass, passes cannot be Interpreter-based, because it will fail if
# there exists an unbacked symint operation.
EdgeToBackendOpsPass(),
RemoveGraphAssertsPass(),
*config.passes,
Copy link
Contributor Author

@lucylq lucylq Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

external_constants_pass has to run after SpecPropPass, which populates the tensor names. See if CI passes, not sure if this will break anything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do the more minimal change then and just move it after specProp rather then all of them then?

Copy link
Contributor Author

@lucylq lucylq Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JacobSzwejbka, updated. Do EdgeToBackendOpsPass/RemoveGraphAssertsPass have to be relatively late in the passes?

@facebook-github-bot
Copy link
Contributor

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D80840528.

@lucylq lucylq requested a review from mergennachin August 22, 2025 20:40
@lucylq lucylq force-pushed the lfq.lora-constants branch from 33c43bf to ffa0a57 Compare August 22, 2025 20:58
@facebook-github-bot
Copy link
Contributor

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D80840528.

@lucylq lucylq force-pushed the lfq.lora-constants branch from ffa0a57 to d69aa0f Compare August 22, 2025 21:16
@facebook-github-bot
Copy link
Contributor

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D80840528.

@lucylq lucylq force-pushed the lfq.lora-constants branch from d69aa0f to f0f0e9e Compare August 25, 2025 17:54
@lucylq lucylq force-pushed the lfq.lora-constants branch from f0f0e9e to 168d750 Compare August 25, 2025 17:54
@facebook-github-bot
Copy link
Contributor

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D80840528.

@facebook-github-bot facebook-github-bot merged commit 8b3d21c into main Aug 27, 2025
104 of 105 checks passed
@facebook-github-bot facebook-github-bot deleted the lfq.lora-constants branch August 27, 2025 00: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.

4 participants