mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4855] [Engine] gfx1010 (RX 5700 / 5700 XT): the SDWA dp4a that gfx1012 already uses #5215
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#5215
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/4855
Author: @Keoian
Created: 10/31/2026
Status: 🔄 Open
Base:
main← Head:gfx1010-sdwa-dot📝 Commits (1)
95527d6[Engine] gfx1010 (RX 5700 / 5700 XT): the SDWA dp4a that gfx1012 already uses📊 Changes
2 files changed (+3 additions, -2 deletions)
View changed files
📝
docs/OLDER_GPUS.md(+1 -0)📝
include/strata/hip_compat/intrinsics.hpp(+2 -2)📄 Description
Problem and result
RDNA1 has no signed dot4 instruction.
hip_compat/intrinsics.hppgives gfx1012 (RX 5500 XT) llama.cpp's SDWA byte-select sequence for__dp4a. gfx1010 (RX 5700 / 5700 XT), which has no dot instructions at all, fell through to the portable shift-and-mask loop. Strata's own kernels call it throughSTRATA_DP4A(45 call sites innative_mmvq.cu, the native expert matvec, plus the grouped S2 expert, Qwen and IQ kernels), so the slower form is on the decode path. With this change gfx1010 takes the same SDWA sequence as gfx1012, and the integer results are the same (modulo 2^32, no clamp).On 2x RX 5700 XT with Qwen3.8-Flash-Next Q2_0, decode goes from 22.38 to 28.77 tok/s (+28.5%, 12 of 12 pairs faster), and the greedy text stays byte-identical. The engine binary also shrinks from 47.7 MB to 37.4 MB.
Related discussion
None for this change. Setup does not offer gfx1010 yet; #3272 (open) adds the
STRATA_EXPERIMENTAL_GFX1010=1opt-in, anddocs/OLDER_GPUS.mdlists the card as built by hand. This PR only changes what a gfx1010 build compiles to.Approach
defined(__gfx1010__) ||is added to the gfx1012 branch ofdp4a().-DSTRATA_GFX1012_PORTABLE_DOT=ONstill selects the portable loop, now on both chips. Every other architecture compiles the same code as before.docs/OLDER_GPUS.mdsays that gfx1010 takes the SDWA sequence too.Validation
Environment: 2x RX 5700 XT 8 GB (gfx1010), i7-3770 (AVX, no AVX2), 32 GB DDR3-1600, Ubuntu with kernel 7.0, ROCm 7.14.0a20260612 (TheRock gfx101X-dgpu),
-DSTRATA_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx1010 -DSTRATA_ISA_FLOOR=avx, base870aedd9.Passed:
hip_intrinsics(dot4 and its overflow cases against a CPU reference) built from this branch (870aedd9+ this commit) and run on an RX 5700 XT:HIP intrinsics parity OK: dynamic signed dot4/overflow, byte permute, packed integer boundaries, wave32 shuffles, shared-memory exchange, ballot and sleep. It is also OK on main's portable loop.The
strataengine target built with this change on top of the AVX-only CPU branch (https://github.com/Keoian/Strata/tree/avx1-q2-native-rows, #4728), 0 errors. That branch touches only CPU files, and it keeps this CPU from hiding the GPU side.Exact: with a fixed expert placement (
--adapt-swaps 0 --prompt-cache 0,pcie_frac0), 6 greedy prompts (up to 256 tokens) gave byte-identical text with and without this change (6 of 6).Decode A/B, both arms on the AVX-only CPU branch: 2x RX 5700 XT 8 GB (layer split 27), Qwen3.8-Flash-Next ISTA-DASLab Q2_0,
--spec 4 --spec-min-p 0.8 --mtp --kv int8 --max-context 131072 --resident-budget-gib 24 --vram-reserve-mib 700,STRATA_Q2_BITPLANE=1,STRATA_HC_Q8=0. Three prompts (code, story, explanation) x 2 reps, 256 tokens greedy, thinking off, one warm-up request, a fresh engine start per arm, the arms in ABBA order over two starts each. Mean 22.38 -> 28.77 tok/s (+28.5%), 12 of 12 pairs faster.Per-run decode tok/s
Failed:
none observed.
Not run:
#if defined(__HIPCC__)).ctestbeyondhip_intrinsics, and thestratatarget on this commit alone (it was built on top of the CPU branch above).Limits
Measured on one machine with one model (Qwen3.8-Flash-Next Q2_0). gfx1010 stays a hand-built, unvalidated target.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.