Repository navigation
ricursive-ripple-65b: Strix Halo (gfx1151) support with DFlash2, on #328 - #334
Merged
Merged
Conversation
The DFlash2 grouped dynamic causal conv hard-coded two taps in the kernel (delta row stride, output-side offsets) and in its Rust callers, while Ricursive's Ripple-65B DFlash2 drafter ships conv_kernel_size 4 (base_kernel [2, 4, 5120], kernel_projection [2560, 5120]). A 4-tap checkpoint would have run with the wrong coefficients and no error. - dflash2_conv.cu (gb10 + strix-hip): sum `taps` taps (new kernel arg), tap 0 first, so a 2-tap launch computes the expression it did before. - The loader derives (kernel_size, group_size) from the tensor shapes and fails when dflash_config.conv_kernel_size / conv_group_size disagree; from_weights sizes the delta scratch from that geometry instead of the `unwrap_or(16)` / `unwrap_or(2)` / `4 * hidden / 16` defaults, and fails when convs ship but the target has no dflash2_conv kernel. - Dflash2Conv owns the delta-row layout (delta_row_elems, output_delta_offset) for every caller. GPU test (ennspark03, qwen3.8-27b build): dflash2_conv_taps matches a host replica of SGLang's _grouped_conv bit for bit at 4 taps (gamma 16, 32) and 2 taps (gamma 8). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The on-device DFlash2 candidate selector caps top_k at 16 at compile time (per-warp candidate scoring, shared lists); Ripple-65B's DFlash2 drafter ships selector_top_k 32, which Dflash2CandidateSelector::new refused. - dflash2_candidate_selector_k32.cu: the common selector body under _k32 entry names with DF2_SEL_MAX_TOP_K 32, 1024 threads (one warp a candidate), launch bounds for the 64-register budget, a 1024-entry pool for the overflow path's 32 x 32 warp lists, and 8 staged walk rows to stay under 48 KB of static shared memory. No batched entry at this cap. - The common file only gains #ifndef guards, an empty launch-bounds hook and a pool-size static_assert: its PTX is byte-identical to main's (nvcc sm_121, checked on ennspark03), so every 16-candidate drafter launches exactly what it did. - ops::dflash2_selector_build picks module, entry and block size from one top_k; scratch is sized for the widest selector; the rank-split walk and the batched entry refuse top_k > 16 instead of returning unwritten. GPU test (ennspark03): dflash2_selector_parity, host reference = SGLang 0.5.19 CandidateSelector greedy walk, passes at Ripple's geometry (vocab 100352, rank 256, top_k 32, gamma 32 and 16), top_k 20 / gamma 13 and the overflow path (gamma 8, 688-column slices), plus the existing top_k 16/4 cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ripple-65B's DFlash2 drafter declares layer_types [sliding x4, full_attention] with sliding_window 4096 and no_rope_layers [4]; Ricursive serves it (SGLang 0.5.19 + their patch) with RoPE skipped on layer 4 and a 16384-token draft window so the global layer sees its training rows. Atlas applied one window to every layer (use_sliding_window: true made it 4096 everywhere) and RoPE to every layer. - DflashConfig: mixed_layer_windows() (per-layer HF window, fails on an unknown type, a short list or a missing window), rope_layers() from no_rope_layers (fails on out-of-range or repeated indices); a mixed layout has no single sliding_window(). - DflashLayer carries `rope` and `attn_window`. Every attention launch (contiguous, paged, indirect, batched) takes layer_attn_window(layer): the layer's own window on sliding layers of a mixed drafter, else the head-wide window as before. The kernels mask in KV-slot space, so this is SGLang's per-query window over the compacted context. - RoPE goes through layer_rope(); the fused ctx-K RoPE in precompute runs once per run of RoPE layers (one launch when there is no NoPE layer). - resolve_context_window: a mixed drafter takes --dflash-window-size as its global draft window (SGLang's --speculative-draft-window-size); it must exceed every sliding window (the 4096 CLI default fails fast) and sizes the ctx scratch unless ATLAS_DFLASH_CTX_WINDOW is larger. Uniform drafters keep their resolution (4096 scratch default, CLI window or the checkpoint's). Unit tests: Ripple / GLM-5.3 / Qwen3.8 config resolution, malformed declarations, rope runs, window resolution. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…residuals) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ursive Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…layer windows/NoPE Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ut norms) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…amma 32 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nclamped kernel Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-M W4A4 GEMV Co-Authored-By: Claude Opus 5.5 <[email protected]>
… strided Q/K norm Co-Authored-By: Claude Opus 5.5 <[email protected]>
…EL.toml for W4A4 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… on the verify GEMVs Co-Authored-By: Claude Opus 5.5 <[email protected]>
…); fused q|gate split store Co-Authored-By: Claude Opus 5.5 <[email protected]>
…GB/s on GB10) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…checkpoint and reference engine Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fy rows Co-Authored-By: Claude Opus 5.5 <[email protected]>
…m32 for PDL Co-Authored-By: Claude Opus 5.5 <[email protected]>
- FFN prefill on CUTLASS SM120 block-scaled NVFP4 (new pre-quantized entry point): activations quantized at the checkpoint input_scale with flashinfer's arithmetic, weight SFBs packed once at load, the clamped SwiGLU fused into the down input's quantization, persistent-scheduler swizzle (down 92 -> 215 TFLOPS, gate/up 234 -> 309). Shared CUTLASS NVFP4 types moved to a header. - dense_gemm_bf16_pipelined takes the tuned CUTLASS BF16 tiles at large M under ATLAS_BF16_GEMM_CUTLASS (bit-identical; 57 -> 93 TFLOPS on Ripple's attention projections). - rope_forward_rows: rope_forward with each block covering 16 position groups, amortizing the per-block FP64 frequencies (714 -> 92 ms per 6.6K prefill); ops::rope prefers it where the target ships it. OpCache::kernel_or_null. - Review fixes: value residuals require dense BF16 Q/K/V at install (covers every quantized-V arm); drop the PeriNorm gate's redundant re-check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ector_top_k 32) Same module/symbol names as kernels/gb10/common/dflash2_candidate_selector_k32.cu, which dflash2_selector_build routes top_k 17..32 to. K=32 per-thread register lists spill on gfx1151, so the twin takes the round top-K form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…DIM=128, portable Ripple overlay) The gb10 target's portable kernels verbatim: embed_scale, value_residual, ricursive_swiglu, rms_norm_vanilla_strided, ricursive_verify_attn. gamma 16. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, soft bf16_gemv_m32, small-M FFN off gfx1151 has no FP4 MMA and the strix tree ships neither the W4A4 multi-row FFN nor the cp.async m32 GEMVs. On HIP the loader builds transposed FFN twins (m128 GEMM) and skips enable_w4a4_rows; a missing bf16_gemv_m32 sends verify projections to the BF16 GEMM. Small-M FFN dispatch defaults off for Ripple on HIP: m128 is 1.5-2.4x faster and bit-identical at its verify shapes (kbench 42541712895, e2e f243 +5% DFlash2, greedy identical). GB10 is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…3.8-27b expected_absent tables (same tree) The boot audit fails closed on unresolved lookups, so the absent cp.async GEMV is skipped rather than probed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rows (ATLAS_FFN_ROWGEMV=1)
w4a16_rowgemv_m{9,17} on the transposed NVFP4 layout: each weight dequantized
once (m128's exact decode) and applied to every row; 4 waves split K in-block
with a fixed LDS reduction, a deterministic block split-K (fp32 workspace +
ordered reduce) for N < 16384. gfx1151 kbench 42721529794 vs w4a16_gemm_t_m128:
Ripple M=17 gate/up 2098 -> 1379 us, down 2041 -> 1420; Qwen3.8-27B M=9
gate/up 1003 -> 329, down 865 -> 330. NOT bit-identical (fp32 order, relL2
1.5e-4..6.5e-4), so opt-in until an accuracy gate passes; the lookup is only
issued on HIP with the lever set (fail-closed boot audit elsewhere).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…TLASS builds swizzle()/check() are only called under cfg(atlas_cutlass); the strix-hip build (-D warnings) failed on them as dead code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…EMVs expected-absent Co-Authored-By: Claude Opus 5.5 <[email protected]>
…reak) kbench 42729349013 vs the shipped m128_f16a: Ripple M=17 gate/up 1881->1161 us, down 2463->1229; production instantiation was 3.93 ms/call in rocprof (f249), consistent with the data-dependent break spilling acc[][]. Co-Authored-By: Claude Opus 5.5 <[email protected]>
pdl.rs: keep both new PDL targets (ricursive-ripple-65b, qwen3.8-27b). Co-Authored-By: Claude Opus 5.5 <[email protected]>
pdl.rs: the Ripple PDL target moves to the per-target switch list. dflash_head / dflash_loader / ops: keep both module sets (DSpine + Ripple conv, tree_verify + verify_rows). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…KV budget #333 gave γ 9..16 the w4a16_gemv_batch16 tier and builds the drafter before the KV budget, so Ripple-65B's DFlash2 drafter (γ=16) now quantizes 7 GEMMs x 5 layers (~2.1 GB) beside its BF16 weights. On a 96 GB gfx1151 box Ripple leaves ~1.5 GB pre-KV and the boot fails (framework f251/f252: cuMemAlloc 0.0 MB free). Skip with a warning when free memory would drop under a 2 GB floor; the drafter keeps its BF16 arms, as it did before #333. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…atched-GEMV tiers; on for Ripple strix-hip Since #333 the DFlash drafter is built before the KV budget. Ripple-65B's drafter is 7.5 GB BF16, and on a 96 GB gfx1151 box that leaves 0.1 GB of KV (256 tokens; framework f256) where pre-merge had 0.8 GB (the drafter then loaded into the post-KV growth reserve). ATLAS_DFLASH_DROP_BF16 already frees q/o/gate/up/down after NVFP4 quantization, but only with the tensor-core tiers. At gamma <= 16 and batch 1 every drafter pass is <= 16 rows, which the w4a16_gemv_batch16 tier serves from the same twins, so allow the preshrink there too. A target opts in with [dflash].drop_bf16; the server applies it only at max_batch_size x gamma <= 16, and the env var still overrides. A dropped projection reaching a BF16 GEMM fails loudly (small_m_gemm::ensure_bf16_present). The NVFP4 install guard no longer skips when the twins were parked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
framework f257 (rocprof, Ripple-65B + DFlash2, 906273b): w4a16_rowgemv_m17 0.97 ms/call vs w4a16_gemm_t_m128_f16a 1.59 ms; fib request 7.1/7.5 s vs 9.6/9.6 s; greedy output md5 identical. Resolved by the Ripple FFN layers only (other HIP targets never issue the lookup); ATLAS_FFN_ROWGEMV=0 opts out. The Ripple ST-995 gate runs with it on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he strix-hip selector blob kernel_shadow_detector: #328's common/rope.cu rope_forward_rows is the rotate_half convention Mistral's interleaved shadow deliberately lacks; ops::rope looks it up with kernel_or_null and falls back to rope_forward. dflash2_selector_abi: b75da4a (#329, exact round top-K, qualified by the Qwen3.8-27B ST-995 gate) changed the pinned strix-hip selector without updating the hash, so main fails this test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ripple compiles laguna-s-2.1's sources with its own nvfp4/ overlaid (build.rs: target-local > kernel_source > common); the test only scanned the borrowed dir, so Ripple's bf16_gemv_m32 looked undefined. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fers it off) Reverts b3160b4. Framework ST-995 (BFCL golden draw, n=995, seed 42, temp 0) on the same head, Ripple-65B NVFP4 + DFlash2: f260 row-GEMV on (default): overall 76.38 / normalized 79.55 f263 row-GEMV off (ATLAS_FFN_ROWGEMV=0): overall 77.29 / normalized 80.87 f244 old branch, reference: overall 77.49 / normalized 78.47 Off is the build that matches the reference, so it ships off; ATLAS_FFN_ROWGEMV=1 still turns it on (verify ~25% faster on fib, f257). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
AMD accuracy gate (framework, Strix Halo / gfx1151): ST-995 (BFCL golden draw, n=995, seed 42, temp 0), Ripple-65B NVFP4 + DFlash2:
The row-GEMV is the only output-changing difference between f260 and f263, and the build with it off matches the reference. So 37dfd64 reverts the Ripple default back to opt-in ( 🤖 Generated with Claude Code |
dflash2_selector_abi.rs: both sides pin the same strix-hip blob (315dab4d); kept main's comment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AzeezIsh
marked this pull request as ready for review
November 10, 2026 19:34
3 tasks done
AzeezIsh
added a commit
that referenced
this pull request
Nov 10, 2026
…rms run current main Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 10, 2026
maplepaladin73
pushed a commit
to maplepaladin73/atlas
that referenced
this pull request
Nov 11, 2026
…ets boot Main (4e239ae, Merge Atlas-Inf#334) carries Atlas-Inf#328's Ripple commits, whose shared DFlash head and attention init issue plain try_kernel lookups of kernels that compile only into the ricursive-ripple-65b target: bf16_gemv_m32, fp8_gemv_m32 (dflash_head/from_weights.rs) and rms_norm_vanilla_strided (qwen3_attention/init.rs). Every non-ricursive target that reaches those constructors then fails the boot kernel-audit with unresolved lookups — confirmed on the 4e239ae build: 2 unresolved for (qwen3.8-27b, sm_121, nvfp4). Affected: every DFlash target but ricursive (qwen3.8-27b, qwen3.6-27b, qwen3.6-35b-a3b, holo-3.1-35b-a3b, longcat-flash-lite, nemotron-3.5-*) plus every vanilla-norm attention model for the strided arm. Gate the lookups on model identity with try_kernel_gated, so the lookup is never issued where the kernel cannot exist: a lookup that is never issued leaves no failed row in the boot audit (kernel_pick.rs contract). Handle 0 keeps the existing fallbacks (per-row Q/K-norm loop; small-M GEMV pipelined tier; fp8_m32 only activates under ATLAS_DFLASH_DRAFTER_FP8_M32=1, which is a ricursive lever). Verified on GB10: qwen3.8-27b + DFlash2 boots to /health and serves chat (was refused at audit); ricursive-ripple-65b boots and still builds its 37 FP8 GEMV mirrors. fmt/clippy/dflash_head(197)/pdl(6) clean. Generated-with: Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ripple-65B (ricursiveAI/Ripple-65B-Preview, NVFP4) with DFlash2 on Strix Halo (gfx1151), built on #328's GB10 Ripple "Strict" support. This branch contains #328's commits plus the AMD side; it supersedes nothing in #328 and should land with or after it.
AMD side (8 commits)
kernels/strix-hip/ricursive-ripple-65bon the qwen3.6-27b gfx1151 tree:-DHDIM=128, the portable Ripple overlay kernels (embed_scale, ricursive_swiglu, value_residual, rms_norm_vanilla_strided, ricursive_verify_attn), DFlash gamma 16, the qwen3.8-27b expected_absent tables.dflash2_candidate_selector_k32twin for Ripple's selector_top_k 32.bf16_gemv_m32: multi-row FFN passes run W4A16 on transposed twins (w4a16_gemm_t_m128_f16a) instead of W4A4 rows, and verify-row q/k/v use the BF16 GEMM. These arecfg!(atlas_hip)arms; the GB10 path is unchanged.cutlass/prequant.rs: allow the CUTLASS-only helpers to be dead on non-CUTLASS builds (ricursive: Ripple-65B Preview, Strict, single Spark (prefill +49%, DFlash2 decode +7% vs SGLang) #328 fails-D warningson HIP without this).w4a16_rowgemv_m{9,17}) for the M=17 verify-row FFN, default on for Ripple strix-hip only (ATLAS_FFN_ROWGEMV=0opts out; opt-in elsewhere): 0.97 vs 1.59 ms/call againstm128_f16a, fib request 7.3 vs 9.6 s, greedy identical (framework f257).[dflash].drop_bf16(on for strix-hip Ripple, applied only at max_batch_size x γ <= 16) runs the existingATLAS_DFLASH_DROP_BF16preshrink on the batched-GEMV tier: 6.84 GiB freed, KV 6640 tokens (pre-merge 2496), drafter on NVFP4 (+15% fib tok/s).Verification (framework, gfx1151 Linux; DevLab strix runner)
job=build: green on the merged head (42740899881) and on b3160b4 (42756988525).🤖 Generated with Claude Code