mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1006] [CLOSED] HIP RDNA2 (gfx103x): run the prompt path's 16-bit GEMMs as FP32 SGEMMs (RX 6800: prompts 312 -> 452 tok/s) #2959
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#2959
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/1006
Author: @vallicgrr
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:rdna2-sgemm📝 Commits (10+)
5a30024calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)9f60d13serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)eb8da1d/metrics: each request's speculative draft counts, and their sums in the totals (#457)6a09387setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it57bd713sycl: pipeline the expert cache's profile fill (model load 3-4x faster)e3bdd74A prompt cancelled mid-read is logged and recorded with the tokens it read (#471)📊 Changes
1 file changed (+5 additions, -0 deletions)
View changed files
📝
tests/hip/prefill_gemm.cpp(+5 -0)📄 Description
On gfx1030 the rocBLAS that setup installs (ROCm 10.2.0a20260930) has tuned kernels for FP16 -> FP16, int8 and FP32 -> FP32 only. The prompt path's dense GEMMs take FP16 or BF16 inputs and write FP32 (rocBLAS's HS / BS types), so every one of them runs a fallback kernel at about 5 TFLOPS. This PR widens both inputs to FP32 on gfx103x and runs SGEMM instead.
Gemm::rdna2_sgemm(src/prefill/gemm.cu): the weight is widened once per call, the activations in slices of up to 128 MiB of FP32. Widening FP16 / BF16 to FP32 is exact, and SGEMM accumulates in FP32 like the native call.Gemm::bf16andGemm::f16try it after hipBLASLt and before the nativehipblasGemmEx.Gemm::nativegoes throughf16, so dequantized weights take the route too.STRATA_RDNA2_SGEMM=0/=1turns it off / on for any AMD card. These are the A/B arms below.docs/AMD_HIP.md, RDNA2 section: the measurement, and a Windows gfx1030 report.Measured on an RX 6800 16 GB over OCuLink (PCIe 4.0 x4, 7.1 GB/s), Ryzen 7 8845HS, 28.8 GB RAM, Windows 11. Coder IQ1_M with setup's arguments (64K context, MTP), fresh 12K-token prompts with no reuse, 4 per arm, the same binary with
STRATA_RDNA2_SGEMM=0against the default:STRATA_PREFILL_TIMING)hipblasGemmEx: opA = T, opB = N, FP32 out, fp32 compute):tools/hip/build_windows.batwithSTRATA_HIP_ARCHS=gfx1030, using thegfx103X-all10.2.0a20260930 wheels. The engine starts throughserve/server.pyand serves both APIs.tests/hip/prefill_gemm.cppgains two cases that cross the route's activation slice boundary (T 3300, K 10240): FP16 withbeta = 1and a paddedldy, and BF16. All six cases pass against the float64 reference on the RX 6800, with rel_l2 at most 1.8e-6.build_windows.bat tests, the RX 6800 with the 780M hidden byHIP_VISIBLE_DEVICES=1): 59 passed, 2 skipped (gfx12 only), 6 failed out of 67. A build ofmain(6f32ec0) fails the same six tests with the same messages, and so does this branch withSTRATA_RDNA2_SGEMM=0:ple_parity,expert_parityandpool_testneed model fixtures (Q2_0/...gguf,pack/full/experts.bin) that are not on this machine.expert_cache_segmented_test:--vram-elasticis CUDA-only.hip_handoff: "separate copy/ring timeout".hip_prefill_mmq_parity: "synthetic-Q2_0-GU-pass0: non-finite or unwritten MMQ output".Also noticed, not changed here: after this change, the prompt path's biggest phase on this PC is waiting for streamed experts (
wait copy, ~6 s of 25.5 s), and then the QSA attention fallback (3.7 s).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.