Skip to content

feat(qwen4_exp): dense FFN backbone + H=5120 hyper-connection support (Qwen4-27B dense) - #455

Draft
AzeezIsh wants to merge 1 commit into
mainfrom
feat/qwen4-35b-dense-core
Draft

AzeezIsh wants to merge 1 commit into
mainfrom
feat/qwen4-35b-dense-core

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Base PR (1/3) in the Qwen4-35B dense qwen4_exp (H = 5120, hc_dim = 20480, num_experts = 0) bring-up stack.

This PR adds the shared engine / weight-loader / hyper-connection plumbing needed for dense qwen4_exp checkpoints while keeping MoE qwen3.8-flash-next (H = 2560) bit-identical:

  • Dense FFN weight loading (qwen4_exp/{mod,ffn,mtp}.rs): Dispatches num_experts == 0 in both trunk layers (ffn::build_ffn) and the MTP layer (mtp.rs) to the shared dense SwiGLU loader (load_dense_ffn / DenseFfnLayer) at intermediate_size, respecting super::mode::weight_quantizer()?.
  • Namespace probe (qwen4_exp/{probe,probe_tests}.rs): Audits dense mlp.gate_proj tensors when num_experts == 0 instead of requiring MoE expert weights, with unit tests covering valid dense layouts and missing-FFN diagnostics.
  • H = 5120 / hc_dim = 20480 hyper-connections (hyper_connection_lowrank_split.rs, qwen4exp_prefill_hc.rs, hyper_connection.cu):
    • Routes hc_pre_split to the 16 KB-tiled hc_pre_down_tiled kernel (bitwise identical) whenever hc_smem = hc_dim * 4 > 48 KB (hc_dim = 20480 → 80 KB), unblocking both Strix Halo (strix-hip) and GB10 (sm_121) decode/prefill.
    • Raises QHC_PS_DPT from 4u to 5u in gb10/qwen3.8-flash-next/nvfp4/hyper_connection.cu and syncs the host guard in qwen4exp_prefill_hc.rs (hidden <= 5120); iterations past H are dead so H <= 4096 is bit-identical.
  • Fault diagnostics (gpu_impl.rs): Includes the kernel name in fault_probe::note_failure on launch error.

Stack

  1. This PR (feat/qwen4-35b-dense-core → main): shared dense qwen4_exp loader + H = 5120 mHC support
  2. feat(strix-hip): add qwen4-27b dense H=5120 target (gfx1151) #456 (feat/qwen4-35b-strix-hip → feat/qwen4-35b-dense-core): Strix Halo (strix-hip / gfx1151) target + dense w4a16_gemm shadow + boot-audit exemptions
  3. feat(gb10): add qwen4-27b dense H=5120 target (sm_121) + NVIDIA follow-up checklist #457 (feat/qwen4-35b-gb10 → feat/qwen4-35b-strix-hip): NVIDIA GB10 (sm_121) target + remaining NVIDIA work items

Verification

  • Local (macOS, ATLAS_SKIP_BUILD=1):
    • cargo fmt --check — pass
    • cargo clippy -p spark-model -p spark-runtime -p atlas-kernels --tests -- -D warnings — pass
    • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps -p spark-model -p spark-runtime -p atlas-kernels — pass
    • cargo test -p atlas-kernels — pass (all non-nvcc tests green)
    • All modified .rs files checked against the 500-LoC cap (gpu_impl.rs net -3 lines).
  • Not yet tested on real Qwen4-35B weights or live GPU in this pass (opened as draft). Earlier pre-rebase prototype on a synthetic 64-layer BF16 H=5120, I=14336 checkpoint booted and served on sparky (GB10) with byte-identical Flash-Next FP4-Local control.

@AzeezIsh AzeezIsh changed the title feat(qwen4_exp): dense FFN backbone + H=5120 hyper-connection support (Qwen4-35B) feat(qwen4_exp): dense FFN backbone + H=5120 hyper-connection support (Qwen4-27B dense) 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