Skip to content

feat(gb10): add qwen4-27b dense H=5120 target (sm_121) + NVIDIA follow-up checklist - #457

Draft
AzeezIsh wants to merge 1 commit into
feat/qwen4-35b-strix-hipfrom
feat/qwen4-35b-gb10
Draft

AzeezIsh wants to merge 1 commit into
feat/qwen4-35b-strix-hipfrom
feat/qwen4-35b-gb10

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Summary

PR (3/3) in the Qwen4-35B bring-up stack (stacked on #455 → #456), adding the NVIDIA GB10 (sm_121) target for dense qwen4_exp (hidden_size = 5120, hc_dim = 20480, num_experts = 0):

  • Hybrid GB10 kernel shadow (kernels/gb10/qwen4-35b/nvfp4/):
    • Symlinks all non-MoE qwen4_exp kernels (hyper_connection.cu, ple.cu, qsa_*, mxfp8_*, qwen4exp_decode_fuse.cu, qwen4exp_hc_mma.cu, qwen4exp_gdn_prefill.cu, qwen4exp_fp8_gemm.cu, qwen4exp_rows32_tile.cu, qwen4exp_w4_*, qwen4exp_wide_rows.cu, gated_delta_rule*.cu, vision_encoder.cu) from qwen3.8-flash-next/nvfp4/.
    • Symlinks dense-FFN quantized GEMMs (nvfp4_mmq.cu, q4k_mmq.cu, q4k_quantize.cu, q4k_vendor, w4a16_gemm.cu, w4a16_gemm_v2.cu, w4a4_gemm.cu) from qwen3.6-27b/nvfp4/.
    • Omits moe_persist_marker.cu and MoE-only Flash-Next kernels (atlas-kernels lib_tests enforces that only qwen3.8-flash-next ships moe_persist_marker).
  • Target manifest (kernels/gb10/qwen4-35b/MODEL.toml):
    • Binds unique (model_type = "qwen4_exp", hidden_size = 5120) with match_names = ["qwen4-35b", "qwen4-27b"].
    • Declares [expected_absent.moe_persist_marker] plus the combined gb10/qwen3.8-27b + gb10/qwen3.8-flash-next exemptions (including the Strix-only w4a16_gemv_dp4a / w8a16_gemm_n_m128 / w4a16_gemm_t_m128_k16 probes).
  • Resolution & contract tests (crates/atlas-kernels/tests/qwen4_35b_resolution.rs): Extends the resolution and moe_persist_marker pins to gb10.

Earlier Pre-Rebase Synthetic GB10 Baseline (sparky)

Measured on an earlier local prototype (b4f2ec529) using a synthetic 64-layer random BF16 checkpoint (16 full attn + 48 GDN, H = 5120, I = 14336, no PLE) on one GB10 (sparky):

  • Boot: 25–30 s; weights: 47.7 GB (dense BF16 stayed BF16 — only the attention path quantized at load); KV pool: 59.2 GB @ 32K (54.4 GB with MTP-4).
  • Prefill: 8.4K prompt TTFT 14.5 s (~580 tok/s).
  • Decode (no spec): 6.29 tok/s (~45 GB read/tok ≈ 284 GB/s — pure BF16 bandwidth bound).
  • MTP-4 engagement: 14.8 tok/s at tok_step = 4.92 (engagement check only; acceptance on random weights is meaningless).
  • Control: Qwen3.8-Flash-Next FP4-Local was byte-identical to main.

What Still Needs to Be Done for NVIDIA (GB10 / SM121)

  1. Dense FFN quantization (NVFP4 / FP8 checkpoint or quantize-at-load):
    • Plain BF16 dense FFN is ~45 GB/tok (~6.3 tok/s on one GB10). Verify real NVFP4 / FP4-Local / FP8 checkpoints load cleanly through load_dense_ffn (and nvfp4_mmq prefill + w4a16_gemv decode). If an unquantized BF16 checkpoint must be served on one GB10, wire quantize-at-load for the dense FFN path too.
  2. 4H-capable single-pass hc_pre_down decode kernel for hc_dim = 20480:
  3. Verify QHC_PS_DPT = 5u, hc_post_stage_vec, and qwen4exp_hc_mma at H = 5120 on SM121 silicon:
    • Confirm register pressure / occupancy of hc_post_stage_bf16 with QHC_PS_DPT = 5u (ATLAS_QWEN4EXP_PREFILL_HC=1) and hc_post_stage_vec (ATLAS_QWEN4EXP_DECODE_FUSE=1) at H = 5120, and verify Flash-Next (H = 2560) stays bit-identical and regression-free.
  4. QSA tensor-core prefill at kv_heads = 4 (if QSA weights ship):
    • qsa_prefill_attn_tc2 / tc3 require nkv == 2 (qsa_prefill_attn_tc2_ok). At kv_heads = 4, dispatch safely falls back to qsa_prefill_attn (or opt-in ATLAS_QSA_ATTN_TC=1 -> qsa_prefill_attn_tc, which supports arbitrary nkv with gqa <= 32). Benchmark qsa_prefill_attn_tc vs generalizing tc2/tc3 to grid.x = nkv / 2 once real weights arrive.
  5. Lock open day-0 architecture questions against the released config.json:
    • Exact model_type string (and whether dispatch.rs needs a new alias).
    • Layer count and GDN:full ratio (64 assumed) + intermediate_size (14336 vs 17408).
    • Whether QSA indexer and PLE n-gram weights ship in the release (and PLE width / shard layout at H = 5120).
    • Fused QKVZ / BA projection disk layout and MTP head HC stream layout at H = 5120.
    • MTP depth tuning (default_num_drafts vs --num-drafts 4 + ATLAS_QWEN4EXP_MTP_DEPTH=4 on the exact verify lane) + optional gated_delta_rule_snap / gdn_verify_fused_conv_kn_f32 symlinks from qwen3.6-27b/nvfp4/ if --exact-verify is hot.
  6. Real-hardware GB10 compile + closure + gate on sparky:
    • Build ATLAS_MODELS=qwen4-35b on sparky with nvcc (sm_121), run full cargo test -p atlas-kernels -- --ignored (verifying moe_persist_marker by_presence == 1 and exact_verify_snap invariants on compiled PTX), verify zero undeclared boot-audit probes, and run a Flash-Next byte-identity control check.

Stack

  1. feat(qwen4_exp): dense FFN backbone + H=5120 hyper-connection support (Qwen4-27B dense) #455 (feat/qwen4-35b-dense-core → main)
  2. feat(strix-hip): add qwen4-27b dense H=5120 target (gfx1151) #456 (feat/qwen4-35b-strix-hip → feat/qwen4-35b-dense-core)
  3. This PR (feat/qwen4-35b-gb10 → feat/qwen4-35b-strix-hip)

Verification

  • Local (macOS, ATLAS_SKIP_BUILD=1):
    • All 35 symlinks in kernels/gb10/qwen4-35b/nvfp4/ verified live
    • cargo fmt --check — pass
    • cargo test -p atlas-kernels — pass (incl. no_model_shadow_drops_a_common_kernel, qwen4_35b_resolution, target_resolution)
    • cargo clippy -p atlas-kernels --tests -- -D warnings — pass
    • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps -p atlas-kernels — pass
  • Not yet compiled with nvcc or tested on real Qwen4-35B weights in this pass (opened as draft).

@AzeezIsh AzeezIsh changed the title feat(gb10): add qwen4-35b dense target (sm_121) + NVIDIA follow-up checklist feat(gb10): add qwen4-27b dense H=5120 target (sm_121) + NVIDIA follow-up checklist Dec 4, 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant