Skip to content

Commit 89ad6e8

Browse files
Merge branch 'main' into delete-exir-capture
2 parents 805d18c + f2575be commit 89ad6e8

126 files changed

Lines changed: 12942 additions & 543 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/_llm_server.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ jobs:
4444
4545
python -m pytest -q \
4646
examples/llm_server/python/tests \
47-
examples/models/muse-glimmer/tests/test_serve.py
47+
examples/models/muse-glimmer/tests/test_serve.py \
48+
examples/models/muse-glimmer/tests/test_serve_batching.py \
49+
examples/models/muse-glimmer/tests/test_stream_parser.py
4850
4951
cmake -S . -B cmake-out \
5052
-DCMAKE_BUILD_TYPE=Release \

‎.github/workflows/_test_arduino_library.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
cd examples/arduino
4848
./build_arduino_library.sh
4949
50+
test "$(sed -n 's/^version=//p' arduino_lib/ExecuTorch/library.properties)" \
51+
= "$(cat ../../version.txt)"
52+
5053
# A model exported against a different ExecuTorch commit than the one
5154
# that built the library loads fine, resolves every operator, and then
5255
# fails inside Method::execute. Catch that here rather than on a board.

‎.github/workflows/cuda.yml‎

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,15 @@ jobs:
535535
# Build executor_runner (needed by CUDA backend e2e tests)
536536
cmake --build cmake-out --target executor_runner
537537
538-
# Run CUDA backend Python tests
539-
python -m pytest backends/cuda/tests backends/cuda/passes/tests -v -o "addopts="
538+
# Run CUDA backend Python tests. The quantized GEMM kernel suites run
539+
# in unittest-cuda-quantized-gemm; together they do not fit this
540+
# job's timeout.
541+
python -m pytest backends/cuda/tests backends/cuda/passes/tests -v -o "addopts=" \
542+
--ignore=backends/cuda/tests/test_int4_quantized_gemm.py \
543+
--ignore=backends/cuda/tests/test_int5_quantized_gemm.py \
544+
--ignore=backends/cuda/tests/test_int6_quantized_gemm.py \
545+
--ignore=backends/cuda/tests/test_int8_quantized_gemm.py \
546+
--ignore=backends/cuda/tests/test_cuda_graph_timing.py
540547
541548
# Run Qwen 3.5 MoE tests (quantize roundtrip + TurboQuant KV cache + sampler)
542549
python -m pytest examples/models/qwen3_5_moe/test_quantize_roundtrip.py examples/models/qwen3_5_moe/test_turboquant.py examples/models/qwen3_5_moe/test_sampler.py -v -o "addopts="
@@ -545,6 +552,45 @@ jobs:
545552
pip install gguf
546553
python -m pytest examples/models/gemma4_31b/tests/ --ignore=examples/models/gemma4_31b/tests/test_mlx_pipeline.py -v -o "addopts="
547554
555+
unittest-cuda-quantized-gemm:
556+
name: unittest-cuda-quantized-gemm (${{ matrix.shard }})
557+
needs: [changed-files, run-decision]
558+
if: |
559+
contains(needs.changed-files.outputs.changed-files, 'backends/cuda') ||
560+
contains(needs.changed-files.outputs.changed-files, 'backends/aoti') ||
561+
contains(needs.changed-files.outputs.changed-files, '.github/workflows/cuda.yml') ||
562+
needs.run-decision.outputs.is-full-run == 'true'
563+
strategy:
564+
fail-fast: false
565+
matrix:
566+
include:
567+
- shard: int4
568+
tests: backends/cuda/tests/test_int4_quantized_gemm.py
569+
- shard: int5-int6-int8-graph-timing
570+
tests: >-
571+
backends/cuda/tests/test_int5_quantized_gemm.py
572+
backends/cuda/tests/test_int6_quantized_gemm.py
573+
backends/cuda/tests/test_int8_quantized_gemm.py
574+
backends/cuda/tests/test_cuda_graph_timing.py
575+
uses: pytorch/test-infra/.github/workflows/linux_job_v3.yml@main
576+
permissions:
577+
id-token: write
578+
contents: read
579+
with:
580+
timeout: 90
581+
runner: mt-l-x86aavx2-11-41-a10g
582+
gpu-arch-type: cuda
583+
gpu-arch-version: "13.0"
584+
submodules: recursive
585+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
586+
script: |
587+
set -eux
588+
bash ./install_executorch.sh
589+
conda install -y -c conda-forge 'libstdcxx-ng>=12'
590+
export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
591+
592+
python -m pytest ${{ matrix.tests }} -v -o "addopts=" --durations=20
593+
548594
unittest-cuda-runtime:
549595
name: unittest-cuda-runtime
550596
needs: [changed-files, run-decision]

‎.github/workflows/mlx.yml‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ on:
1010
pull_request:
1111
paths:
1212
- .github/workflows/mlx.yml
13+
- Makefile
1314
- backends/mlx/**
1415
- extension/llm/batching/**
1516
- extension/llm/cache/**
1617
- extension/llm/export/**
18+
- extension/llm/runner/**
19+
- extension/llm/sampler/**
20+
- extension/llm/serving/**
1721
- extension/audio/**
22+
- examples/llm_server/cpp/**
1823
- examples/models/gemma4_31b/**
1924
- examples/models/muse-glimmer/**
2025
- examples/models/nemotron3_diarization/**
@@ -128,6 +133,8 @@ jobs:
128133
backends/mlx/test/test_sample.py \
129134
examples/models/gemma4_31b/tests/test_mlx_pipeline.py \
130135
examples/models/muse-glimmer/tests/test_mlx_pipeline.py \
136+
examples/models/muse-glimmer/tests/test_mlx_offgraph.py \
137+
examples/models/muse-glimmer/tests/test_checkpoint_context.py \
131138
-v
132139
echo "::endgroup::"
133140
@@ -309,9 +316,8 @@ jobs:
309316
echo "Success: built $RUNNER"
310317
echo "::endgroup::"
311318
312-
# Build-only: the Muse Glimmer GGUF checkpoints are far too large to export in
313-
# CI, so this covers the compile / link / metallib wiring of the runners --
314-
# which is what MLX backend changes are most likely to break.
319+
# No full-model export: Muse Glimmer GGUF checkpoints are too large for CI.
320+
# Cover runner compile/link/metallib wiring and asset-independent preparation.
315321
test-mlx-muse-glimmer-build:
316322
needs: run-decision
317323
if: |
@@ -355,6 +361,19 @@ jobs:
355361
echo "Success: built solo_runner, dflash_runner and muse_glimmer_worker"
356362
echo "::endgroup::"
357363
364+
echo "::group::Build and test Muse Glimmer batching with MLX"
365+
${CONDA_RUN} make muse-glimmer-batching-mlx
366+
BATCHING_BIN_DIR="${PWD}/cmake-out/examples/models/muse-glimmer-batching"
367+
${CONDA_RUN} cmake -S "${PWD}/examples/models/muse-glimmer" -B "${BATCHING_BIN_DIR}" \
368+
-DMUSE_GLIMMER_BUILD_BATCHING_TESTS=ON
369+
${CONDA_RUN} cmake --build "${BATCHING_BIN_DIR}" --target muse_glimmer_batching_test --parallel
370+
${CONDA_RUN} ctest --test-dir "${BATCHING_BIN_DIR}" \
371+
-R '^muse_glimmer_batching$' --output-on-failure --no-tests=error
372+
test -x "${BATCHING_BIN_DIR}/muse_glimmer_batching_runner"
373+
test -x "${BATCHING_BIN_DIR}/muse_glimmer_batching_worker"
374+
test -f "${BATCHING_BIN_DIR}/mlx.metallib"
375+
echo "::endgroup::"
376+
358377
test-mlx-nemotron3-diarization-build:
359378
needs: run-decision
360379
if: |

‎.github/workflows/pull.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ jobs:
7474
contains(needs.changed-files.outputs.changed-files, 'examples/arduino/') ||
7575
contains(needs.changed-files.outputs.changed-files, 'kernels/portable/') ||
7676
contains(needs.changed-files.outputs.changed-files, 'runtime/') ||
77-
contains(needs.changed-files.outputs.changed-files, 'schema/')
77+
contains(needs.changed-files.outputs.changed-files, 'schema/') ||
78+
contains(needs.changed-files.outputs.changed-files, 'version.txt')
7879
name: test-arduino-library
7980
uses: ./.github/workflows/_test_arduino_library.yml
8081
permissions:

‎.github/workflows/rocm.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ jobs:
175175
id-token: write
176176
contents: read
177177
with:
178-
timeout: 90
178+
# Since #23603 the quantized GEMM kernels compile and run here instead of
179+
# failing fast; the job takes ~80 min, ~37 of them Int4AutotunePickTest's
180+
# CPU-saturated AOTI compile.
181+
timeout: 150
179182
no-sudo: true
180183
runner: linux.rocm.gpu.gfx950.1
181184
gpu-arch-type: rocm

‎.github/workflows/vulkan.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_clone
111111
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_binary
112112
113-
PYTHON_EXECUTABLE=python bash backends/vulkan/test/scripts/test_op.sh --build
113+
PYTHON_EXECUTABLE=python bash backends/vulkan/test/scripts/test_op.sh --build vulkan_sdpa_av_test
114114
115115
# Run e2e testing for selected operators.
116116
python -m unittest backends/vulkan/test/test_vulkan_delegate.py -k "*pt2e*"

‎Makefile‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ help:
139139
@echo " gemma4_31b-mlx - Build Gemma 4 31B runner and worker with MLX backend"
140140
@echo " muse-glimmer-cuda - Build Muse Glimmer runners and worker with CUDA backend"
141141
@echo " muse-glimmer-mlx - Build Muse Glimmer runners and worker with MLX backend"
142+
@echo " muse-glimmer-batching-mlx - Build batching Muse Glimmer runner and worker with MLX"
142143
@echo " qwen3_5_moe-cuda - Build Qwen3.5 MoE runner with CUDA backend"
143144
@echo " qwen3_5_moe-metal - Build Qwen3.5 MoE runner with Metal backend"
144145
@echo " qwen3_5_moe-mlx - Build Qwen3.5 MoE runner with MLX backend"
@@ -513,6 +514,24 @@ muse-glimmer-mlx:
513514
@echo " DFlash runner: cmake-out/examples/models/muse-glimmer/dflash_runner"
514515
@echo " Worker: cmake-out/examples/models/muse-glimmer/muse_glimmer_worker"
515516

517+
.PHONY: muse-glimmer-batching-mlx
518+
muse-glimmer-batching-mlx:
519+
@echo "==> Building and installing ExecuTorch with MLX..."
520+
cmake --workflow --preset mlx-release
521+
@echo "==> Configuring batching Muse Glimmer runners with MLX..."
522+
cd examples/models/muse-glimmer && cmake --preset muse-glimmer-mlx \
523+
-B "$(CURDIR)/cmake-out/examples/models/muse-glimmer-batching" \
524+
-DEXECUTORCH_BUILD_CUDA=OFF \
525+
-DMUSE_GLIMMER_BUILD_BATCHING=ON \
526+
-DMUSE_GLIMMER_BUILD_BATCHING_TESTS=OFF
527+
cmake --build "$(CURDIR)/cmake-out/examples/models/muse-glimmer-batching" \
528+
--target muse_glimmer_batching_runner muse_glimmer_batching_worker \
529+
--parallel "$$(sysctl -n hw.ncpu)"
530+
@echo ""
531+
@echo "Build complete!"
532+
@echo " Runner: $(CURDIR)/cmake-out/examples/models/muse-glimmer-batching/muse_glimmer_batching_runner"
533+
@echo " Worker: $(CURDIR)/cmake-out/examples/models/muse-glimmer-batching/muse_glimmer_batching_worker"
534+
516535
gemma4_31b-cuda:
517536
@echo "==> Building and installing ExecuTorch with CUDA..."
518537
cmake --workflow --preset llm-release-cuda

‎backends/arm/BUCK‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ fbcode_target(
108108
"vgf/check_env.py",
109109
"vgf/compile_spec.py",
110110
"vgf/model_converter.py",
111+
"vgf/quantization_quality.py",
112+
"vgf/quantization_assessment.py",
113+
"vgf/quantization_visualization.py",
111114
"vgf/partitioner.py",
112115
"vgf/shaders/__init__.py",
113116
"vgf/shaders/grid_sampler.py",
@@ -132,6 +135,9 @@ fbcode_target(
132135
"//executorch/backends/arm/tosa/dialect:lib",
133136
"//executorch/backends/arm/tosa:specification",
134137
"//executorch/backends/arm/tosa:partitioner",
138+
"//executorch/devtools/inspector/numerical_comparator:mse_numerical_comparator",
139+
"//executorch/devtools/inspector/numerical_comparator:snr_numerical_comparator",
140+
"//executorch/devtools/visualization:visualization",
135141
"//executorch/exir:lib",
136142
],
137143
)

‎backends/arm/cmsis_pack/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ cmake \
6464
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
6565
-DEXECUTORCH_BUILD_FLATC=ON \
6666
-Bcmake-out-arm .
67-
cmake --build cmake-out-arm --config Release -j$(nproc)
67+
cmake --build cmake-out-arm --config Release
6868

6969
# 2. Build the pack. --output-dir is where the .pack archive lands
7070
# (created if absent); each invocation rewrites this directory.
@@ -75,6 +75,8 @@ backends/arm/cmsis_pack/scripts/build_pack.sh \
7575
--output-dir pack-output
7676
```
7777

78+
Adding `-j<N>` to `cmake --build` runs `<N>` jobs in parallel and tends to speed up the build significantly.
79+
7880
The resulting `.pack` file is a zip archive installable via `cpackget add <file>.pack`.
7981

8082
## Local testing

0 commit comments

Comments
 (0)