Skip to content

Qwen3.8-Flash-Next EXL3: Native CoopMK trellis MoE, device QSA, and 262K recipes (M5) - #160

Open
vcruz305 wants to merge 2 commits into
Atlas-Inf:mainfrom
vcruz305:feat/exl3-gb10-coopmk-speed
Open

vcruz305 wants to merge 2 commits into
Atlas-Inf:mainfrom
vcruz305:feat/exl3-gb10-coopmk-speed

Conversation

@vcruz305

@vcruz305 vcruz305 commented Oct 3, 2026

Copy link
Copy Markdown

Summary

Milestone M5 of #65: Atlas now serves all 512 routed experts + shared expert of Qwen3.8-Flash-Next (turboderp/Qwen3.8-Flash-Next-exl3, 4.05 bpw) as native packed EXL3 trellis on GB10 (sm_121), eliminating the interim transient-BF16 / NVFP4 expert requantization path.

In addition to native CoopMK MoE decode, this PR includes:

  • Device-resident QSA selection (ATLAS_QSA_DEVICE=1) for the Qwen3.8-Flash-Next indexer.
  • M-row EXL3 dense GEMV and batched verify kernels for speculative decoding.
  • Full 262K Context Deployment Recipes in docs/recipes/exl3-qwen4exp-gb10.md covering single-GPU build flags and 262,144 context configurations with memory analysis.

Refs #65 (Delivers M5).

What is in here

Component What
M5: Native Trellis MoE crates/spark-model/src/layers/moe/forward_exl3.rs, forward_exl3_grouped.rs, exl3_coopmk.rs: Retains experts packed in memory without runtime NVFP4 requantization; binds CoopMK runtime-K cooperative decode kernels (exl3_coopmk.cu, exl3_vendor/coopmk/).
Device QSA Selection crates/spark-model/src/layers/qsa_dev.rs, crates/spark-model/src/layers/ops/qsa_dev.rs: Capturable device selection arm for the attention indexer.
M-row Dense GEMV crates/spark-model/src/layers/ops/exl3_dense.rs, exl3_gemv.cu: Native multi-row GEMV for verify rows across K=2..8 verify windows.
262K Recipes docs/recipes/exl3-qwen4exp-gb10.md: Single-GPU --features cuda build instructions and full 262,144 context serving configurations.

Verification & Measurements (DGX Spark GB10)

  • Unit Tests: cargo test -p spark-model --lib (918 passed, 0 failed), cargo test -p spark-server --lib (104 passed, 0 failed).
  • Format: cargo fmt --all -- --check clean.
  • Compilation: Clean release binary build via cargo build --release -p spark-server --bin spark --no-default-features --features cuda.
  • Preflight Kernel Audit: atlas_kernel_check PASSED for (qwen3.8-flash-next, sm_121, exl3) (390 lookups, 0 unresolved, ok: true).
  • Live Serve Test: Successfully loaded flashnext-exl3-4.05bpw (297,909 tensors, 48 layers, 512 packed experts) and verified live generation via /v1/chat/completions with full reasoning trace.

CLA

@vcruz305
vcruz305 requested a review from AzeezIsh as a code owner October 3, 2026 00:21
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@vcruz305

vcruz305 commented Oct 3, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@vcruz305

vcruz305 commented Oct 3, 2026

Copy link
Copy Markdown
Author

recheck

… recipes (Atlas-Inf#65)

- EXL3 CoopMK Trellis MoE: Keep all 512 routed experts + shared expert packed in memory without runtime NVFP4 requantization; bind CoopMK runtime-K cooperative decode kernels for sm_121.
- Device-resident QSA selection: Implement capturable device selection arm (ATLAS_QSA_DEVICE=1) for Qwen3.8-Flash-Next indexer.
- M-row EXL3 dense GEMV and batched verify support across K=2..8 verify windows.
- In-tree serving documentation: Provide single-GPU --features cuda build recipe and full 262K native context recipes in docs/recipes/exl3-qwen4exp-gb10.md.
@vcruz305
vcruz305 force-pushed the feat/exl3-gb10-coopmk-speed branch from 14962b8 to 9faa01d Compare October 3, 2026 00:33
@AzeezIsh

AzeezIsh commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for M5. Before this goes further, one cross-platform blocker and one measured data point, both from the AMD side.

Blocker: Flash-Next MTP verify breaks on AMD (strix-hip, Linux and Windows).

Measured data point: the same two kernels are slower on gfx1151. These match the token-fused kernels Claude benchmarked in closed #154 (strix job 146, gfx1151, ROCm 7.13). They were bit-identical, but 0.69× at T=2:

case production fused
down 129.5 µs 213.6 µs
finish 38.9 µs 57.3 µs

The reason: one warp per rank row re-reads normed from L2 for every row and token, and fusing tokens halves the finish grid. So even ported to HIP, they shouldn't be the default there unless measured otherwise. Their GB10 speed is a separate question; that needs its own A/B number.

Two smaller notes:

GB10 gate for the EXL3 path: we can queue it on reiner once that box is reachable again; it went offline today. On our side it needs EXL3 boot + byte-identity on the NVFP4 Flash-Next probes (the NVFP4 path is touched in qsa, ple, verify_*, trait_decode_batched) and the 27B boots. The AMD side needs a strix-hip build plus a Windows Flash-Next boot with MTP.

@github-actions github-actions Bot added needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) and removed needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) labels Oct 6, 2026
@AzeezIsh
AzeezIsh force-pushed the feat/exl3-gb10-coopmk-speed branch from 0ed05a3 to 97cef8d Compare October 13, 2026 16:34
@AzeezIsh

Copy link
Copy Markdown
Contributor

Verification pass on GB10 (SM121) — this works end to end on real hardware:

What verified

Accuracy — correction on the earlier 43.92%
That number was not real: my job's host-mem watchdog killed the serve at ~sample 650/995, so every remaining category scored 0.00 by starvation (simple_java/js/python run last → all zeroed). Clean re-run on the same ckpt/config:

subset accuracy
non_live 75.44 (simple_python 93.15, javascript 70.97, java 66.13, multiple 91.94, parallel 69.35, parallel_multiple 63.71)
live 81.76 (simple 100, multiple 85.71)
hallucination 63.83
overall 78.29 / normalized 73.68 (n=995)

For reference the NVFP4 ckpt legs land ~81.6 and the bf16/unsloth ~84 — so EXL3 trails ~3-6pts. Worth a look whether that's expected quant loss or something the trellis/CoopMK path can reclaim — parallel_multiple and the java/js legs are where it dips.

Prefill is the bigger gap
16k at ~90 tok/s vs ~500 tok/s on the NVFP4 path on the same box — the CoopMK/trellis MoE prefill is the dominant cost. If the grouped-prefill envs (ATLAS_EXL3_PREFILL_GROUPED, COOPMK_ROWS) aren't hitting for prefill shapes that's the first place I'd look.

Merge state
Needed one small fix against main: helpers_a.rs — main's transpose now returns Result<Vec<DevicePtr>>; kept the EXL3 early-skip and returned Ok(freed). Pushed to the branch already, CLA green.

cc @vcruz305 — happy to put my agents on the prefill profile if you want eyes on it

@github-actions github-actions Bot added the needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) label Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants