pytorch / pytorch/executorch

Directions for testing llama on desktop with cmake --preset llm does not work

Open
#14,132 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🐛 Describe the bug

Following instructions here https://github.com/pytorch/executorch/blob/main/examples/models/llama/README.md#step-3-run-on-your-computer-to-validate as below:

cmake --preset llm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out
cmake --build cmake-out -j16 --target install --config Release

# Install llama runner
cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
  -DBUILD_TESTING=OFF \
  -DCMAKE_BUILD_TYPE=Release \
  -Bcmake-out/examples/models/llama \
  examples/models/llama
cmake --build cmake-out/examples/models/llama -j16 --config Release

gives the following error:

-- Could NOT find tokenizers (missing: tokenizers_DIR)
flatccrt library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
etdump library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
bundled_program library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
extension_data_loader library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
extension_flat_tensor library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
coreml_util library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
coreml_inmemoryfs library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
coremldelegate library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
mpsdelegate library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
neuron_backend library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
qnn_executorch_backend library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
custom_ops library is not found.
Traceback (most recent call last):
  File "/home/ec2-user/actions-runner/_work/executorch/executorch/test-infra/.github/scripts/run_with_env_secrets.py", line 102, in <module>
             If needed rebuild with the proper options in CMakeLists.txt
extension_module library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
extension_module_static library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
extension_tensor library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
extension_training library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
xnnpack_backend library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
vulkan_backend library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
optimized_kernels library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
optimized_portable_kernels library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
cpublas library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
eigen_blas library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
optimized_ops_lib library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
optimized_native_cpu_ops_lib library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
quantized_kernels library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
quantized_ops_lib library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
quantized_ops_aot_lib library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
torchao_ops_executorch library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
torchao_kernels_aarch64 library is not found.
             If needed rebuild with the proper options in CMakeLists.txt
CMake Error at runner/CMakeLists.txt:43 (message):
  ExecuTorch must be installed with EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER
  enabled.


-- Configuring incomplete, errors occurred!
    main()
  File "/home/ec2-user/actions-runner/_work/executorch/executorch/test-infra/.github/scripts/run_with_env_secrets.py", line 98, in main
    run_cmd_or_die(f"docker exec -t {container_name} /exec")
  File "/home/ec2-user/actions-runner/_work/executorch/executorch/test-infra/.github/scripts/run_with_env_secrets.py", line 39, in run_cmd_or_die
    raise RuntimeError(f"Command {cmd} failed with exit code {exit_code}")
RuntimeError: Command docker exec -t f9030e45234351e8ebab7800d46d733535e6ee9570407b761dd2d3902bf775b5 /exec failed with exit code 1
Error: Process completed with exit code 1.

It works if I don't use the preset and instead do:

cmake -DPYTHON_EXECUTABLE=python \
    -DCMAKE_INSTALL_PREFIX=cmake-out \
    -DEXECUTORCH_ENABLE_LOGGING=1 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
    -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
    -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
    -DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
    -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
    -DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
    -DEXECUTORCH_BUILD_KERNELS_LLM=ON \
    -Bcmake-out .
cmake --build cmake-out -j16 --config Release --target install


cmake -DPYTHON_EXECUTABLE=python \
    -DCMAKE_BUILD_TYPE=Release \
    -Bcmake-out/examples/models/llama \
    examples/models/llama
cmake --build cmake-out/examples/models/llama -j16 --config Release
Versions

CI job from https://github.com/pytorch/executorch/pull/14074

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Step 3 instructions in examples/models/llama/README.md and inspect runner/CMakeLists.txt:43, where the configuration fails. Compare the llm preset invocation with the working explicit CMake options shown in the report. Done means the documented preset builds and installs ExecuTorch with the LLM runner, then configures and builds the llama example successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, python
Domain
build-system, desktop-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.