mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5151] [Engine] gfx103x: make the prompt's FP16 GEMMs the default (the default path gives non-finite logits on some ROCm builds) #3062
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#3062
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?
Originally created by @cloud4t0r on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5151
Summary
On gfx103x the prompt path's 16-bit GEMMs can run in FP16 in and out (
prompt_f16(), #835), which is opt-in today (STRATA_HIP_PROMPT_F16=1) because it changes the prompt path's numbers. This is a scope request to flip that default on gfx103x (STRATA_HIP_PROMPT_F16=0to keep the old bytes) — not a PR. Two reasons, one of which is not a preference:Qwen3.8-Flash-Next GSQ-RCO IQ3_S,--kv int8 --spec 4 --mtp— "any prompt part > 64 tokens gives 248320/248320 non-finite logits". It still reproduces on 0.1.56; I added the details to #1208. A default that ends the request is worse than a default that rounds.docs/AMD_HIP.md(2x RX 6900 XT, GSQ-RCO IQ3_S: 9.4K / 34.7K / 105.8K prompts at 744 / 915 / 926 tok/s instead of 439 / 466 / 461, decode unchanged).Proposed behaviour
prompt_f16()returns true on a gfx103x device unlessSTRATA_HIP_PROMPT_F16=0; every other card and every other switch keeps today's default. With that, the tip line the engine prints on gfx103x ("STRATA_HIP_PROMPT_F16=1reads long prompts about 2x faster here") becomes the default and disappears.Evidence on 0.1.56 (this box)
RX 9070 (gfx1201) as stage 0, RX 6800 (gfx1030) as stage 1,
Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S(qwen4exp, 512 experts / top 10),--spec 4 --spec-min-p 0.5 --mtp --kv int8 --kv-resident 32768 --max-context 131072 --layer-split auto, engine 0.1.56 (5571819a), HIP build.--short-read 0(prompt fully batched), 56 tokens--short-read 64, 56 tokens--short-read 64, 71 tokens--short-read 8192(windows only), 1109 tokensSTRATA_HIP_PROMPT_F16=1, 56 / 71 / 1109 tokensNot the FP16 range, on a clean run of the 1109-token prompt (
STRATA_F16_RANGE=1, noSTRATA_DBG_NAN):So the outputs sit a factor ~190 below FP16's 65504 on this model, with no saturated or non-finite value. That is one pack and one prompt; it is not a proof for every pack.
Ruled out here, all still non-finite on the default path:
STRATA_PREFILL_MMQ=0,--kv fp16,STRATA_ROUTE_TAIL_SKIP=0,STRATA_HC_Q8=0,--prompt-cache 0 --conversation-cache-mib 0,--max-context 32768,--gpu 0alone. One difference from the 0.1.40.1 report: here the RX 9070 alone also produces the NaN on the batched path, so on 0.1.56 it is not only the gfx1030.Tradeoffs
docs/AMD_HIP.md(2026-10-04-rdna2-fp16-prompt) is the reference for how much.docs/AMD_HIP.mdrecords one case where it was 1-3% slower (RX 6900 XT, UD-Q4_K_XL, rocBLAS 5.4.0). And #1208 reports a 2×RX 6900 XT box on ROCm 10.0 / rocBLAS 5.6.0 where the default path is finite, i.e. a default flip changes that box's numbers for a bug it does not have.STRATA_RDNA2_SGEMM=1(FP32 exact) still exists for anyone who wants exactness at FP16-route speed.Alternatives, if you prefer a narrower change
STRATA_HIP_PROMPT_F16=1named as the fix. Smallest change, does not fix the first request.prompt_f16()and the evidence is two boxes.prompt_f16()is cached per device and the prompt graphs are captured, so this needs more plumbing than it looks.What I would need from you
An agreement on (d) or (b), and whether the numbers change is acceptable for a default (the other option is to keep (a) and treat #1208 as a ROCm bug to be worked around by the person hitting it).
I can implement and test whichever you pick on this box: one gfx1030 (RX 6800) + one gfx1201 (RX 9070), Fedora 44,
/opt/rocmwithlibamdhip64.so.7.16.26385and rocBLAS 5.7.0 (the version in the tuning-file name the engine looks for). I cannot test the ROCm 10.0 box where the default is already fine, so (d) cannot be validated there by me.Related: #1208 (the bug), #835 (the original opt-in), #5147 / #5149 (an unrelated
--pipeline-windows 2deadlock found in the same session).