Skip to content

Qwen3.8-Flash-Next EXL3: native packed CoopMK MoE on current main (M5) - #160

Merged
AzeezIsh merged 3 commits into
Atlas-Inf:mainfrom
vcruz305:feat/exl3-gb10-coopmk-speed
Nov 13, 2026
Merged

AzeezIsh merged 3 commits into
Atlas-Inf:mainfrom
vcruz305:feat/exl3-gb10-coopmk-speed

Conversation

@vcruz305

@vcruz305 vcruz305 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

M5 of #65: native packed EXL3 MoE for Qwen3.8-Flash-Next on one GB10 (SM121). Routed and shared experts remain in packed EXL3 trellis form; native CoopMK runs MoE decode without resident NVFP4 expert requantization. Other dense linears continue to materialize to BF16 at load.

Merged current main into this PR with merge commit e97a57d. The feature diff was narrowed from 75 changed files to 34, preserving only native packed MoE, CoopMK integration, MTP packed-expert loading, and the minimal 262K recipe. Current main supplies the QSA, attention, MTP proposal, and scheduler/verify paths.

Deferred from this PR: experimental grouped packed-EXL3 prefill, native dense EXL3 GEMV, the separate device-QSA arm, optional HC fusion, and extra speculative tuning. No new performance claim is made.

Validation (integration workspace)

  • Rust formatting: PASS.
  • CUDA-feature Rust type checks for spark-model and spark-server: PASS (ATLAS_SKIP_BUILD=1 for host-only checks).
  • CUDA 13.0 NVCC compilation of exl3_coopmk.cu targeting sm_121: PASS (compilation only, no GB10 runtime).
  • spark-model EXL3-filtered tests: 27 passed, 0 failed, 8 ignored.
  • spark-server library tests: 141 passed, 0 failed.
  • Full spark-model library test attempt: 2,431 passed, 13 failed, 179 ignored. All 13 failures were unrelated FFmpeg video-decoding tests on an FFmpeg 4.4.2 host (unsupported CLI option), not EXL3 failures.
  • Source file-size-cap compliance: PASS, with no new allow-list exceptions.

Remaining GB10 gate

Use HF checkpoint turboderp/Qwen3.8-Flash-Next-exl3 at revision 3.05bpw_h5_ng5 (previously tested by the maintainer). Resolve to an immutable HF commit SHA for the final test record. The original 4.05 bpw checkpoint can also be tested as needed for #65.

Pending on GB10: native EXL3 boot and greedy consistency, speculative MTP/K-row verification, byte-identical controls on existing Qwen3.8 deployments, and agentic-50 / BFCL ST-995 where applicable. See docs/recipes/exl3-qwen4exp-gb10.md for the minimal build/serve recipe.

CLA

  • I have read and agree to the Contributor License Agreement.

@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
Contributor Author

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

@vcruz305

vcruz305 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor 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
@AzeezIsh

AzeezIsh commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer pass-through (2026-11-02). This PR can't merge as it stands.

  • It conflicts with current main (bce5dd904). The branch is 818 commits behind, and a merge of its head into main conflicts in 19 files:
.github/workflows/file-size-cap.yml
crates/spark-model/src/layer/transformer_layer.rs
crates/spark-model/src/layers/moe/forward.rs
crates/spark-model/src/layers/moe/forward_batched.rs
crates/spark-model/src/layers/moe/forward_k3.rs
crates/spark-model/src/layers/moe/forward_prefill.rs
crates/spark-model/src/layers/moe/helpers_a.rs
crates/spark-model/src/layers/ops/hyper_connection_lowrank_split.rs
crates/spark-model/src/layers/qsa.rs
crates/spark-model/src/layers/qwen3_attention/decode/attention_forward.rs
crates/spark-model/src/layers/qwen3_attention/trait_impl.rs
crates/spark-model/src/layers/qwen3_attention/trait_impl/multi_seq/mod.rs
crates/spark-model/src/layers/qwen4exp_mtp.rs
crates/spark-model/src/model/impl_a3.rs
crates/spark-model/src/model/trait_impl/verify_d.rs
crates/spark-model/src/weight_loader/qwen4_exp/mtp.rs
crates/spark-server/src/scheduler/verify_k4_verdict.rs
crates/spark-server/src/scheduler/verify_pipeline_helper/fast_masked.rs
kernels/gb10/qwen3.8-flash-next/nvfp4/qsa_indexer.cu

Main has reworked these areas since this branch was cut: qwen4_exp MTP, the qwen3_attention decode path, MoE forward, QSA, the verify pipeline, and the 500-LoC file-size cap.

  • Gating: after a rebase onto main, I can run the single-GB10 gate on sparky: byte-identical controls on the existing Qwen3.8 deployments, plus agentic-50 and BFCL ST-995 where they apply. Please name the exact checkpoint (HF repo and revision) this PR serves, because sparky doesn't have it cached.

Leaving this open for the author. Please rebase onto main (merge commits are fine) and ping here.

@AzeezIsh

Copy link
Copy Markdown
Contributor

This branch now conflicts with main, which has moved a lot since October (#333's Qwen3.8-27B exact-verify series, #335, #337, #343 and the Ripple series via #334). Could you rebase onto current main? I'll then test it on one GB10 (sparky): turboderp/Qwen3.8-Flash-Next-exl3 decode/MTP speed against the NVFP4 recipe, greedy exactness, and the agentic + BFCL gates.

Integrate upstream QSA, MTP, attention, and scheduler changes, remove overlapping optional optimizations, retain packed trellis/CoopMK MoE and MTP expert loading, and bring EXL3 helper files within the size cap.
@vcruz305 vcruz305 changed the title Qwen3.8-Flash-Next EXL3: Native CoopMK trellis MoE, device QSA, and 262K recipes (M5) Qwen3.8-Flash-Next EXL3: native packed CoopMK MoE on current main (M5) Nov 11, 2026
@vcruz305

vcruz305 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

@AzeezIsh I've merged current main (32fa2a30) into #160 as merge commit e97a57d4; no rebase/force-push. The branch should now be conflict-free.

I narrowed the PR to the native packed-EXL3 MoE/CoopMK path plus packed MTP expert loading and the GB10 recipe. The older grouped-prefill, dense-GEMV, standalone device-QSA, and HC fast-path experiments are no longer part of the PR delta; the current upstream QSA/MTP/verify paths are retained. No new throughput claims.

Local validation: cargo fmt --check, CUDA-feature Rust checks for model/server, and CUDA 13 compilation of exl3_coopmk.cu for sm_121 pass; 141 server library tests and 27 targeted EXL3 model tests pass. Full model suite: 2,431 passed and 13 FFmpeg-video tests failed on this host with FFmpeg 4.4.2 (unsupported CLI option), no EXL3 test failures. Real GB10 runtime and exactness gates remain unverified.

Checkpoint for sparky: turboderp/Qwen3.8-Flash-Next-exl3, revision 3.05bpw_h5_ng5 (please pin the immutable HF SHA for the gate). The minimal serve recipe is in docs/recipes/exl3-qwen4exp-gb10.md.

Would appreciate your single-GB10 EXL3/greedy/MTP smoke and the agentic-50 + BFCL ST-995 gates you offered. Thanks!

CI approval note: The new fork PR workflow runs (including CI and Kernel compile) currently show action_required with zero jobs started. They may require a maintainer to approve running workflows from this fork before the checks can execute.

@github-actions github-actions Bot removed the needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) label Nov 11, 2026
@AzeezIsh
AzeezIsh merged commit 2a60981 into Atlas-Inf:main Nov 13, 2026
17 of 24 checks passed
@AzeezIsh

Copy link
Copy Markdown
Contributor

Merged after testing it on one GB10 (sparky), covering the GB10 items your description lists as pending.

Byte-identical control on the existing deployment (Flash-Next NVFP4): main f04ce4cec vs main + this PR, both qwen3.8-flash-next/nvfp4 builds, same native serve (MTP, 8 seqs), greedy_eq 8 prompts × 320 tokens:

  • C1: 8/8 identical.
  • C8: 6/8. That's within noise: the same main binary against itself is 5/8 at C8 (two runs in one serve and a fresh serve, job 125), because this profile isn't batch-invariant.

Native EXL3 (turboderp/Qwen3.8-Flash-Next-exl3 4.05bpw_h6_ng6 @ 55a732e0), your documented single-GB10 serve (no --speculative):

  • Boots, 0 ERROR lines; greedy run-to-run is 8/8 identical.
  • sq_bench decode: ~16.2 tok/s on code and JSON.
  • agentic-webserver ×10: 10/10, 10/10, but at 117 s/turn (Σwall 18,314 s). That's serial decode on a 4.05 bpw MoE, about 7× slower per turn than the NVFP4 recipe with MTP.
  • BFCL ST-995: not completed. At ~75 samples/h serial it would take ~13 h, so I stopped it at ~180 samples. It's worth running once MTP lands for EXL3 (Qwen3.8-Flash-Next EXL3: MTP + native int8 decode for GDN/attention/lm_head (M6, follow-up to #91) #100).

CI: cargo test, clippy and fmt pass (I approved the fork's workflow runs). The LoC errors are main's existing over-cap files. One new rustdoc error from this PR: [H] at exl3_coopmk_build.rs:245-246 is read as an intra-doc link. #355 escapes it.

Receipts: nq-124-pr160-exl3, nq-125-c8-noise on sparky.

AzeezIsh added a commit that referenced this pull request Nov 13, 2026
…c links

docs: escape the [H] shape brackets #160 left as intra-doc links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants