Skip to content

Refactor CMake build for examples/models/llama#18825

Draft
GregoryComer wants to merge 1 commit intopytorch:mainfrom
GregoryComer:cmake-refactor-llama
Draft

Refactor CMake build for examples/models/llama#18825
GregoryComer wants to merge 1 commit intopytorch:mainfrom
GregoryComer:cmake-refactor-llama

Conversation

@GregoryComer
Copy link
Copy Markdown
Member

@GregoryComer GregoryComer commented Apr 10, 2026

Summary

Update the CMake build for examples/models/llama to be in-tree in the top-level build but excluded from all. This means that it can be built in a single step, but will only be built when explicitly requested with --target llama_main.

This simplifies the build quite a bit (as evidenced by how many lines we remove in this PR) and prevents issues with iterative rebuild or mismatched build options between llama_main and the core runtime.

Note that the top-level make llama-cpu command is unmodified, just simplified under the hood. For direct CMake builds, here's a before and after:

Before:

cmake --preset llm -DCMAKE_INSTALL_PREFIX=cmake-out
cmake --build cmake-out --target install
cd examples/models/llama
cmake -B ../../../cmake-out/examples/models/llama -DCMAKE_FIND_ROOT_PATH=../../../cmake-out
cmake --build ../../../cmake-out/examples/models/llama --target llama_main

After:

cmake -B cmake-out --preset llm
cmake --build cmake-out --target llama_main

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 10, 2026

🔗 Helpful Links

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

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:

❌ 16 New Failures, 2 Cancelled Jobs, 2 Pending, 3 Unrelated Failures

As of commit 965a4a9 with merge base 74403e2 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Apr 10, 2026
@GregoryComer GregoryComer added ciflow/trunk and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown

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.

@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 Apr 10, 2026
@GregoryComer GregoryComer force-pushed the cmake-refactor-llama branch 5 times, most recently from 9fe348c to 3f9c81d Compare April 10, 2026 23:28
@GregoryComer GregoryComer force-pushed the cmake-refactor-llama branch from 3f9c81d to 965a4a9 Compare April 11, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk 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