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
12 changes: 11 additions & 1 deletion .ci/scripts/test-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -euxo pipefail

component="${1:?Usage: test-native.sh <runtime|ggml|vulkan> [cmake options]}"
component="${1:?Usage: test-native.sh <runtime|cpu|ggml|vulkan> [cmake options]}"
shift
build_dir="cmake-out/native-${component}"
build_jobs="${CMAKE_BUILD_PARALLEL_LEVEL:-$(nproc)}"
Expand All @@ -19,6 +19,16 @@ case "${component}" in
targets+=(native_runtime_test)
test_regex='^native_runtime_test$'
;;
cpu)
cmake_args+=(
-DEXECUTORCH_BUILD_NATIVE_CPU=ON
-DEXECUTORCH_BUILD_XNNPACK=ON
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON
-DEXECUTORCH_BUILD_NATIVE_VISION_RUNNER=ON
)
targets+=(native_cpu_engine_test run_classification_cpu)
test_regex='^native_cpu_engine_test$'
;;
ggml)
cmake_args+=(
-DEXECUTORCH_BUILD_NATIVE_GGML=ON
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
- install_requirements.sh
- requirements-dev.txt
- requirements-examples.txt
- backends/cpu/CMakeLists.txt
- backends/cpu/runtime/**
- backends/native/**
- backends/vulkan/CMakeLists.txt
- backends/vulkan/cmake/**
Expand All @@ -27,13 +29,20 @@ on:
- backends/vulkan/third-party/volk
- backends/vulkan_shared/CMakeLists.txt
- backends/vulkan_shared/runtime/**
- backends/xnnpack/CMakeLists.txt
- backends/xnnpack/cmake/**
- backends/xnnpack/third-party/FXdiv
- backends/xnnpack/third-party/XNNPACK
- backends/xnnpack/third-party/cpuinfo
- backends/xnnpack/third-party/pthreadpool
- examples/models/llama/tokenizer/**
- extension/llm/tokenizers
- extension/llm/export/**
- exir/**
- configurations/**
- extension/memory_allocator/**
- extension/threadpool/**
- kernels/**
- runtime/**
- third-party/**
- tools/cmake/**
Expand Down Expand Up @@ -67,7 +76,7 @@ jobs:
strategy:
fail-fast: false
matrix:
component: [runtime, ggml, vulkan]
component: [runtime, cpu, ggml, vulkan]
defaults:
run:
shell: bash
Expand Down
16 changes: 9 additions & 7 deletions backends/native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,18 @@ target_link_libraries(my_app PRIVATE native_api native_vulkan_engine)
```

With `EXECUTORCH_BUILD_TESTS=ON`, `native_runtime_test` covers the shared runtime
and API. `native_vulkan_passes_test` covers the Vulkan graph rewrites without
requiring a GPU. When either runner below is enabled,
`native_runner_utils_test` covers their shared runner utilities. Run these with
`ctest --test-dir cmake-out -R native_`.
and API. `native_cpu_engine_test` covers the CPU engine when
`EXECUTORCH_BUILD_NATIVE_CPU` is enabled. `native_vulkan_passes_test` covers the
Vulkan graph rewrites without requiring a GPU. When either runner below is
enabled, `native_runner_utils_test` covers their shared runner utilities. Run these
with `ctest --test-dir cmake-out -R native_`.

The `Test Native Engines` CI workflow has separate Linux jobs for the shared
runtime, GGML, and Vulkan, with each test suite run once. To reproduce with
runtime, CPU, GGML, and Vulkan, with each test suite run once. To reproduce with
dependencies installed, run `bash .ci/scripts/test-native.sh runtime`,
`bash .ci/scripts/test-native.sh ggml`, or
`bash .ci/scripts/test-native.sh vulkan` from the OSS checkout. The GGML job
`bash .ci/scripts/test-native.sh cpu`, `bash .ci/scripts/test-native.sh ggml`,
or `bash .ci/scripts/test-native.sh vulkan` from the OSS checkout. The CPU job
runs `native_cpu_engine_test` and builds `run_classification_cpu`. The GGML job
also runs `native_llm_runner_utils_test` and executes `run_hf_llm_ggml` on a tiny
seeded Hugging Face Llama with a generated byte tokenizer. Its eight generated
token IDs must match eager PyTorch, covering prefill and KV-cache decoding without
Expand Down
Loading