Skip to content

HIP RDNA2: dense prefill projections on GemmEx - #235

Merged
Vasyl-Trefilov merged 16 commits into
RustingStudio:mainfrom
I-AM-ENGINEER:hip-rdna2-dense
Dec 6, 2026
Merged

Vasyl-Trefilov merged 16 commits into
RustingStudio:mainfrom
I-AM-ENGINEER:hip-rdna2-dense

Conversation

@I-AM-ENGINEER

@I-AM-ENGINEER I-AM-ENGINEER commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #233 (MoE), #232 (attention) and #231 (gfx10).

What

The dense prefill GEMMs (mixer qkv/o, the SSM projections, a dense FFN where the model has one) run on hipBLAS's GemmEx: the matrix dequantizes to f16 once per call, the x block converts to f16, the product runs with an f16 store (the f32 store of the same call is a third of the throughput on RDNA2), and blas_scatter_d writes the result to y with the activation (silu-mul or add). Matrices of 4096 rows or more process 4096 tokens a step: the 8192-wide Tensile kernel of a 4096 x 2048 matrix costs what two halves do.

  • A dense GEMM below 512 tokens stays on the dot2 kernel (dequantizing the whole matrix does not pay there); STRATA_HIP_DENSE=0 disables the path.
  • A failure at runtime is logged once and hands the rest of the run to the dot2 kernel (DENSE_FALLBACK), so a bad shape costs a warning, not a request.
  • Same gate as the rest of the series: RDNA2 only by default, STRATA_HIPBLAS=1/0 overrides on any HIP card, except for a weight type the backend's int8_gemm takes (an int8 WMMA card keeps those on gemm_raw). CUDA and Vulkan are untouched: this is the HIP backend's own gemm_dense override.

Series numbers

All four RDNA2 PRs together, Qwen4-35B-A3B-Uncensored Q4_K_M on an RX 6800 XT (16 GB), ctx 65536, kv q8, a fresh prefix each run (only the 13-token template prefix is cached, so every prompt is fully prefilled):

prompt upstream + gfx10 series, chunk 8192 series, chunk 2048 series decode (chunk 2048)
4K (4.2k tokens) 494 667 719 (1.5x) 60.6
8K (8.4k tokens) - 785 852 59.5
16K (16.8k tokens) 239 1107 848 (3.5x) 60.1
32K (33.4k tokens) 134 542 554 (4.1x) 58.4

Prefill and decode in tok/s. chunk 8192 ran with --vram-margin 1536 (5210 of 10240 expert slots on the card, 14.6 GB resident), chunk 2048 with --vram-margin 1600 (6000 slots, 14.6 GB); decode at chunk 8192 was 47-52 tok/s. The baseline column is upstream main + #231 at its own defaults (chunk 8192, 15 GB budget, 3.7k / 14.8k / 29.7k-token prompts of the same generator, so the ratios are against slightly shorter prompts); its decode was not measured in that sweep. Per-PR splits were not measured - the four PRs were benchmarked as one.

Chunk size trades experts for scratch: the prefill slab holds chunk rows of every scratch region (276 KB a token), so 8192 costs 2214 MB and 2048 costs 624 MB, and the freed space becomes expert slots. 8192 prefills faster, 2048 decodes ~20% faster (the same prompts on both).

Long prompts stay slower than short ones because the attention of a chunk is dense over the whole prefix: the QSA mask masks the scores, it does not skip the work, so prefill falls roughly as 1/depth. With chunk 8192 and a 15 GB budget the 8192-token chunks of a 64k prompt ran at ~1100 tok/s at an 8k prefix, ~1000 at 16k, ~600 at 24k, ~300 at 32k and ~150 at 64k. A 132k-context setting keeps 4750 slots instead of 5210 and prefills a 33k prompt at ~440 tok/s.

Verified

  • 700-token multi-topic probe: 4 of 4 planted facts; the server log shows no kernel fallbacks (dequant_h/x_gather_*/blas_scatter_d all resolve).
  • 5.7k decoy recall: 3 of 3 needles on 3 runs, matching llama.cpp (with HIP RDNA2: prefill attention on hipBLAS #232's att_exp fix; with the earlier exp(x)+1 it lost a needle).
  • cargo test --release --lib: green (kernel_names 477/405/453 with x_to_h and blas_scatter_d).

Tooling note

The diagnosis, the patch and the verification runs above were prepared with the help of the deepseek-v4.1-flash-1017 model.

@aletheore

aletheore Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

🔍 Aletheore evidence diff

graph LR
    n0["src/backend.rs"]
    n1["src/cuda/mod.rs"]
    n2["prefill.rs"]
    n3["src/hip/mod.rs"]
    n4["cpu_worker.rs"]
    n5["src/cuda/host_share.rs"]
    n6["chat.rs"]
    n7["mat.rs"]
    n8["expert_cache.rs"]
    n9["src/gpu_model.rs"]
    n10["src/gpu_model/host_share.rs"]
    n11["dspark.rs"]
    n12["forward.rs"]
    n13["device.rs"]
    n14["pool.rs"]
    n15["worker.rs"]
    n16["lib.rs"]
    n17["main.rs"]
    n18["model.rs"]
    n19["projector.rs"]
    n20["src/vulkan/mod.rs"]
    n21["preflight.rs"]
    n22["tests/backend.rs"]
    n23["tests/common/mod.rs"]
    n24["tests/gpu_model.rs"]
    n25["inkling2_attn_kv.rs"]
    n26["inkling2_q8_attention.rs"]
    n27["kernels.rs"]
    n28["kv_q8.rs"]
    n29["kv_turbo.rs"]
    n30["llama_numerics.rs"]
    n31["tq_probe.rs"]
    n32["vision_gpu.rs"]
    n33["vulkan_split_kv.rs"]
    n0 --> n4
    n0 --> n7
    n0 --> n8
    n0 --> n9
    n0 --> n10
    n0 --> n11
    n0 --> n12
    n0 --> n13
    n0 --> n14
    n0 --> n15
    n0 --> n16
    n0 --> n17
    n0 --> n18
    n0 --> n19
    n0 --> n20
    n0 --> n22
    n0 --> n23
    n0 --> n24
    n0 --> n25
    n0 --> n26
    n0 --> n27
    n0 --> n28
    n0 --> n29
    n0 --> n30
    n0 --> n31
    n0 --> n32
    n0 --> n33
    n1 --> n5
    n1 --> n6
    n1 --> n13
    n1 --> n16
    n1 --> n17
    n1 --> n20
    n1 --> n21
    n1 --> n23
    n1 --> n24
    n1 --> n25
    n1 --> n28
    n1 --> n29
    n1 --> n30
    n1 --> n33
    n2 --> n9
    n3 --> n16
    n3 --> n23
    classDef changed fill:#d9772c,color:#fff,stroke:#b85f1c;
    classDef changedFinding fill:#c0392b,color:#fff,stroke:#922b21;
    classDef dependent fill:#f2f0ec,color:#18140f,stroke:#d6d0c5;
    class n0 changed
    class n1 changed
    class n2 changed
    class n3 changed
    class n4 dependent
    class n5 dependent
    class n6 dependent
    class n7 dependent
    class n8 dependent
    class n9 dependent
    class n10 dependent
    class n11 dependent
    class n12 dependent
    class n13 dependent
    class n14 dependent
    class n15 dependent
    class n16 dependent
    class n17 dependent
    class n18 dependent
    class n19 dependent
    class n20 dependent
    class n21 dependent
    class n22 dependent
    class n23 dependent
    class n24 dependent
    class n25 dependent
    class n26 dependent
    class n27 dependent
    class n28 dependent
    class n29 dependent
    class n30 dependent
    class n31 dependent
    class n32 dependent
    class n33 dependent
Loading

What changed
Deterministic, computed from this commit's real scan and import graph - posted on every run, whether or not Flash Review found anything.

  • src/backend.rs · modified · +9/-0 · +2 functions · 27 other dependents
  • src/cuda/kernels.cu · modified · +202/-0
  • src/cuda/mod.rs · modified · +5/-4 · 14 other dependents
  • src/gpu_model/prefill.rs · modified · +8/-4 · 1 other dependent
  • src/hip/ffi.rs · modified · +118/-1 · +7 functions, +1 class
  • src/hip/mod.rs · modified · +336/-2 · +10 functions · 2 other dependents

Aggregate deltas

  • Modules: +0
  • Dependency graph edges: +0
  • Commits: 11

Comment thread src/cuda/kernels.cu Resolved
Comment thread src/hip/mod.rs Resolved
Comment thread src/hip/mod.rs Resolved
Comment thread src/hip/mod.rs Resolved
@aletheore

aletheore Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Aletheore Flash Lite review

What this PR does. The pull request adds a gemm_grouped backend method and routes MoE gate, up, and down projections in prefill through it instead of individual gemm calls. On HIP it implements that path with hipBLAS GemmEx and strided batched GemmEx, dequantizing weights to fp16, gathering inputs, and scattering results with activation handling, including a dense prefill helper. It also adds supporting CUDA kernels for dequantization, gathering, and scattering and registers them in the kernel list.

Merge confidence Review effort Merge risk
3 / 5 3 / 5 Medium
Area Files Lines
src/cuda 2 +86 −5
src/hip 2 +275 −4
src 1 +4 −0
src/gpu_model 1 +3 −3

1 finding(s) posted as inline review comment(s). 1 earlier finding(s) no longer detected in this push.

# Severity Category Where
1 🟠 High Correctness mod.rs:240 Partial-write detection misses failures inside the first expert/round, so fallback re-applies non-idempotent…
Review details

Reviewed 6 file(s); skipped 0. Dismissed 0; outside PR diff 0. Grounding: 10 of 10 proposed finding(s).

Fix all with your agent
File: src/hip/mod.rs
Line: 240
Symbol: gemm_grouped_blas
Issue: Partial-write detection misses failures inside the first expert/round, so fallback re-applies non-idempotent activation to mutated y In gemm_grouped_blas and moe_rounds, MOE_PARTIAL is only set when i>0; if the first expert/round's gemm/splitk/scatter has already written y (act=1 silu-mul or act=2 add, both non-idempotent) and then errors, gemm_grouped treats it as non-partial and reruns dot2 on the same y, applying silu(y)*v or y+v a second time to already-mutated values and producing wrong output instead of returning Err.
Make the smallest change that fixes this, add a test, and change nothing unrelated.
Blast radius: 79 other file(s) depend on what this PR changes (30 directly, 49 indirectly)

Computed from the import graph of this exact commit, not guessed by a model. It sees imports only, so dynamic imports, reflection and non-code references are not counted.

  • src/backend.rs is imported by src/cpu_worker.rs, src/deepseek/mat.rs, src/expert_cache.rs, src/gpu_model.rs (+23 more)
  • src/cuda/mod.rs is imported by src/cuda/host_share.rs, src/deepseek/chat.rs, src/inkling2/forward/device.rs, src/lib.rs (+10 more)
  • src/hip/mod.rs is imported by src/lib.rs, tests/common/mod.rs
  • src/gpu_model/prefill.rs is imported by src/gpu_model.rs

Indirectly affected: examples/dotn_bench.rs, examples/ds_cpu_bench.rs, examples/moe_cpu_layer_bench.rs, src/calibrate.rs, src/cpu_moe.rs, src/deepseek/forward.rs (+43 more)

The graph is large; this list is capped and not exhaustive.

@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Checked all four:

  1. kv_to_h hd/8 vs n/8 - not a bug: hd in ldkv is not a stride, it is the head width the quantized cache is laid out by (off % hd, off / hd * (hd/2 + hd/16) in the turbo modes, and the same per-head block shape for the others). kv_to_h walks hd-sized blocks in linear order, so off = (i / (hd/8)) * hd + (i % (hd/8)) * 8 enumerates all rows * n / 8 chunks - for n = nkv * hd that is every (row, head) pair in sequence, no head wraps another. The QK GEMM then reads k16 + head * hd with lda = n, the flattened layout. Evidence: this model (nkv = 2) passes the 5.9k-token dialogue probe and the 5.7k decoy recall; a per-head mix-up would destroy the output.

  2. gemm_dense partial activation - real, fixed: a failure in any chunk after the first sets DENSE_PARTIAL; gemm_dense then returns the error instead of re-running gemm_raw over y that already holds chunk 0's silu/add, and the flag keeps later calls on the dot2 kernel. A first-chunk failure still falls back safely (nothing written yet).

  3. moe_idx host mailbox without a fence - no change: the index words are written to mapped pinned memory, and the launch that follows orders them before any device read (the launch is a full barrier for the device; this is the same pinned-index pattern llama.cpp and the engine's own staging use). The slot ring already syncs before a slot is rewritten.

  4. gemm_dense_blas unbounded step - real, fixed: step is capped by BLAS_W_BYTES / (2 * max(rows, cols)) so the f16 activation scratch stays under 384 MiB, and the path is skipped entirely when the dequantized weight copy (rows * cols * 2) would exceed the same budget - the grouped path's guard, now applied here too.

Comment thread src/hip/mod.rs Resolved
Comment thread src/hip/mod.rs Resolved
Comment thread src/hip/mod.rs Resolved
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Three more, checked:

  1. act & 3 remaps values outside 0..=2 - fixed: the gate now requires every bit to be a known one: (act & 3) <= 2 && act & !(3 | SAME_X | MOE_GATE_X) == 0. A caller asking for any other activation (or a negative act) takes the dot2 path with the full act, exactly as before this path existed.

  2. y_stride >= rows not checked - fixed: added to the gate. blas_scatter_d writes d in 0..rows into a row y_stride floats farther on, so a smaller y_stride would overlap neighbouring rows.

  3. step_cap derived from BLAS_W_BYTES, not from the buffers' sizes - no change needed: blas_buf grows the buffer to the requested size before returning ("reallocated when a call needs more than the cached one holds"), so x16/c16 always fit what the step asks; BLAS_W_BYTES is the budget of how much scratch this path may keep, not a capacity bound. The weight copy - the one allocation that is not chunked - is gated separately by rows * cols * 2 <= BLAS_W_BYTES (now in gemm_dense's take condition), matching the grouped path.

Smoke on the updated head: the 700-token probe answers 4 of 4 planted facts, no is not loaded line.

Comment thread src/hip/mod.rs Resolved
Comment thread src/hip/mod.rs Resolved
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Two more, both checked:

  1. MOE_GATE_X/SAME_X stripped before the dense path - not a semantic change on this backend: MOE_GATE_X is read only by the CUDA dot2 launcher (let moe_gate = act & MOE_GATE_X != 0; in cuda/mod.rs). The HIP backend's own gemm already masks the same bits away - let (same, act) = (act & SAME_X != 0, act & 3); (hip/mod.rs:546) - so on HIP the dot2 path and the dense library path both act on act & 3 and ignore SAME_X/MOE_GATE_X identically. (That is also why the fused gate is silent here: the up GEMM's act & 3 == 1 is the silu-mul, the gate GEMM stores.)
    The gate check stays strict about unknown bits, so nothing outside {3, SAME_X, MOE_GATE_X} is ever remapped.

  2. DENSE_PARTIAL/DENSE_FALLBACK process-global, never reset - that is the pre-existing policy of this path, not something the partial check introduced: DENSE_FALLBACK already latches for the whole process on the first error ("the dot2 kernel takes over for good", hip/mod.rs around the gemm_dense dispatch). DENSE_PARTIAL follows the same rule for the case where y already holds partial results - re-enabling per shape would re-run the exact scenario that silently corrupted y (double silu/add). A per-shape retry map is a separate design question; this PR keeps the existing latch semantics.

No code change for either.

@Vasyl-Trefilov

Copy link
Copy Markdown
Member

Hi, ty, this one looks fine on its own, it just needs 232 and 233 fixed first bc of the CUDA build break.

I-AM-ENGINEER and others added 9 commits December 6, 2026 03:39
RDNA2 has no matrix cores: the flash prefill kernel and the dot2 GEMMs run
at 0.5-12 TFLOPS, and as the context grows the attention of a prefill chunk
dominates its time. This runs the attention of a chunk on the library's
Tensile kernels instead (hipBLAS, fp16 in, f16 scores, f32 out):

- ffi: GemmEx and GemmEx_v2 bindings (the legacy entry takes
  hipblasDatatype_t, the _v2 entry hipDataType; C = x W^T needs OP_N for B).
- hip: attn_prefill_blas - K/V and Q as f16, Q K^T a head into an f16 score
  block, a wave-a-row softmax with the QSA mask, P V a head straight into
  out, then 1/sum and the query gate applied in att_scale. Past 32k keys, or
  on a chunk the kernels do not cover, the flash kernel keeps running
  (attn_prefill_m_at falls through to attn_prefill_m).
- On by default for RDNA2 only (gfx103*); STRATA_HIPBLAS=1 turns the
  library path on on any HIP card, =0 off anywhere.
- kernels.cu: kv_to_h, q_to_h, att_softmax, att_scale, and att_exp for
  RDNA2's v_exp_f32. The CUDA build compiles them and never launches them.

Verified on Qwen4-35B-A3B Q4_K_M, RX 6800 XT (gfx1030): a 5.9k-token
multi-topic dialogue answers all four planted facts; a 5.7k decoy recall
matches llama.cpp. Series numbers (all four RDNA2 PRs): warm prefill
4K 494 -> 1007, 16K 239 -> 1264, 32K 134 -> 1052 tok/s.
…ange

The raw NUL byte made git treat the file as binary, so it was committed with CRLF
and every later diff of it showed the whole file. ASCII again, LF like the rest of
the tree.
The MoE of a prefill chunk hits hipBLAS through gemm_grouped: the experts of
a call dequantize to f16, their x rows gather as f16, and the products run
as strided-batched GemmEx (fp16 in/out, f32 accumulate). The per-expert
shapes here are small (512x2048), where one GEMM an expert costs more in
rocBLAS host time than the products themselves - a whole round runs with
one call.

- The slots of a call split into items of the sizes Tensile runs fast on
  this silicon (a cost table per shape; the sizes at which the same GEMM
  costs 4-8x more are avoided), the cheapest cover picked by a small DP
  over slot counts.
- A round dequants and gathers in one launch each, runs one batched GEMM,
  and scatters the f16 results into y with the activation (blas_scatter); a
  call's lone expert keeps a single act-fused GEMM through gemm_splitk_sum.
- STRATA_MOE_BATCH=0 puts every expert back on its own GEMM;
  STRATA_MOE_STATS prints the slot counts of the first calls.
- Same gate as the attention (one Blas handle): RDNA2 only by default,
  STRATA_HIPBLAS=1/0 overrides. CUDA and Vulkan take the trait's default,
  which forwards gemm_grouped to gemm with the same tile count.

Verified on Qwen4-35B-A3B Q4_K_M, RX 6800 XT: the 700-token probe answers
all four planted facts (34.7 tok/s decode); the 5.9k dialogue and 5.7k
decoy recall match llama.cpp. Series numbers (all four RDNA2 PRs): warm
prefill 4K 494 -> 1007, 16K 239 -> 1264, 32K 134 -> 1052 tok/s.
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Rebased on the fixed #233. The only change needed here is x_to_h taking u16* for the CUDA build - its stores already go through h2pack, so they keep the f16 bits.

Smoke (gfx1030, mainline + #232 + #233 + this PR): a 6k-token recall probe answers its four planted facts at 524 tok/s, a 33k-token one at 849 tok/s, no kernel fallbacks in the log.

Comment thread src/hip/mod.rs Resolved
Comment thread src/hip/mod.rs Resolved
…l latch per call

host_mailbox counts u32 words, so WORDS * SLOTS u64 slots need twice the words;
the slot writes ran past the pinned allocation. MOE_PARTIAL now starts false on
every gemm_grouped call, so a later failure that wrote no y still falls back to
the dot2 kernel instead of aborting.
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Rebased on the fixed #233. Two changes here:

  • gemm_grouped takes the stride gate gemm_dense has: x_stride % 4, y_stride % 4, x_stride >= cols, y_stride >= rows. x_gather_hg reads x a float4 at a time and blas_scatter writes y + (m0 + r) * y_stride + d, so a stride that is not a multiple of 4, or one shorter than the row, has to stay on the dot2 kernel.
  • the sticky MOE_PARTIAL flagged here is fixed in HIP RDNA2: batched MoE rounds on GemmStridedBatchedEx #233 (cleared at the start of every call) and this branch just rebases onto it.

Smoke (gfx1030, mainline + #232 + #233 + this PR, chunk 2048): 6k recall probe 4/4, an 8296-token prompt prefills at 740 tok/s, no kernel fallbacks - the stride gate does not push the MoE path back to dot2.

Comment thread src/hip/mod.rs Resolved
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

One more fix in the head (33f7e73, one line): act_ok no longer whitelists MOE_GATE_X, so a dense call that carries it stays on dot2 instead of dropping the bit silently.

It changes nothing that runs today: the only setter of that bit is the MoE gate flags in prefill.rs, and it feeds gemm_grouped; there the bit is a hint for CUDA's int8 copy of x, and HIP's kernels take act & 3 regardless. No dense caller sets it.

No local rebuild for a one-line gate change - the CI build compiles it, and the previous full smoke still stands for the path that runs (6k recall 4/4, 8k prefill 740 tok/s, no fallbacks).

Comment thread src/hip/mod.rs Resolved
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Per hun's note on the gate: one line in d7029f0. gemm_dense's take now requires !self.int8_gemm(w.ty), so an int8-typed dense weight goes to the f16 GemmEx only where no int8 GEMM runs.

On RDNA2 int8_gemm is false, so nothing changes on the path this series runs: no local rebuild for a one-line gate change, the CI build compiles it, and the earlier smoke stands (6k recall 4/4, 8k prefill 740 tok/s, no fallbacks).

@Aletheore please re-run the review on the current head.

I-AM-ENGINEER and others added 6 commits December 6, 2026 14:39
The dense prefill GEMMs (mixer qkv/o, the SSM projections, a dense FFN where
the model has one) run on hipBLAS's GemmEx: the matrix dequantizes to f16 once
per call, the x block converts to f16, the product runs with an f16 store (the
f32 store of the same call is a third of the throughput on RDNA2), and
blas_scatter_d writes the result to y with the activation. Matrices of 4096
rows or more process 4096 tokens a step (the 8192-wide Tensile kernel of a
4096x2048 matrix costs what two halves do).

A dense GEMM below 512 tokens stays on the dot2 kernel (dequantizing the whole
matrix does not pay there); STRATA_HIP_DENSE=0 disables the path; a runtime
failure is logged once and hands the rest of the run to dot2 (DENSE_FALLBACK).

Same gate as the rest of the series: RDNA2 only by default, STRATA_HIPBLAS=1/0
override. CUDA and Vulkan are untouched - this is the HIP backend's own
gemm_dense override.

Verified on Qwen4-35B-A3B Q4_K_M, RX 6800 XT: the 700-token probe answers all
four planted facts, the server log shows no kernel fallback lines, the 5.7k
decoy recall answers 3 of 3 needles on 3 runs. kernel_names 539/467/515.
…er need

x_gather_hg reads x a float4 at a time and blas_scatter writes past m0 * y_stride,
so a stride that is not a multiple of 4, or one shorter than the row, has to stay
on the dot2 kernel - the same gate gemm_dense already has.
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Branch rebuilt on the new #233 head. take keeps !self.int8_gemm(w.ty) (was d7029f07), and the diff carries no comment lines; no other code change. The two threads above without an answer are the fixes this branch is stacked on: MOE_PARTIAL is cleared per call (#233), and gemm_grouped takes gemm_dense's four stride checks (cdf28c80 here).

Checked on gfx1030 (HIP backend only) on this head: kernel_names passes (539 / 467), the gemm_dense tests pass, and a 6k-token recall probe answers its four facts with the hipBLAS line in the log and no fallback line. The tests call gemm_dense with at most 130 tokens, under this path's 512 floor, so they cover its gemm_raw fallback; the GemmEx path itself is what the probe runs.

@Aletheore please re-run the review on the current head.

Comment thread src/hip/mod.rs Resolved
@I-AM-ENGINEER

Copy link
Copy Markdown
Contributor Author

Branch rebuilt on the new #233 head; take keeps !self.int8_gemm(w.ty) (now edd130a2). No code change of its own.

Checked on gfx1030 on this head: with STRATA_HIPBLAS=1 the log carries the hipblas line and a 6k-token recall probe answers its four facts, with no fallback line.

@Aletheore please re-run the review on the current head.

Comment thread src/hip/mod.rs Resolved
@Vasyl-Trefilov
Vasyl-Trefilov merged commit 16b50e6 into RustingStudio:main Dec 6, 2026
5 checks passed
@Vasyl-Trefilov

Copy link
Copy Markdown
Member

Hi, ty. The dense GemmEx path looks good and the stride and int8 gates are in. About the last bot comment on MOE_PARTIAL for the first expert: I do not think it is a real problem. Inside one item y is written only by the last launch (the scatter or splitk sum), and for act 0 the GEMM writes y with beta 0, so a rerun on dot2 just overwrites it. If an earlier launch fails, y is not touched yet. You can dismiss it.
Merged with the other two in order and the CUDA tests pass, so this goes in with the stack.

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.

3 participants