[PR #2769] [CLOSED] [Engine] add experimental Muse Spark CPU/CUDA reference runtime #4256

Closed
opened 2026-11-07 15:34:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2769
Author: @BColsey
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: feature/muse-spark-reference-2762


📝 Commits (10+)

  • 7feaa59 feat: add opt-in Muse Spark GGUF streaming reference runtime
  • cb0119f build: reserve opt-in Muse reference runtime boundary
  • 9688c64 test: add independent Muse Spark numerical oracle
  • 34bb730 Merge reviewed Muse native runtime
  • 4362806 Merge reviewed independent Muse oracle
  • 3955c25 docs: describe experimental Muse reference runtime and limits
  • 91bfd2e [Docs] refresh Muse build prerequisites for current main
  • bb9ef5b [Engine] isolate Muse adapter backend and Windows build policy
  • 405b506 [Engine] exercise Muse CUDA execution through opt-in tests
  • 6b92a49 [Docs] describe explicit Muse CUDA regression checks

📊 Changes

18 files changed (+2329 additions, -0 deletions)

View changed files

📝 CMakeLists.txt (+10 -0)
📝 README.md (+3 -0)
📝 docs/MODELS.md (+3 -0)
➕ docs/MUSE_SPARK.md (+144 -0)
➕ include/strata/muse/model.hpp (+55 -0)
➕ src/muse/CMakeLists.txt (+23 -0)
➕ src/muse/cuda_matvec.cpp (+54 -0)
➕ src/muse/cuda_matvec.hpp (+17 -0)
➕ src/muse/main.cpp (+20 -0)
➕ src/muse/model.cpp (+573 -0)
➕ src/muse/model_test.cpp (+473 -0)
➕ src/muse/test_allocations.cpp (+27 -0)
➕ tools/muse/__init__.py (+1 -0)
➕ tools/muse/compare.py (+77 -0)
➕ tools/muse/fixture.py (+152 -0)
➕ tools/muse/reference.py (+185 -0)
➕ tools/muse/test_build.py (+157 -0)
➕ tools/muse/test_oracle.py (+355 -0)

📄 Description

Problem and result

Strata has no Muse Spark text execution path. This PR adds a separate, opt-in strata-muse reference CLI for existing muse-spark GGUF shards. It accepts token IDs and evaluates the text graph with file-backed weights and bounded decoded row tiles, on CPU or through an optional NVIDIA CUDA/cuBLAS adapter.

This is an experimental numerical reference runtime. It does not claim full 816B checkpoint inference, model quality, usable speed, or installer/chat/API integration.

Refs #2762; this does not close that broader feature request. Broader integration still needs agreed scope. Independent baseline fixture failures found during validation are fixed separately in #3778 (setup, referencing #1935) and #3782 (Terminal portability).

Approach

STRATA_ENABLE_MUSE defaults to OFF. The runtime uses the existing GGUF reader and pinned GGML row converters independently of the normal Qwen numerical path. Existing model inventories, setup defaults, server code and dependency pins are unchanged.

Muse's NVIDIA adapter is excluded from HIP gfx906 compatibility mode, which retains the CPU path. An explicit Muse/SYCL combination fails before entering the separate SYCL project. Both Muse executables use the existing Windows UTF-8 manifest helper. Four CMake graph regressions protect these boundaries and the missing-row-converter diagnostic; they do not simulate backend compilation or Windows runtime execution.

An independent NumPy oracle checks the full text graph. The explicit muse_model_test --cuda mode adds device checks for F32, F16/Q8_0 and synthetic IQ1_S/Q6_K/Q8_0 rows, four greedy steps, separate EOS/EOT stops and zero-step output. The normal CTest remains CPU-only. Build/run instructions are in docs/MUSE_SPARK.md.

Validation

Submitted and tested revision: af1c8b2706033b6878023b0a0fcdf86794e3ad7e, based on main 011c9e600a93bbc9fd451c563501b5831c32bbca. GGML pin: 3cf03257f219afbe7334045ff7c6a06ac68c627d. The original source archive and updated test-file SHA-256 were checked after transfer. The final change from e0002b04 only releases mapped fixture/read handles before file mutation on Windows; production and CMake inputs are unchanged.

Linux x86-64, Ubuntu 26.04.1 LTS; AMD Ryzen 9 3900X (12 cores/24 threads), about 60 GiB usable RAM; NVIDIA driver 580.178.04. Isolated Ubuntu 24.04.2 build container: GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1, CUDA toolkit 13.0 (nvcc 13.0.48), Python 3.12.3, NumPy 1.26.4. These are system test packages, not a check of the pinned Python requirements.

Passed:

  • CPU and CUDA builds of the six named Muse/artifact targets; 5/5 native CTests in each configuration.
  • 17/17 Python Muse tests, including four real CMake configuration regressions.
  • 78/78 existing setup-choice, setup-pin and server-family tests on the AVX2 GPU host.
  • Explicit CUDA regression mode passed separately on all three physical GPUs, including four greedy steps, EOS/EOT, zero steps, mixed F16/Q8_0 and synthetic IQ1_S/Q6_K/Q8_0 rows.
  • All 448 independent-oracle fixture logits passed on each GPU at atol=rtol=2e-5:
GPU VRAM Compute capability Max absolute error vs oracle Max absolute error vs CPU
GeForce RTX 2080 Ti 11 GiB 7.5 1.60896658e-6 1.162e-6
GeForce RTX 3080 10 GiB 8.6 1.60896658e-6 1.19e-6
GeForce RTX 3060 12 GiB 8.6 1.60896658e-6 1.19e-6

Both CPU paths also passed (max_abs=1.66910654e-6). These are separate single-GPU checks.

Focused build and device commands

Run from /src, pinned GGML at /llama, writable outputs at /out:

export PYTHONDONTWRITEBYTECODE=1
unset STRATA_EXECV
python3 -m unittest discover -s tools/muse -p 'test_*.py'
python3 -m unittest tools.test_setup_choices tools.test_setup_pins serve.test_family_name
python3 -m tools.muse.fixture --output-dir /out/fixture
for backend in cpu cuda; do
  cuda_option=OFF
  if [ "$backend" = cuda ]; then cuda_option=ON; fi
  cmake -S /src -B "/out/build-$backend" -G Ninja \
    -DSTRATA_ENABLE_MUSE=ON -DSTRATA_BUILD_TESTS=ON \
    -DSTRATA_ENABLE_CUDA="$cuda_option" -DSTRATA_ENABLE_HIP=OFF \
    -DSTRATA_GGML_DIR=/llama -DCMAKE_CUDA_ARCHITECTURES='75;86'
  cmake --build "/out/build-$backend" --target strata-muse muse_model_test \
    gguf_reader_test gguf_split_test model_family_test gguf_geometry_test --parallel 2
  ctest --test-dir "/out/build-$backend" \
    -R '^(muse_model_test|gguf_reader_test|gguf_split_test|model_family_test|gguf_geometry_test)$' \
    --output-on-failure
  "/out/build-$backend/src/muse/strata-muse" --model /out/fixture/model.gguf \
    --tokens 1,5,8,3,7,2,9 --ctx 32 --steps 0 --backend cpu \
    --logits-file "/out/fixture/$backend-build-cpu.json"
  python3 -m tools.muse.compare --reference /out/fixture/reference.json \
    --actual "/out/fixture/$backend-build-cpu.json"
done
for gpu in 2 1 0; do
  gpu_uuid=$(nvidia-smi -i "$gpu" --query-gpu=uuid --format=csv,noheader)
  CUDA_VISIBLE_DEVICES="$gpu_uuid" /out/build-cuda/src/muse/muse_model_test --cuda
  CUDA_VISIBLE_DEVICES="$gpu_uuid" /out/build-cuda/src/muse/strata-muse \
    --model /out/fixture/model.gguf --tokens 1,5,8,3,7,2,9 \
    --ctx 32 --steps 0 --backend cuda --gpu 0 \
    --logits-file "/out/fixture/gpu-$gpu.json"
  python3 -m tools.muse.compare --reference /out/fixture/reference.json \
    --actual "/out/fixture/gpu-$gpu.json"
  python3 -m tools.muse.compare --reference /out/fixture/cpu-build-cpu.json \
    --actual "/out/fixture/gpu-$gpu.json"
done

ASan/UBSan with leak detection: 5/5 focused CTests passed, including host allocation-failure/recovery checks. Built CPU-only with RelWithDebInfo, both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS set to -fsanitize=address,undefined -fno-omit-frame-pointer, and CMAKE_EXE_LINKER_FLAGS=-fsanitize=address,undefined; ran the same CTest filter with ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 and UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1.

Actual RTX 3060 CUDA memory check:

gpu_uuid=$(nvidia-smi -i 2 --query-gpu=uuid --format=csv,noheader)  # RTX 3060 in this run
CUDA_VISIBLE_DEVICES="$gpu_uuid" compute-sanitizer --tool memcheck \
  --leak-check full --error-exitcode 99 \
  /out/build-cuda/src/muse/muse_model_test --cuda

Observed: LEAK SUMMARY: 0 bytes leaked in 0 allocations; ERROR SUMMARY: 0 errors.

Unavailable CPU-build CUDA backend and an invalid CUDA device ordinal both exited 1 before creating an output file. git diff --check origin/main...HEAD passed. The public CLI, numerical runtime, CUDA adapter and oracle sources are unchanged from the earlier validated revision; the new changes are build integration, regression checks, fixture lifetimes and documentation.

Default-off validation now includes the complete CUDA engine target. Built main and the submitted revision with the same image, dependency sources, internal paths and compiler cache, leaving Muse off:

cmake -S /src -B /out/build -G Ninja -DSTRATA_BUILD_TESTS=OFF \
  -DSTRATA_ENABLE_CUDA=ON -DSTRATA_ENABLE_HIP=OFF \
  -DCMAKE_CUDA_ARCHITECTURES=86 -DSTRATA_GGML_DIR=/llama \
  -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
  -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
cmake --build /out/build --target strata --parallel 2
cd /out/build
sha256sum strata libstrata_kq.so

Both builds completed. After the final test-only change, the CUDA target again reported ninja: no work to do and retained the same hashes. Artifacts matched byte-for-byte:

32cf5b740b55f30271731452ffe563c273f861901c0cdd15ee61a2e5dd9c4c78  strata
968bc9ad466627f27d2bbf008c49ef04977d34e84f080deccd84822c6b937ba6  libstrata_kq.so

Actual oneAPI/SYCL default-off engine build passed: 134/134 build steps, including the final sycl/strata link. Ubuntu 26.04 build container; IntelLLVM icx/icpx 2026.1.0 (20260617), CMake 4.2.3, Ninja 1.13.2. Built generic SPIR-V/JIT with no AOT target or GPU access:

cmake -S /src -B /out/build -G Ninja \
  -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \
  -DSTRATA_ENABLE_SYCL=ON -DSTRATA_ENABLE_MUSE=OFF \
  -DSTRATA_ENABLE_CUDA=OFF -DSTRATA_ENABLE_HIP=OFF \
  -DSTRATA_GGML_DIR=/llama -DCMAKE_BUILD_TYPE=Release
cmake --build /out/build --target strata --parallel 2

The same real toolchain also rejects STRATA_ENABLE_SYCL=ON with STRATA_ENABLE_MUSE=ON at the intended top-level diagnostic, before entering the SYCL subproject. This is compilation/configuration evidence; no Intel GPU execution or optional SYCL NumPy parity tests were run.

Actual HIP gfx906 compilation also passed with the documented community ROCm 7.14.60850 image (Ubuntu 24.04.5): Clang 23.0.0, CMake 3.28.3 and Ninja 1.11.1. Built all six focused Muse/artifact targets with Muse enabled, then ran 5/5 CPU CTests without an NVIDIA toolkit. The complete default-off gfx906 engine built in 158/158 steps. On final head af1c8b27, the changed Muse test was rebuilt and all five tests passed again; the default engine target then reported no work. No AMD GPU was exposed to these containers, and no HIP hardware execution is claimed. The oneAPI default-off engine also passed an incremental final-head check with its executable hash unchanged.

HIP gfx906 configuration and build commands

The base image was mixa3607/rocm-gfx906@sha256:83d0b8ba6c98512a05b0d306b0875f0c696632a9015821f739d5698d982ce9fb, with CMake/Ninja build packages added in an isolated image.

export ROCM_PATH=/opt/rocm HIP_PLATFORM=amd
cmake -S /src -B /out/build-muse -G Ninja \
  -DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906 \
  -DSTRATA_ENABLE_MUSE=ON -DSTRATA_BUILD_TESTS=ON \
  -DSTRATA_GGML_DIR=/llama -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang \
  -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ \
  -DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++
cmake --build /out/build-muse --target strata-muse muse_model_test \
  gguf_reader_test gguf_split_test model_family_test gguf_geometry_test --parallel 2
ctest --test-dir /out/build-muse --output-on-failure \
  -R '^(muse_model_test|gguf_reader_test|gguf_split_test|model_family_test|gguf_geometry_test)$'

For the default engine, the same configuration used /out/build-default, STRATA_ENABLE_MUSE=OFF and STRATA_BUILD_TESTS=OFF, then cmake --build /out/build-default --target strata --parallel 2.

Windows CPU validation passed in the exact-source MSVC run, checking out final af1c8b27 and the same GGML pin. Hardware: AMD EPYC 9V45 virtual machine, two cores/four logical CPUs, about 16 GiB RAM; Windows Server 2025 build 26100. Toolchain: Visual Studio 18.11.12315.225, MSVC 19.51.36260.0, SDK 10.0.26100.0, CMake 4.4.4, Ninja 1.13.2, Python 3.12.10 and NumPy 1.26.4.

  • Both Muse executables and four artifact test targets compiled in Release mode.
  • Extracted both executable manifests with SDK mt.exe and verified activeCodePage=UTF-8.
  • 5/5 native CTests and a separate Muse native run under a Unicode temporary directory passed.
  • 17/17 Python tests passed, including the CMake graph probes under MSVC.
  • Native CLI model/output paths containing Chinese and Cyrillic characters passed all 448 oracle logits, max_abs=1.41593384e-6, atol=rtol=2e-5.

The linked workflow preserves commands and artifacts. Its Unicode oracle step explicitly uses PYTHONUTF8=1 and PYTHONIOENCODING=utf-8 for redirected Python fixture logs; actual stdout/stderr were verified as UTF-8. This does not substitute for the executable manifests or native Unicode-path checks.

The complete Terminal suite passed on combined validation revision dcb54ca39104f77695c3820b8597b7a5af4bfd95: earlier Muse e0002b04 plus the test-only companions #3778 and #3782. It reported 1,312 passed, 42 skipped, 226 subtests passed, exit 0, in 632.64 seconds. Environment: Linux x86-64, Xeon E5-2690 v2, Python 3.11.2, pytest 9.1.1, pytest-asyncio 1.4.0, Textual 8.2.8, Rich 15.0.0; isolated container with standard site-packages, read-only source, no network and --init. Command: python3 -m pytest -q -p no:cacheprovider tests/terminal.

These are combined-branch results; the companion fixes have not merged into this MR or main. The final Muse change only adjusts a C++ test fixture; Terminal source inputs are unchanged from this run. The run emitted six warnings: three invalid-escape deprecations and three TUI worker/closed-loop warnings, which are not claimed fixed here. The same three worker/coroutine warnings reproduce on unmodified main in the ordered TUI test pair (two tests pass there and on the companion branch). The Terminal fixture failures were reproduced on main and repaired in #3782.

Failed before fixes:

At e0002b04, MSVC built all six targets and verified both manifests, but the Muse native test attempted to delete a shard while its model still held the mapping. The final test-only commit releases that model first and closes consumed output readers before rewriting the JSON file. All assertions and production file-sharing behavior are retained. Final-head native tests pass on Linux CPU/CUDA, HIP CPU fallback and MSVC.

Independent baseline fixture failures were reproduced before repair.

The four original setup-test errors were reproduced on unmodified main on an AVX-only Xeon E5-2690 v2. They came from host-dependent cached-engine fixtures, and are repaired in the separate test-only #3778: the same command passes 79/79 tests there on Python 3.12.3. Production ISA checks are unchanged.

Terminal portability failures were also reproduced on main and are fixed separately in #3782; the passing combined results above include that companion.

Not run:

  • AMD/Intel GPU execution; Windows CUDA-adapter compilation/execution; macOS/Metal compilation or hardware execution. Windows validation covers the CPU reference; the NVIDIA adapter was built and executed on Linux.
  • Published full-checkpoint execution, model quality or performance, tokenizer/chat-template, installer/API integration, tool/reasoning parsing, multimodal input, MTP, or multi-GPU scheduling.
  • The complete repository-wide test suite.

Limits

The independent fixture has two layers, four experts/top2, local-window crossing and 448 logits. Synthetic quantized rows do not validate published weights. The CUDA adapter uses cuBLAS over decoded tiles; it is not Strata's optimized expert cache or a native quantized GPU kernel. Unsupported row encodings and scaled RoPE fail explicitly.

Mapped-file/page-cache residency, headers, allocator and library overhead are outside the calculated KV/scratch bound. Input shards must remain unchanged; a failed run can leave partial JSON. This PR covers the experimental reference CLI; it does not complete #2762's broader integration.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2769 **Author:** [@BColsey](https://github.com/BColsey) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/muse-spark-reference-2762` --- ### 📝 Commits (10+) - [`7feaa59`](https://github.com/Niko1221/Strata/commit/7feaa5976e7ac5aaf1a1b869af4cdcac44c53d2e) feat: add opt-in Muse Spark GGUF streaming reference runtime - [`cb0119f`](https://github.com/Niko1221/Strata/commit/cb0119fbabd4a9c99494a9d829285c60eefc723c) build: reserve opt-in Muse reference runtime boundary - [`9688c64`](https://github.com/Niko1221/Strata/commit/9688c64790d27277f8a4977faf9dc833e89ced07) test: add independent Muse Spark numerical oracle - [`34bb730`](https://github.com/Niko1221/Strata/commit/34bb730ce1ccdb152820fa0f9db7f17972b8ff4f) Merge reviewed Muse native runtime - [`4362806`](https://github.com/Niko1221/Strata/commit/436280689989705ac3575a97012da9e0d0e0641c) Merge reviewed independent Muse oracle - [`3955c25`](https://github.com/Niko1221/Strata/commit/3955c25fff4bb594cd7d63c0c5485e1a1de07e96) docs: describe experimental Muse reference runtime and limits - [`91bfd2e`](https://github.com/Niko1221/Strata/commit/91bfd2e361e8d58ee9b41168cf086b7f0c72bbe1) [Docs] refresh Muse build prerequisites for current main - [`bb9ef5b`](https://github.com/Niko1221/Strata/commit/bb9ef5ba5d4687560c30555214e5a1e308061803) [Engine] isolate Muse adapter backend and Windows build policy - [`405b506`](https://github.com/Niko1221/Strata/commit/405b50691b8341c7426e2f05347b2909ba1c5957) [Engine] exercise Muse CUDA execution through opt-in tests - [`6b92a49`](https://github.com/Niko1221/Strata/commit/6b92a49d2d6da9dfac6548bbfe7e50a2d48a20bf) [Docs] describe explicit Muse CUDA regression checks ### 📊 Changes **18 files changed** (+2329 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+10 -0) 📝 `README.md` (+3 -0) 📝 `docs/MODELS.md` (+3 -0) ➕ `docs/MUSE_SPARK.md` (+144 -0) ➕ `include/strata/muse/model.hpp` (+55 -0) ➕ `src/muse/CMakeLists.txt` (+23 -0) ➕ `src/muse/cuda_matvec.cpp` (+54 -0) ➕ `src/muse/cuda_matvec.hpp` (+17 -0) ➕ `src/muse/main.cpp` (+20 -0) ➕ `src/muse/model.cpp` (+573 -0) ➕ `src/muse/model_test.cpp` (+473 -0) ➕ `src/muse/test_allocations.cpp` (+27 -0) ➕ `tools/muse/__init__.py` (+1 -0) ➕ `tools/muse/compare.py` (+77 -0) ➕ `tools/muse/fixture.py` (+152 -0) ➕ `tools/muse/reference.py` (+185 -0) ➕ `tools/muse/test_build.py` (+157 -0) ➕ `tools/muse/test_oracle.py` (+355 -0) </details> ### 📄 Description ## Problem and result Strata has no Muse Spark text execution path. This PR adds a separate, opt-in `strata-muse` reference CLI for existing `muse-spark` GGUF shards. It accepts token IDs and evaluates the text graph with file-backed weights and bounded decoded row tiles, on CPU or through an optional NVIDIA CUDA/cuBLAS adapter. This is an experimental numerical reference runtime. It does not claim full 816B checkpoint inference, model quality, usable speed, or installer/chat/API integration. ## Related discussion Refs #2762; this does not close that broader feature request. Broader integration still needs agreed scope. Independent baseline fixture failures found during validation are fixed separately in #3778 (setup, referencing #1935) and #3782 (Terminal portability). ## Approach `STRATA_ENABLE_MUSE` defaults to `OFF`. The runtime uses the existing GGUF reader and pinned GGML row converters independently of the normal Qwen numerical path. Existing model inventories, setup defaults, server code and dependency pins are unchanged. Muse's NVIDIA adapter is excluded from HIP gfx906 compatibility mode, which retains the CPU path. An explicit Muse/SYCL combination fails before entering the separate SYCL project. Both Muse executables use the existing Windows UTF-8 manifest helper. Four CMake graph regressions protect these boundaries and the missing-row-converter diagnostic; they do not simulate backend compilation or Windows runtime execution. An independent NumPy oracle checks the full text graph. The explicit `muse_model_test --cuda` mode adds device checks for F32, F16/Q8_0 and synthetic IQ1_S/Q6_K/Q8_0 rows, four greedy steps, separate EOS/EOT stops and zero-step output. The normal CTest remains CPU-only. Build/run instructions are in `docs/MUSE_SPARK.md`. ## Validation Submitted and tested revision: **`af1c8b2706033b6878023b0a0fcdf86794e3ad7e`**, based on main **`011c9e600a93bbc9fd451c563501b5831c32bbca`**. GGML pin: **`3cf03257f219afbe7334045ff7c6a06ac68c627d`**. The original source archive and updated test-file SHA-256 were checked after transfer. The final change from `e0002b04` only releases mapped fixture/read handles before file mutation on Windows; production and CMake inputs are unchanged. Linux x86-64, Ubuntu 26.04.1 LTS; AMD Ryzen 9 3900X (12 cores/24 threads), about 60 GiB usable RAM; NVIDIA driver 580.178.04. Isolated Ubuntu 24.04.2 build container: GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1, CUDA toolkit 13.0 (`nvcc` 13.0.48), Python 3.12.3, NumPy 1.26.4. These are system test packages, not a check of the pinned Python requirements. **Passed:** - CPU and CUDA builds of the six named Muse/artifact targets; **5/5 native CTests in each configuration**. - **17/17 Python Muse tests**, including four real CMake configuration regressions. - **78/78 existing setup-choice, setup-pin and server-family tests on the AVX2 GPU host**. - Explicit CUDA regression mode passed separately on all three physical GPUs, including four greedy steps, EOS/EOT, zero steps, mixed F16/Q8_0 and synthetic IQ1_S/Q6_K/Q8_0 rows. - All **448 independent-oracle fixture logits** passed on each GPU at `atol=rtol=2e-5`: | GPU | VRAM | Compute capability | Max absolute error vs oracle | Max absolute error vs CPU | | --- | ---: | ---: | ---: | ---: | | GeForce RTX 2080 Ti | 11 GiB | 7.5 | `1.60896658e-6` | `1.162e-6` | | GeForce RTX 3080 | 10 GiB | 8.6 | `1.60896658e-6` | `1.19e-6` | | GeForce RTX 3060 | 12 GiB | 8.6 | `1.60896658e-6` | `1.19e-6` | Both CPU paths also passed (`max_abs=1.66910654e-6`). These are separate single-GPU checks. <details> <summary>Focused build and device commands</summary> Run from `/src`, pinned GGML at `/llama`, writable outputs at `/out`: ```sh export PYTHONDONTWRITEBYTECODE=1 unset STRATA_EXECV python3 -m unittest discover -s tools/muse -p 'test_*.py' python3 -m unittest tools.test_setup_choices tools.test_setup_pins serve.test_family_name python3 -m tools.muse.fixture --output-dir /out/fixture for backend in cpu cuda; do cuda_option=OFF if [ "$backend" = cuda ]; then cuda_option=ON; fi cmake -S /src -B "/out/build-$backend" -G Ninja \ -DSTRATA_ENABLE_MUSE=ON -DSTRATA_BUILD_TESTS=ON \ -DSTRATA_ENABLE_CUDA="$cuda_option" -DSTRATA_ENABLE_HIP=OFF \ -DSTRATA_GGML_DIR=/llama -DCMAKE_CUDA_ARCHITECTURES='75;86' cmake --build "/out/build-$backend" --target strata-muse muse_model_test \ gguf_reader_test gguf_split_test model_family_test gguf_geometry_test --parallel 2 ctest --test-dir "/out/build-$backend" \ -R '^(muse_model_test|gguf_reader_test|gguf_split_test|model_family_test|gguf_geometry_test)$' \ --output-on-failure "/out/build-$backend/src/muse/strata-muse" --model /out/fixture/model.gguf \ --tokens 1,5,8,3,7,2,9 --ctx 32 --steps 0 --backend cpu \ --logits-file "/out/fixture/$backend-build-cpu.json" python3 -m tools.muse.compare --reference /out/fixture/reference.json \ --actual "/out/fixture/$backend-build-cpu.json" done for gpu in 2 1 0; do gpu_uuid=$(nvidia-smi -i "$gpu" --query-gpu=uuid --format=csv,noheader) CUDA_VISIBLE_DEVICES="$gpu_uuid" /out/build-cuda/src/muse/muse_model_test --cuda CUDA_VISIBLE_DEVICES="$gpu_uuid" /out/build-cuda/src/muse/strata-muse \ --model /out/fixture/model.gguf --tokens 1,5,8,3,7,2,9 \ --ctx 32 --steps 0 --backend cuda --gpu 0 \ --logits-file "/out/fixture/gpu-$gpu.json" python3 -m tools.muse.compare --reference /out/fixture/reference.json \ --actual "/out/fixture/gpu-$gpu.json" python3 -m tools.muse.compare --reference /out/fixture/cpu-build-cpu.json \ --actual "/out/fixture/gpu-$gpu.json" done ``` </details> ASan/UBSan with leak detection: **5/5 focused CTests passed**, including host allocation-failure/recovery checks. Built CPU-only with `RelWithDebInfo`, both `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS` set to `-fsanitize=address,undefined -fno-omit-frame-pointer`, and `CMAKE_EXE_LINKER_FLAGS=-fsanitize=address,undefined`; ran the same CTest filter with `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1` and `UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1`. Actual RTX 3060 CUDA memory check: ```sh gpu_uuid=$(nvidia-smi -i 2 --query-gpu=uuid --format=csv,noheader) # RTX 3060 in this run CUDA_VISIBLE_DEVICES="$gpu_uuid" compute-sanitizer --tool memcheck \ --leak-check full --error-exitcode 99 \ /out/build-cuda/src/muse/muse_model_test --cuda ``` Observed: `LEAK SUMMARY: 0 bytes leaked in 0 allocations`; `ERROR SUMMARY: 0 errors`. Unavailable CPU-build CUDA backend and an invalid CUDA device ordinal both exited 1 before creating an output file. `git diff --check origin/main...HEAD` passed. The public CLI, numerical runtime, CUDA adapter and oracle sources are unchanged from the earlier validated revision; the new changes are build integration, regression checks, fixture lifetimes and documentation. Default-off validation now includes the **complete CUDA engine target**. Built main and the submitted revision with the same image, dependency sources, internal paths and compiler cache, leaving Muse off: ```sh cmake -S /src -B /out/build -G Ninja -DSTRATA_BUILD_TESTS=OFF \ -DSTRATA_ENABLE_CUDA=ON -DSTRATA_ENABLE_HIP=OFF \ -DCMAKE_CUDA_ARCHITECTURES=86 -DSTRATA_GGML_DIR=/llama \ -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache cmake --build /out/build --target strata --parallel 2 cd /out/build sha256sum strata libstrata_kq.so ``` Both builds completed. After the final test-only change, the CUDA target again reported `ninja: no work to do` and retained the same hashes. Artifacts matched byte-for-byte: ```text 32cf5b740b55f30271731452ffe563c273f861901c0cdd15ee61a2e5dd9c4c78 strata 968bc9ad466627f27d2bbf008c49ef04977d34e84f080deccd84822c6b937ba6 libstrata_kq.so ``` Actual oneAPI/SYCL default-off engine build passed: **134/134 build steps**, including the final `sycl/strata` link. Ubuntu 26.04 build container; IntelLLVM `icx`/`icpx` 2026.1.0 (20260617), CMake 4.2.3, Ninja 1.13.2. Built generic SPIR-V/JIT with no AOT target or GPU access: ```sh cmake -S /src -B /out/build -G Ninja \ -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \ -DSTRATA_ENABLE_SYCL=ON -DSTRATA_ENABLE_MUSE=OFF \ -DSTRATA_ENABLE_CUDA=OFF -DSTRATA_ENABLE_HIP=OFF \ -DSTRATA_GGML_DIR=/llama -DCMAKE_BUILD_TYPE=Release cmake --build /out/build --target strata --parallel 2 ``` The same real toolchain also rejects `STRATA_ENABLE_SYCL=ON` with `STRATA_ENABLE_MUSE=ON` at the intended top-level diagnostic, before entering the SYCL subproject. This is compilation/configuration evidence; no Intel GPU execution or optional SYCL NumPy parity tests were run. Actual HIP gfx906 compilation also passed with the documented community ROCm 7.14.60850 image (Ubuntu 24.04.5): Clang 23.0.0, CMake 3.28.3 and Ninja 1.11.1. Built all six focused Muse/artifact targets with Muse enabled, then ran **5/5 CPU CTests** without an NVIDIA toolkit. The complete default-off gfx906 engine built in **158/158 steps**. On final head `af1c8b27`, the changed Muse test was rebuilt and all five tests passed again; the default engine target then reported no work. No AMD GPU was exposed to these containers, and no HIP hardware execution is claimed. The oneAPI default-off engine also passed an incremental final-head check with its executable hash unchanged. <details> <summary>HIP gfx906 configuration and build commands</summary> The base image was `mixa3607/rocm-gfx906@sha256:83d0b8ba6c98512a05b0d306b0875f0c696632a9015821f739d5698d982ce9fb`, with CMake/Ninja build packages added in an isolated image. ```sh export ROCM_PATH=/opt/rocm HIP_PLATFORM=amd cmake -S /src -B /out/build-muse -G Ninja \ -DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906 \ -DSTRATA_ENABLE_MUSE=ON -DSTRATA_BUILD_TESTS=ON \ -DSTRATA_GGML_DIR=/llama -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang \ -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ \ -DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ cmake --build /out/build-muse --target strata-muse muse_model_test \ gguf_reader_test gguf_split_test model_family_test gguf_geometry_test --parallel 2 ctest --test-dir /out/build-muse --output-on-failure \ -R '^(muse_model_test|gguf_reader_test|gguf_split_test|model_family_test|gguf_geometry_test)$' ``` For the default engine, the same configuration used `/out/build-default`, `STRATA_ENABLE_MUSE=OFF` and `STRATA_BUILD_TESTS=OFF`, then `cmake --build /out/build-default --target strata --parallel 2`. </details> Windows CPU validation passed in [the exact-source MSVC run](https://github.com/BColsey/Strata/actions/runs/39878893559), checking out final `af1c8b27` and the same GGML pin. Hardware: AMD EPYC 9V45 virtual machine, two cores/four logical CPUs, about 16 GiB RAM; Windows Server 2025 build 26100. Toolchain: Visual Studio 18.11.12315.225, MSVC 19.51.36260.0, SDK 10.0.26100.0, CMake 4.4.4, Ninja 1.13.2, Python 3.12.10 and NumPy 1.26.4. - Both Muse executables and four artifact test targets compiled in Release mode. - Extracted both executable manifests with SDK `mt.exe` and verified `activeCodePage=UTF-8`. - **5/5 native CTests** and a separate Muse native run under a Unicode temporary directory passed. - **17/17 Python tests** passed, including the CMake graph probes under MSVC. - Native CLI model/output paths containing Chinese and Cyrillic characters passed all **448 oracle logits**, `max_abs=1.41593384e-6`, `atol=rtol=2e-5`. The linked workflow preserves commands and artifacts. Its Unicode oracle step explicitly uses `PYTHONUTF8=1` and `PYTHONIOENCODING=utf-8` for redirected Python fixture logs; actual stdout/stderr were verified as UTF-8. This does not substitute for the executable manifests or native Unicode-path checks. The complete Terminal suite passed on combined validation revision [`dcb54ca39104f77695c3820b8597b7a5af4bfd95`](https://github.com/BColsey/Strata/commit/dcb54ca39104f77695c3820b8597b7a5af4bfd95): earlier Muse `e0002b04` plus the test-only companions #3778 and #3782. It reported **1,312 passed, 42 skipped, 226 subtests passed**, exit 0, in 632.64 seconds. Environment: Linux x86-64, Xeon E5-2690 v2, Python 3.11.2, pytest 9.1.1, pytest-asyncio 1.4.0, Textual 8.2.8, Rich 15.0.0; isolated container with standard site-packages, read-only source, no network and `--init`. Command: `python3 -m pytest -q -p no:cacheprovider tests/terminal`. These are combined-branch results; the companion fixes have not merged into this MR or main. The final Muse change only adjusts a C++ test fixture; Terminal source inputs are unchanged from this run. The run emitted six warnings: three invalid-escape deprecations and three TUI worker/closed-loop warnings, which are not claimed fixed here. The same three worker/coroutine warnings reproduce on unmodified main in the ordered TUI test pair (two tests pass there and on the companion branch). The Terminal fixture failures were reproduced on main and repaired in #3782. **Failed before fixes:** At `e0002b04`, MSVC built all six targets and verified both manifests, but the Muse native test attempted to delete a shard while its model still held the mapping. The final test-only commit releases that model first and closes consumed output readers before rewriting the JSON file. All assertions and production file-sharing behavior are retained. Final-head native tests pass on Linux CPU/CUDA, HIP CPU fallback and MSVC. Independent baseline fixture failures were reproduced before repair. The four original setup-test errors were reproduced on unmodified main on an AVX-only Xeon E5-2690 v2. They came from host-dependent cached-engine fixtures, and are repaired in the separate test-only #3778: the same command passes **79/79 tests** there on Python 3.12.3. Production ISA checks are unchanged. Terminal portability failures were also reproduced on main and are fixed separately in #3782; the passing combined results above include that companion. **Not run:** - AMD/Intel GPU execution; Windows CUDA-adapter compilation/execution; macOS/Metal compilation or hardware execution. Windows validation covers the CPU reference; the NVIDIA adapter was built and executed on Linux. - Published full-checkpoint execution, model quality or performance, tokenizer/chat-template, installer/API integration, tool/reasoning parsing, multimodal input, MTP, or multi-GPU scheduling. - The complete repository-wide test suite. ## Limits The independent fixture has two layers, four experts/top2, local-window crossing and 448 logits. Synthetic quantized rows do not validate published weights. The CUDA adapter uses cuBLAS over decoded tiles; it is not Strata's optimized expert cache or a native quantized GPU kernel. Unsupported row encodings and scaled RoPE fail explicitly. Mapped-file/page-cache residency, headers, allocator and library overhead are outside the calculated KV/scratch bound. Input shards must remain unchanged; a failed run can leave partial JSON. This PR covers the experimental reference CLI; it does not complete #2762's broader integration. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:22 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4256
No description provided.