Skip to content

Update examples/models/llama/README.md to fix build broken #12393

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

DamonFool
Copy link
Contributor

Fix the following error

CMake Error at tools/cmake/common/preset.cmake:122 (message):
  Use of 'EXECUTORCH_BUILD_EXTENSION_MODULE' requires
  'EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR'
Call Stack (most recent call first):
  tools/cmake/preset/default.cmake:300 (check_required_options_on)
  CMakeLists.txt:87 (include)

Copy link

pytorch-bot bot commented Jul 11, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 4 Unrelated Failures

As of commit efbf137 with merge base a0618c8 (image):

NEW FAILURE - The following job has failed:

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.

@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 Jul 11, 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.

@lucylq
Copy link
Contributor

lucylq commented Jul 11, 2025

Hi @DamonFool, thanks for submitting this PR. I don't think llama build should require flat_tensor - is the repro command exactly from the readme/could you provide instructions for your repro?

@DamonFool
Copy link
Contributor Author

Hi @DamonFool, thanks for submitting this PR. I don't think llama build should require flat_tensor - is the repro command exactly from the readme/could you provide instructions for your repro?

Thanks @lucylq for taking a look at this.
Yes, I just followed the steps in the readme and copied commands in it.

The logic is that llama requires EXECUTORCH_BUILD_EXTENSION_MODULE, which requires EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR.

The cmake error msg has showed that dependency clearly.
You can verify it by testing the commands it the readme.
Thanks.

@DamonFool
Copy link
Contributor Author

I don't think llama build should require flat_tensor

Hi @lucylq , After #11457 , flat_tensor is required.
Please also see https://github.com/pytorch/executorch/blob/main/tools/cmake/preset/default.cmake#L305 .
Thanks.

@lucylq
Copy link
Contributor

lucylq commented Jul 15, 2025

I don't think llama build should require flat_tensor

Hi @lucylq , After #11457 , flat_tensor is required. Please also see https://github.com/pytorch/executorch/blob/main/tools/cmake/preset/default.cmake#L305 . Thanks.

Hi @DamonFool , thank you for the PR link! I added #12514 to remove FLAT_TENSOR when it's not needed. I think that was added in to ensure all the builds work when we were adding cmake presets; it should be removed now that things are more stable.

Copy link
Contributor

@lucylq lucylq left a comment

Choose a reason for hiding this comment

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

Thanks for making this PR @DamonFool.

I was mistaken, and flat_tensor is required as a dependency of extension_module.

@DamonFool
Copy link
Contributor Author

Thanks @lucylq .
The 5 cicd failures should not be related to this patch since this is only a doc change, right?

@DamonFool
Copy link
Contributor Author

Hi @lucylq , are you fine to merge this pr?
Thanks.

@lucylq lucylq merged commit 4456407 into pytorch:main Jul 17, 2025
167 of 178 checks passed
lucylq pushed a commit that referenced this pull request Jul 17, 2025
Fix the following error
```
CMake Error at tools/cmake/common/preset.cmake:122 (message):
  Use of 'EXECUTORCH_BUILD_EXTENSION_MODULE' requires
  'EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR'
Call Stack (most recent call first):
  tools/cmake/preset/default.cmake:300 (check_required_options_on)
  CMakeLists.txt:87 (include)
```

Signed-off-by: Jie Fu <[email protected]>
@DamonFool
Copy link
Contributor Author

Thanks @lucylq .

@DamonFool DamonFool deleted the fix-llama-build-broken branch July 17, 2025 23:29
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.

3 participants