Skip to content

Conversation

@metascroy
Copy link
Contributor

Summary:
This exposes a static llama model for CoreML.

We want to unify development behind one static model so that we do not need to apply fixes in multiple places (e.g., iOS 26 fixes).

Differential Revision: D88875745

@metascroy metascroy requested a review from cccclai as a code owner December 10, 2025 19:45
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 10, 2025

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Unrelated Failure

As of commit 23330e8 with merge base ee236cb (image):

NEW FAILURES - The following jobs have failed:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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 Dec 10, 2025
@meta-codesync
Copy link

meta-codesync bot commented Dec 10, 2025

@metascroy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D88875745.

@github-actions
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.

metascroy added a commit to metascroy/executorch that referenced this pull request Dec 10, 2025
Summary:

This exposes a static llama model for CoreML.

We want to unify development behind one static model so that we do not need to apply fixes in multiple places (e.g., iOS 26 fixes).

Reviewed By: billmguo

Differential Revision: D88875745
metascroy added a commit to metascroy/executorch that referenced this pull request Dec 10, 2025
Summary:

This exposes a static llama model for CoreML.

We want to unify development behind one static model so that we do not need to apply fixes in multiple places (e.g., iOS 26 fixes).

Reviewed By: billmguo

Differential Revision: D88875745
metascroy added a commit to metascroy/executorch that referenced this pull request Dec 10, 2025
Summary:

This exposes a static llama model for CoreML.

We want to unify development behind one static model so that we do not need to apply fixes in multiple places (e.g., iOS 26 fixes).

Reviewed By: billmguo

Differential Revision: D88875745
Summary:

This exposes a static llama model for CoreML.

We want to unify development behind one static model so that we do not need to apply fixes in multiple places (e.g., iOS 26 fixes).

Reviewed By: billmguo

Differential Revision: D88875745
def forward(self, *args, **kwargs):
return tuple(
(
torch.ops.executorch_utils.graph_break.Tensor(a)
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh we should make a tutorial for this op. I think it could be broadly useful to backends.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could move it out of this file into executorch/exir?


# Setup CoreML partitioner
print("\nSetting up CoreML partitioner...")
compile_specs = CoreMLBackend.generate_compile_specs(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a recipe we could use? Could you add one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Core ML has a recipe. I think the default recipe will likely work here, but I'm so used to using the partitioner.

executorch_program = edge_manager.to_executorch(
ExecutorchBackendConfig(
extract_delegate_segments=True,
do_quant_fusion_and_const_prop=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Apple path leaves quant ops in the graph?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I guess this doesn't need to be specified.

memory_planning_pass=MemoryPlanningPass(
alloc_graph_input=False, alloc_graph_output=False
),
sym_shape_eval_pass=ConstraintBasedSymShapeEvalPass(),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the default now fwiw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ConstraintBasedSymShapeEvalPass is default now? Or the memory planning one?

remove_graph_break_(edge_manager)
executorch_program = edge_manager.to_executorch(
ExecutorchBackendConfig(
extract_delegate_segments=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

this one is also the default

@meta-codesync meta-codesync bot merged commit 71ebc50 into pytorch:main Dec 11, 2025
273 of 279 checks passed
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 meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants