mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 21:05:40 +07:00
[PR #2231] [CLOSED] HIP gfx1100: bit-exact decode and prompt-path speedups (+12% decode, KL 0) #3937
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#3937
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/2231
Author: @android-imdad
Created: 10/13/2026
Status: ❌ Closed
Base:
main← Head:gfx1100-exact-speedups📝 Commits (2)
caa9b00HIP gfx1100: bit-exact decode and prompt-path speedupsa23a362bench: RX 7900 XTX before / after for the gfx1100 exact speedups📊 Changes
41 files changed (+7892 additions, -355 deletions)
View changed files
📝
CMakeLists.txt(+1 -1)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/README.md(+42 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/kl-teacher-forced.txt(+13 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-defaults-only/README.md(+63 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-defaults-only/engine-log-excerpt.txt(+5 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-defaults-only/results.json(+1042 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-round1/README.md(+63 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-round1/engine-log-excerpt.txt(+5 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-round1/results.json(+1049 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-round2/README.md(+63 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-round2/engine-log-excerpt.txt(+5 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/pr-round2/results.json(+1049 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/upstream-a0116b27-round1/README.md(+63 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/upstream-a0116b27-round1/engine-log-excerpt.txt(+5 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/upstream-a0116b27-round1/results.json(+1049 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/upstream-a0116b27-round2/README.md(+63 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/upstream-a0116b27-round2/engine-log-excerpt.txt(+5 -0)➕
bench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/upstream-a0116b27-round2/results.json(+1049 -0)📝
include/strata/core/verify.hpp(+9 -0)📝
include/strata/kernels/bf16_gemv.hpp(+6 -2)...and 21 more files
📄 Description
Bit-exact speedups for HIP on gfx1100 (RX 7900 XTX), measured with
tools/strata_bench.py --longagainst same-day upstream maina0116b27. Every change keeps the output identical: teacher-forced KL against upstream main at the same expert slot count is 0.0000, 100.0% same top-1, PPL 4.442 / 4.442 over 2,557 positions (16K / 16K / 64K prompts, verify-window decode). Changes that alter numerics (the Q8_0 hyper-connection read from BF16 packs, dropping the BF16 hc copies) are left out of this PR.Results (RX 7900 XTX, Ryzen 7 9800X3D, 62.4 GiB, Linux, ROCm 10.2, Qwen3.8-Flash-Next IQ3_S)
Alternating rounds; each cell is the median of 3 runs. Full reports,
results.jsonand engine log excerpts are inbench/results/2026-10-13-community-rx-7900-xtx-gfx1100-exact-speedups/.Every PR round beats every upstream round in each row. "PR defaults-only" = the PR build without the seven opt-in env switches below, i.e. what a user gets without changing their config. Both engines were built with the same CMake options (
gfx1100,-DSTRATA_HIP_EXP_LAYOUTS -DSTRATA_HIP_MMVQ_IL) and run with the same config, no control vector.What changes
On by default (each is bitwise the old path;
=0turns it off):STRATA_ROUTE_FAST: router lane exchanges as DPP moves; the MoE input copied to the host by the router GEMV's blocksSTRATA_GDN_NORM128: GDN output norm with its one working row group and DPP exchanges (9.3 → 2.0 µs a layer)STRATA_GRUP_WIDE: the hyper-connection read's up kernel with 512 threads for 1-6 tokensSTRATA_TOPK_REGKEYS,STRATA_TOPK_SCAN: QSA top-k keys in registers; serial scans as block scansSTRATA_MTP_SELECT_WIDE: the drafter's row select over 40 blocks (12 → 2.2 µs)STRATA_WAIT_COPY256: the expert plan read over PCIe by 256 threadsSTRATA_MULTI_BLOCK_ARGMAXon HIP (was CUDA-only): 12.0 → 6.0 µs a callSTRATA_ADAPT_COPY2: adaptive-tier swap copies over two DMA streamsSTRATA_DMA_FLAG_WRITE(HIP): the PCIe share's landed flag written by the copy stream (hipStreamWriteValue32, 6.7 µs) instead of a host function (15 µs)STRATA_DQ_FAST(Q6_K / IQ4_XS dequant by warps),STRATA_SCAN_UNROLL(argmax / top-probability scans),STRATA_ATTN_MERGE_BOUND(the drafter's attention merge stops at the last filled chunk)Opt-in (env
=1):STRATA_WAIT_FUSE,STRATA_MMVQ_IL_PLAIN(needs-DSTRATA_HIP_MMVQ_IL),STRATA_COMBINE_HITS,STRATA_ROUTE_PUB,STRATA_WAIT_COMBINE,STRATA_PF_LEAN_ISSUE,STRATA_PF_COPY2. Also opt-in and neutral here:STRATA_GR_FUSE,STRATA_DOWN_SWIGLU,STRATA_PCIE_FORK,STRATA_ADAPT_LAYERWAIT,STRATA_GRUP_PF. Test knobs:STRATA_EXPERT_SLOTS_MAX,STRATA_ATTN_PRE75_NC.Fix: with
STRATA_MMVQ_IL_PLAIN, the 32-column hc up kernel (which does not write the interleavedq8_ilcopy) is skipped. Otherwise the attention projections read a stale copy and replies stop after one token. Without the interleaved copy the kernel choice is unchanged.How it was checked
--pcie-frac 0 --adapt-swaps 0, the same arguments for both engines, 7,229 expert slots on both; upstream against itself also gives 0.0000 (kl-teacher-forced.txtin the results folder).Not tested
permlanex16,hipStreamWriteValue32) is guarded by__HIPCC__/STRATA_USE_HIP, but the shared.cufiles were not compiled for CUDA. A CUDA build check before merge would be appreciated.--clients Nwas not run.🤖 Generated with Claude Code
https://claude.ai/code/session_01C7reiTEKuDUMACf5SbbKbt
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.