Skip to content

Add LoRA multimethod export to CoreML static attention#18344

Closed
lucylq wants to merge 1 commit intogh/lucylq/142/headfrom
gh/lucylq/143/head
Closed

Add LoRA multimethod export to CoreML static attention#18344
lucylq wants to merge 1 commit intogh/lucylq/142/headfrom
gh/lucylq/143/head

Conversation

@lucylq
Copy link
Contributor

@lucylq lucylq commented Mar 19, 2026

Add support for exporting LoRA adapters as separate methods in a CoreML
PTE file. CoreML POSITIONAL weight sharing deduplicates base weights
across methods so the binary overhead is just the lora_a/lora_b weights.

  • StaticAttention: LoRA-aware projection creation for split_mha=False
  • utils.py: skip_names + LoRALinear guard in replace_linear_with_split_linear
  • export: --adapter CLI, adapter loading, _exclude_lora quantization filter,
    skip_split_names for POSITIONAL sharing, multimethod export branches

Authored with Claude.

[ghstack-poisoned]
@lucylq
Copy link
Contributor Author

lucylq commented Mar 19, 2026

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 19, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 121 Pending

As of commit b891fba with merge base eb92cec (image):

NEW FAILURE - The following job has failed:

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

lucylq added a commit that referenced this pull request Mar 19, 2026
Add support for exporting LoRA adapters as separate methods in a CoreML
PTE file. CoreML POSITIONAL weight sharing deduplicates base weights
across methods so the binary overhead is just the lora_a/lora_b weights.

- StaticAttention: LoRA-aware projection creation for split_mha=False
- utils.py: skip_names + LoRALinear guard in replace_linear_with_split_linear
- export: --adapter CLI, adapter loading, _exclude_lora quantization filter,
  skip_split_names for POSITIONAL sharing, multimethod export branches

Authored with Claude.


ghstack-source-id: 16ab852
ghstack-comment-id: 4093471437
Pull-Request: #18344
@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 Mar 19, 2026
@lucylq lucylq closed this Mar 19, 2026
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.

1 participant