mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5361] [Engine] gfx906 (MI50/MI60/Radeon VII) performance branch — fastest known 4xMI50 Flash-Next numbers #5403
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5403
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5361
Author: @rpcribari
Created: 11/6/2026
Status: 🔄 Open
Base:
main← Head:int6📝 Commits (10+)
a3dd11flocal gfx906 build patches (hip_compat stream-priority macros, align spelling)5e4719agfx906: IQ4_NL gate/up experts (STRATA_GU_FMTS; generic layout) + parity coverage70a5e7dgfx906 prefill: opt-in STRATA_PF_RP=1 - IQ4_NL expert products through mx-llama.cpp's repacked GEMM (vendored src/prefill/rp/, MIT); the group gather writes the repacked layout; rp_expert_bench (bitwise vs MMQ)fe4ab83gfx906: dense_mmq_bench (dense projections: dequant + hipBLAS FP16 vs int8 MMQ vs repacked, at the engine's shapes)658a1b7gfx906: STRATA_DENSE_MMQ=1 (Gemm::native_mmq) on the gfx906 build; STRATA_DENSE_MMQ_SKIP (default attn_k.,attn_v.: K/V stay FP16, keeps the MTP acceptance)9247000gfx906: STRATA_DENSE_RP=1 - dense IQ4_NL projections through the repacked GEMM (weight repacked per call into a grow-only scratch; bitwise equal to dense MMQ)2e75c0dgfx906 dense repack: Q8_0, Q6_K, Q5_K too (mx's device repack kernels vendored in src/prefill/rp/repack-convert.cuh; Q4_K stays MMQ, slower repacked); dense_mmq_bench: bitwise rp-vs-mmq check43ff98cgfx906 expert repack per product: an IQ4_NL down under non-IQ4_NL gate/up (GSQ-RCO IQ3_S file) takes the repacked GEMM on its own; the other part gathered as GGUF for MMQ (bitwise equal to stock)1d8e9eegfx906 dense repack: IQ4_XS (Strata's own layout: IQ4_NL nibble plane + FP32 per-sub-block scales; bitwise equal to MMQ); STRATA_DENSE_MMQ_PROFILE=1 times each dense MMQ calle4f4027gfx906 expert repack: IQ3_XXS / IQ3_S gate/up (GSQ-RCO IQ3_S file) through the repacked GEMM📊 Changes
31 files changed (+5046 additions, -147 deletions)
View changed files
📝
CMakeLists.txt(+9 -0)➕
bench/results/2026-10-30-mi50-32gb-decode/README.md(+79 -0)📝
docs/AMD_HIP.md(+4 -0)➕
docs/AMD_MI50.md(+220 -0)➕
docs/gfx906.md(+70 -0)📝
include/strata/platform/hip_compat/strata_hip.h(+22 -1)📝
include/strata/prefill/gemm.hpp(+7 -0)➕
include/strata/prefill/rp_moe.hpp(+89 -0)📝
src/core/dflash2.cpp(+1 -1)📝
src/kernels/cuda/fused_gr.cu(+329 -43)📝
src/kernels/cuda/iq_kernels.cu(+306 -65)📝
src/kernels/cuda/native_bf16.cu(+12 -7)📝
src/kernels/cuda/native_mmvq.cu(+161 -9)📝
src/kernels/cuda/router_top10.cu(+3 -3)📝
src/kernels/cuda/sampler.cu(+17 -1)📝
src/kernels/cuda/verify_kernels.cu(+11 -1)📝
src/kernels/fused_gr_bench.cpp(+14 -2)📝
src/kernels/native_expert_bench.cpp(+14 -1)📝
src/kernels/native_grouped_parity.cpp(+1 -1)➕
src/prefill/dense_mmq_bench.cu(+226 -0)...and 11 more files
📄 Description
Problem and result
gfx906 (MI50 32 GB / MI60 / Radeon VII) is the cheapest way into a big-context MoE rig, but on Qwen3.8-Flash-Next the whole gfx906 ecosystem was stuck around 62 t/s decode and ~1250 t/s prefill-8K (best published llama.cpp fork), and Strata layer-split prefill ran one card at a time on this hardware.
This branch (21 commits on 0.2.7) takes a 4x MI50 box to:
Related discussion
none — opening as a concrete proposal; happy to rebase onto current main or split into reviewable chunks (kernels / pipeline fix / docs), whichever is easier.
Approach
ds_swizzlereductions replacingds_bpermute, sampler load pipelining, hyper-connection read staging.--prefill-pipefor gfx906: with the expert cache fully VRAM-resident the per-chunk fixed cost is small, so r ~ 300-450 wins big; without it a layer-split prefill serializes one card at a time. Guidance indocs/gfx906.md.All engine-visible behavior is switch-gated (
STRATA_*env / existing flags); default-on only on the gfx906 build (-DSTRATA_HIP_GFX906=ON). No changes outside the HIP/gfx906 paths.Validation
Passed:
strata-bench-style throughput runs, revisionint6(14f591d4), 4x MI50 32 GB Gen3 x8, 250 GB RAM, ROCm 7.2.4 container, UD-IQ4_XS pack: decode 125 t/s, pp8K 1250 t/s, pp32K 1766 t/s. Nonce-bearing prompts (no cache hits), warm pass reported, run twice after idle.*_benchtools — exact match.Failed:
Not run:
ggml/src/ggml-hyperturingHIP paths and gfx906-gated code, but non-gfx906 HIP is unverified here.Limits
--prefill-pipeoptimum is rig-dependent (r 300-450 here); a bad ratio costs decode.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.