[PR #3641] [Engine] opt-in qwen35moe F16 inference, validated on Sage-A1.5 #4729

Open
opened 2026-11-07 15:38:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3641
Author: @acrogenesis
Created: 10/21/2026
Status: 🔄 Open

Base: main ← Head: acrogenesis/sage-f16


📝 Commits (2)

  • 6c1f1e2 Add opt-in F16 weights to the qwen35moe engine
  • f3f2136 Keep opt-in Sage F16 decode fast at 256K context

📊 Changes

32 files changed (+10145 additions, -70 deletions)

View changed files

📝 CMakeLists.txt (+16 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/README.md (+90 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/all-probes.csv (+58 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/cache-tuning.json (+338 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/check-default.py (+50 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/check-logits.py (+47 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/cuda-build.txt (+24 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/cuda-tests.txt (+13 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/default-check.txt (+19 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/fixture-reproduction.txt (+4 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/hip-build.txt (+69 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/llama-256k-optimized-reference-nc27-t8.output.txt (+5 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/llama-dump.cpp (+171 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/llama-log.txt (+21 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/logits-repeat.txt (+3 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/make-fixture.py (+90 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/prompt-hashes.json (+32 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/provenance.json (+40 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/results.json (+7802 -0)
➕ bench/results/2026-10-21-sage-f16-rtx5090/run.py (+167 -0)

...and 12 more files

📄 Description

The release qwen35moe path rejects full F16 weights, including Sage-A1.5's publisher GGUF. This adds opt-in --f16-weights execution and explicit --kv f16 for compatible F16 GGUFs in that model family. The loader selects the path by architecture, geometry and tensor layout; there is no Sage model-name restriction.

Model scope: source inspection indicates that other compatible qwen35moe F16 exports, including Qwen3.6-35B-A3B and its compatible fine-tunes, are candidates for this path. Those other checkpoints have not been run. Matrices, embeddings and routed experts must be F16 and pass the existing geometry/layout checks. Dense Qwen architectures and the separate qwen4exp / Flash-Next engine gain no F16 support from this change.

Sage-A1.5 is the only real F16 checkpoint validated end to end and benchmarked here. On an RTX 5090 32 GB / Ryzen 9 9950X3D / 128 GB RAM, its fresh near-full run generates 36.58 tok/s versus llama.cpp's 29.95 (+22.2%). That speedup applies to this model, machine and workload; it does not establish a gain for other compatible models.

Both final runs use the same F16 weights and F16 KV, 262,144 context capacity, 261,888 actual input tokens plus 256 greedy outputs, 512-token chunks and MTP off. The llama.cpp reference was tuned to 27 CPU-expert layers / 8 threads; Strata uses 15 pool workers plus caller / 60 resident experts per layer. There is one fresh run per final configuration; the report separates saved-prefix tuning repeats and retains the original losing F16 prototype (7.46 tok/s).

The implementation adds raw F16 dense/embedding/expert kernels, reuses F16 prompt GEMMs, expert streaming and ggml's CPU F16 path, and shares coalesced KV reads across each group of eight query heads. The opt-in hybrid cache limits prompt routing history and updates every layer's scores so it can adapt during generation. F16 KV/session copies and prefill reads use the correct element width. Omitting the new flags retains the release quantized/FP32-cache paths; model catalogs and setup are unchanged.

Related: #2464 and #3303. The measured result covers Sage F16 at a near-full 256K window, so those broader reports remain open. FP32 stays the default; this introduces no int8 KV format or global precision change.

Full report, raw measurements, commands, outputs and provenance.

Passed

  • CUDA 12.9 / GCC 14.3.1, HIP gfx1201 and SYCL oneAPI 2026.1 full builds. SYCL still does not run this family; its build checks the shared code.
  • CUDA CTest 4/4: model layout, independent F16 matrix/expert oracle, independent F32/F16 attention oracle including 262,144 cells/causal tails/session tables, and existing Q8 expert parity.
  • Actual model: 128 teacher-forced outputs after 16K input, mean KL 0.001957 / 0.002022 in two runs, 126/128 matching top-token choices in each.
  • Release v0.2.2 versus candidate: 16 synthetic actual-width Q8 cases, identical token ids and complete logit bytes, GPU/hybrid placements, streamed prompts and fixed/changing expert slots. Separate MTP 0/2 protocol runs match the release and plain decode. The published fixture generator reproduces the tested file's SHA256.
  • Small F16 fixtures: MTP 0/2/7 and session/batch-copy checks with fixed slots.

Preparation failures resolved: the first 16K reference helper exceeded its batch; it now reads 512-token chunks. An older SYCL toolchain failed unchanged dependency helpers; the documented 2026.1 build passed. A synthetic-fixture SSM width was corrected and its 96 tensor shapes checked before GPU regression. Details are retained in the report.

Not run / limits: AMD hardware execution, Sage vision, multi-GPU, real-model MTP/concurrent serving, long-context task accuracy, other F16 checkpoints in the same family and other model quantizations. The default regression uses synthetic weights with the actual layer widths, not a downloaded quantized Sage checkpoint. Preparatory CPU work overlapped prefill; only the final generation windows are the acceptance comparison. No general hardware or prefill-speedup claim.

AMD runtime validation remains outstanding: an AMD owner can run q36_f16_parity, q36_attn_parity and a real F16 prompt/decode check. CUDA execution has been validated; HIP compilation alone does not establish AMD execution correctness.


🔄 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/3641 **Author:** [@acrogenesis](https://github.com/acrogenesis) **Created:** 10/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `acrogenesis/sage-f16` --- ### 📝 Commits (2) - [`6c1f1e2`](https://github.com/Niko1221/Strata/commit/6c1f1e2c5f9b674a00ec16194fc7ffff75bea6ae) Add opt-in F16 weights to the qwen35moe engine - [`f3f2136`](https://github.com/Niko1221/Strata/commit/f3f2136f194bdc42d07961bef0ce66b2811f58cb) Keep opt-in Sage F16 decode fast at 256K context ### 📊 Changes **32 files changed** (+10145 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+16 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/README.md` (+90 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/all-probes.csv` (+58 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/cache-tuning.json` (+338 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/check-default.py` (+50 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/check-logits.py` (+47 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/cuda-build.txt` (+24 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/cuda-tests.txt` (+13 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/default-check.txt` (+19 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/fixture-reproduction.txt` (+4 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/hip-build.txt` (+69 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/llama-256k-optimized-reference-nc27-t8.output.txt` (+5 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/llama-dump.cpp` (+171 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/llama-log.txt` (+21 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/logits-repeat.txt` (+3 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/make-fixture.py` (+90 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/prompt-hashes.json` (+32 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/provenance.json` (+40 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/results.json` (+7802 -0) ➕ `bench/results/2026-10-21-sage-f16-rtx5090/run.py` (+167 -0) _...and 12 more files_ </details> ### 📄 Description The release `qwen35moe` path rejects full F16 weights, including Sage-A1.5's publisher GGUF. This adds opt-in `--f16-weights` execution and explicit `--kv f16` for compatible F16 GGUFs in that model family. The loader selects the path by architecture, geometry and tensor layout; there is no Sage model-name restriction. **Model scope:** source inspection indicates that other compatible `qwen35moe` F16 exports, including Qwen3.6-35B-A3B and its compatible fine-tunes, are candidates for this path. Those other checkpoints have not been run. Matrices, embeddings and routed experts must be F16 and pass the existing geometry/layout checks. Dense Qwen architectures and the separate `qwen4exp` / Flash-Next engine gain no F16 support from this change. **Sage-A1.5 is the only real F16 checkpoint validated end to end and benchmarked here.** On an RTX 5090 32 GB / Ryzen 9 9950X3D / 128 GB RAM, its fresh near-full run generates **36.58 tok/s versus llama.cpp's 29.95 (+22.2%)**. That speedup applies to this model, machine and workload; it does not establish a gain for other compatible models. Both final runs use the same F16 weights and F16 KV, 262,144 context capacity, **261,888 actual input tokens plus 256 greedy outputs**, 512-token chunks and MTP off. The llama.cpp reference was tuned to 27 CPU-expert layers / 8 threads; Strata uses 15 pool workers plus caller / 60 resident experts per layer. There is one fresh run per final configuration; the report separates saved-prefix tuning repeats and retains the original losing F16 prototype (7.46 tok/s). The implementation adds raw F16 dense/embedding/expert kernels, reuses F16 prompt GEMMs, expert streaming and ggml's CPU F16 path, and shares coalesced KV reads across each group of eight query heads. The opt-in hybrid cache limits prompt routing history and updates every layer's scores so it can adapt during generation. F16 KV/session copies and prefill reads use the correct element width. Omitting the new flags retains the release quantized/FP32-cache paths; model catalogs and setup are unchanged. Related: #2464 and #3303. The measured result covers Sage F16 at a near-full 256K window, so those broader reports remain open. FP32 stays the default; this introduces no int8 KV format or global precision change. [Full report, raw measurements, commands, outputs and provenance](https://github.com/acrogenesis/Strata/blob/f3f2136f194bdc42d07961bef0ce66b2811f58cb/bench/results/2026-10-21-sage-f16-rtx5090/README.md). **Passed** - CUDA 12.9 / GCC 14.3.1, HIP gfx1201 and SYCL oneAPI 2026.1 full builds. SYCL still does not run this family; its build checks the shared code. - CUDA CTest 4/4: model layout, independent F16 matrix/expert oracle, independent F32/F16 attention oracle including 262,144 cells/causal tails/session tables, and existing Q8 expert parity. - Actual model: 128 teacher-forced outputs after 16K input, mean KL 0.001957 / 0.002022 in two runs, 126/128 matching top-token choices in each. - Release v0.2.2 versus candidate: 16 synthetic actual-width Q8 cases, identical token ids and complete logit bytes, GPU/hybrid placements, streamed prompts and fixed/changing expert slots. Separate MTP 0/2 protocol runs match the release and plain decode. The published fixture generator reproduces the tested file's SHA256. - Small F16 fixtures: MTP 0/2/7 and session/batch-copy checks with fixed slots. **Preparation failures resolved:** the first 16K reference helper exceeded its batch; it now reads 512-token chunks. An older SYCL toolchain failed unchanged dependency helpers; the documented 2026.1 build passed. A synthetic-fixture SSM width was corrected and its 96 tensor shapes checked before GPU regression. Details are retained in the report. **Not run / limits:** AMD hardware execution, Sage vision, multi-GPU, real-model MTP/concurrent serving, long-context task accuracy, other F16 checkpoints in the same family and other model quantizations. The default regression uses synthetic weights with the actual layer widths, not a downloaded quantized Sage checkpoint. Preparatory CPU work overlapped prefill; only the final generation windows are the acceptance comparison. No general hardware or prefill-speedup claim. AMD runtime validation remains outstanding: an AMD owner can run `q36_f16_parity`, `q36_attn_parity` and a real F16 prompt/decode check. CUDA execution has been validated; HIP compilation alone does not establish AMD execution correctness. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#4729
No description provided.