mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4983] [Engine] gfx900: no v_fma_mixlo_f16 in gdn_out_norm_loop_kernel #5276
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#5276
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/4983
Author: @nerdoc
Created: 11/2/2026
Status: 🔄 Open
Base:
main← Head:gfx900-fma-mix📝 Commits (1)
310dfd3gfx900: no v_fma_mixlo_f16 in gdn_out_norm_loop_kernel📊 Changes
1 file changed (+5 additions, -0 deletions)
View changed files
📝
src/prefill/kernels.cu(+5 -0)📄 Description
Problem and result
gdn_out_norm_loop_kernel<false>(theSTRATA_GDN_NOY=1path insrc/prefill/kernels.cu) uses inlinev_fma_mixlo_f16. The mix instructions exist from gfx906 on, so building the GFX906 compat backend for gfx900(Vega 10,
-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx900) stops when the assembler hits that instruction.With this change gfx900 compiles
hf(bp * sg)there instead. Every other target keeps the asm unchanged.Related discussion
none (focused build fix). Build notes and measurements for gfx900 are in #4982.
Approach
#if defined(__gfx900__)around the asm, nothing else.hf(bp * sg)rounds the FP32 product to FP16. The FP16value can differ from the fused mix in the last bit, which the comment says. That is also what the
WYbranchabove already stores (
v = bp * sg; y16 = hf(v)).__gfx900__is only defined in the gfx900 device pass, so otherarchitectures, the host pass and CUDA preprocess to the same code as before.
Validation
Passed:
Build, gfx900, Debian 13 (HIP 5.7.1, clang 17, hipBLAS 0.54):
cmake -S . -B build-gfx900 -DCMAKE_BUILD_TYPE=Release -DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx900 -DCMAKE_HIP_COMPILER=/usr/lib/llvm-17/bin/clang++ -DCMAKE_HIP_COMPILER_ROCM_ROOT=/usr ...,cmake --build build-gfx900 --target strata: links. Basec62d5e3aplus this change and three unrelated build fixes that this toolchain also needs (first with my own
equivalents, now with #4600 and #4766 applied, plus a hipBLAS < 1.0 type mapping, see #4982).
Build, gfx900, ROCm 6.4 from Debian sid (HIP 6.4.3, clang 21, gcc 15 libstdc++): same, without the hipBLAS mapping.
Hardware, Radeon RX Vega 64 (gfx900, 8 GB), Qwen3.8-Flash-Next Coder IQ1_M, Debian 13 build above. The patched
line only runs with
STRATA_GDN_HEAD=1 STRATA_GDN_NOY=1, so I sent the same 5,378-token prompt (temperature 0,200 tokens) to a fresh engine twice per setting and compared the answer's md5:
b4d460c9…b4d460c9…STRATA_GDN_HEAD=1(<true>, no asm)f7a3863c…f7a3863c…STRATA_GDN_HEAD=1 STRATA_GDN_NOY=1(<false>, this change)f7a3863c…f7a3863c…The patched path gives the same answer as the
WYpath on this prompt. The default differs because it runs theolder GDN kernels.
Default settings on the same build: a ~2 h load test (needle at 14k / 27k / 46k tokens, 3,000-token output, three
concurrent requests, 45 min multi-turn soak) with 0 failed requests. That run does not use the patched line.
Failed:
none observed
Not run:
pass, but I have not compiled those targets with this change.
Limits
gfx900 is not an official target. This only removes the one instruction gfx900 lacks. It makes no claim about
STRATA_GDN_NOYbeing faster on gfx900.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.