Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .ci/scripts/test_llama_lora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
cmake_install_executorch_libraries() {
echo "Installing libexecutorch.a, libextension_module.so, libportable_ops_lib.a"
rm -rf cmake-out
retry cmake --preset llm \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake-out -j9 --target install --config Release
cmake --workflow llm-release
}

cmake_build_llama_runner() {
Expand Down
9 changes: 3 additions & 6 deletions .ci/scripts/test_model_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,17 @@ echo "::endgroup::"
echo "::group::Build $MODEL_NAME Runner"

if [ "$DEVICE" = "cuda" ]; then
WORKFLOW="llm-release-cuda"
BUILD_BACKEND="EXECUTORCH_BUILD_CUDA"
elif [ "$DEVICE" = "metal" ]; then
WORKFLOW="llm-release-metal"
BUILD_BACKEND="EXECUTORCH_BUILD_METAL"
else
echo "Error: Unsupported device '$DEVICE'. Must be 'cuda' or 'metal'."
exit 1
fi

cmake --preset llm \
-D${BUILD_BACKEND}=ON \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-Bcmake-out -S.
cmake --build cmake-out -j$(nproc) --target install --config Release
cmake --workflow $WORKFLOW

cmake -D${BUILD_BACKEND}=ON \
-DCMAKE_BUILD_TYPE=Release \
Expand Down
12 changes: 10 additions & 2 deletions .ci/scripts/test_phi_3_mini.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ if hash nproc &> /dev/null; then NPROC=$(nproc); fi

cmake_install_executorch_libraries() {
rm -rf cmake-out
cmake --preset llm -DCMAKE_INSTALL_PREFIX=cmake-out -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
cmake --build cmake-out -j16 --target install --config ${BUILD_TYPE}

# Select workflow preset based on BUILD_TYPE
if [[ "${BUILD_TYPE}" == "Debug" ]]; then
WORKFLOW_PRESET="llm-debug"
else
WORKFLOW_PRESET="llm-release"
fi

echo "Using workflow preset: ${WORKFLOW_PRESET}"
cmake --workflow --preset ${WORKFLOW_PRESET}
}

cmake_build_phi_3_mini() {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
set -eux
# The generic Linux job chooses to use base env, not the one setup by the image
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"
Expand Down
296 changes: 259 additions & 37 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,38 +119,118 @@
}
},
{
"name": "llm",
"displayName": "Build LLM libraries",
"inherits": ["common"],
"cacheVariables": {
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/llm.cmake",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
},
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": ["Darwin", "Linux", "Windows"]
}
"name": "llm",
"displayName": "Build LLM libraries",
"inherits": [
"common"
],
"cacheVariables": {
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/llm.cmake",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
},
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": ["Darwin", "Linux", "Windows"]
}
},
{
"name": "profiling",
"displayName": "Build ExecuTorch with Profiling Enabled",
"inherits": [
"common"
],
"cacheVariables": {
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/profiling.cmake",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
},
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
"name": "llm-release",
"displayName": "LLM release build",
"inherits": [
"llm"
],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/cmake-out"
}
},
{
"name": "llm-release-cuda",
"displayName": "LLM release build with CUDA",
"inherits": [
"llm-release"
],
"cacheVariables": {
"EXECUTORCH_BUILD_CUDA": "ON"
},
"condition": {
"lhs": "${hostSystemName}",
"type": "equals",
"rhs": "Linux"
}
},
{
"name": "llm-release-metal",
"displayName": "LLM release build with Metal",
"inherits": [
"llm-release"
],
"cacheVariables": {
"EXECUTORCH_BUILD_METAL": "ON"
},
"condition": {
"lhs": "${hostSystemName}",
"type": "equals",
"rhs": "Darwin"
}
},
{
"name": "llm-debug",
"displayName": "LLM debug build",
"inherits": [
"llm"
],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/cmake-out"
}
},
{
"name": "llm-debug-cuda",
"displayName": "LLM debug build with CUDA",
"inherits": [
"llm-debug"
],
"cacheVariables": {
"EXECUTORCH_BUILD_CUDA": "ON"
},
"condition": {
"lhs": "${hostSystemName}",
"type": "equals",
"rhs": "Linux"
}
},
{
"name": "llm-debug-metal",
"displayName": "LLM debug build with Metal",
"inherits": [
"llm-debug"
],
"cacheVariables": {
"EXECUTORCH_BUILD_METAL": "ON"
},
"condition": {
"lhs": "${hostSystemName}",
"type": "equals",
"rhs": "Darwin"
}
},
{
"name": "profiling",
"displayName": "Build ExecuTorch with Profiling Enabled",
"inherits": [
"common"
],
"cacheVariables": {
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/profiling.cmake",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
},
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": ["Darwin", "Linux", "Windows"]
}
},
{
"name": "windows",
Expand All @@ -177,13 +257,155 @@
}
},
{
"name": "arm-baremetal",
"displayName": "Build ExecuTorch for Arm baremetal",
"inherits": ["common"],
"cacheVariables": {
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/arm_baremetal.cmake",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake"
}
"name": "arm-baremetal",
"displayName": "Build ExecuTorch for Arm baremetal",
"inherits": ["common"],
"cacheVariables": {
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/arm_baremetal.cmake",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake"
}
}
],
"buildPresets": [
{
"name": "llm-release-install",
"displayName": "Build and install LLM extension release artifacts",
"configurePreset": "llm-release",
"targets": [
"install"
],
"jobs": 0
},
{
"name": "llm-release-cuda-install",
"displayName": "Build and install LLM extension release artifacts (CUDA)",
"configurePreset": "llm-release-cuda",
"targets": [
"install"
],
"jobs": 0
},
{
"name": "llm-release-metal-install",
"displayName": "Build and install LLM extension release artifacts (Metal)",
"configurePreset": "llm-release-metal",
"targets": [
"install"
],
"jobs": 0
},
{
"name": "llm-debug-install",
"displayName": "Build and install LLM extension debug artifacts",
"configurePreset": "llm-debug",
"targets": [
"install"
],
"jobs": 0
},
{
"name": "llm-debug-cuda-install",
"displayName": "Build and install LLM extension debug artifacts (CUDA)",
"configurePreset": "llm-debug-cuda",
"targets": [
"install"
],
"jobs": 0
},
{
"name": "llm-debug-metal-install",
"displayName": "Build and install LLM extension debug artifacts (Metal)",
"configurePreset": "llm-debug-metal",
"targets": [
"install"
],
"jobs": 0
}
],
"workflowPresets": [
{
"name": "llm-release",
"displayName": "Configure, build and install ExecuTorch LLM extension with default CPU backend",
"steps": [
{
"type": "configure",
"name": "llm-release"
},
{
"type": "build",
"name": "llm-release-install"
}
]
},
{
"name": "llm-release-cuda",
"displayName": "Configure, build and install ExecuTorch LLM extension with CUDA enabled",
"steps": [
{
"type": "configure",
"name": "llm-release-cuda"
},
{
"type": "build",
"name": "llm-release-cuda-install"
}
]
},
{
"name": "llm-release-metal",
"displayName": "Configure, build and install ExecuTorch LLM extension with Metal enabled",
"steps": [
{
"type": "configure",
"name": "llm-release-metal"
},
{
"type": "build",
"name": "llm-release-metal-install"
}
]
},
{
"name": "llm-debug",
"displayName": "Configure, build and install ExecuTorch LLM extension with default CPU backend (Debug)",
"steps": [
{
"type": "configure",
"name": "llm-debug"
},
{
"type": "build",
"name": "llm-debug-install"
}
]
},
{
"name": "llm-debug-cuda",
"displayName": "Configure, build and install ExecuTorch LLM extension with CUDA enabled (Debug)",
"steps": [
{
"type": "configure",
"name": "llm-debug-cuda"
},
{
"type": "build",
"name": "llm-debug-cuda-install"
}
]
},
{
"name": "llm-debug-metal",
"displayName": "Configure, build and install ExecuTorch LLM extension with Metal enabled (Debug)",
"steps": [
{
"type": "configure",
"name": "llm-debug-metal"
},
{
"type": "build",
"name": "llm-debug-metal-install"
}
]
}
]
}
7 changes: 1 addition & 6 deletions examples/models/gemma3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@ Ensure you have a CUDA-capable GPU and CUDA toolkit installed on your system.
./install_executorch.sh

# Build the multimodal runner with CUDA
cmake --preset llm \
-DEXECUTORCH_BUILD_CUDA=ON \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-Bcmake-out -S.
cmake --build cmake-out -j$(nproc) --target install --config Release
cmake --workflow llm-release-cuda

# Build the Gemma3 runner
cmake -DEXECUTORCH_BUILD_CUDA=ON \
Expand Down
Loading
Loading