mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4825] [Engine] Linux gfx1151 (Strix Halo): chunked prompt NaN with Unsloth UD-IQ1_M (dq_rows_kernel on Q6_K), and DS4_FAST_ATTN works on Linux #2220
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#2220
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 @xaler5 on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4825
Setup
c62d5e3a1, engine 0.1.55),strata-dsv41built withtools/dsv41/build_hip_linux.shfor gfx1151tools/dsv41/pack_gguf.py--gpus 0 --max-context 32768 --reserve-mib <GTT free - 90 GiB> --ssd-cache 6 --dspark auto1. Chunked prompt path: GPU memory fault in moe_sort_kernel
Every prompt of 96 tokens or more (the chunked pass) aborts with:
Shorter prompts (windows) work, as does
--prefill-chunk 0. Changing the chunk size,DS4_YOCO=0,DS4_LAYER_MAJOR=0orSTRATA_DENSE_PFGEMM=0does not help.DS4_DUMP_Son layer 0 of the chunked pass (397-token prompt):wq_aandwkvare Q6_K in the Unsloth set, so the dense weights go throughgg::rows->iq::dequant_rows, which on gfx11 picks therow-per-lane
dq_rows_kernel(dq_use_old_kernel()). The NaN reaches the router:route_kernelnever beats-FLT_MAXandstores
0x7fffffffas the pick, somoe_sort_kernelreadsvs[0x7fffffff], the fault above.With
DS4_DQ_OLD=0(dq_rows_kernel2) the dumps are finite, every prompt length runs, and the greedy answer for a 1.3k prompt matchesthe window path. Possibly the IST-DAS sets (Q5_K dense) never hit this, which would explain why Windows gfx1151 did not see it.
Suggestions: default
DS4_DQ_OLDoff for Q6_K (or fix the staged path for it), and haveroute_kernelrefuse non-finite logitsinstead of passing an out-of-range expert id.
2. DS4_FAST_ATTN=1 on Linux gfx1151
fast_attn_default()turns the WMMA sparse attention on for gfx12 and for gfx1151 on Windows only. On Linux gfx1151 it works as well(after the fix above, 90 GiB GPU budget,
DS4_PROF):DS4_YOCO=2)Decode is unchanged (17-19 tok/s). Could the Linux gfx1151 default follow the Windows one?
3. Smaller notes
uma_free()returns hipMemGetInfo's free (the whole GTT pool, ~120 GiB here) with no headroom, so without--reserve-mibthe expert tier fills the machine (MemAvailable reached 0).DS4_UMA_HEADROOM_GIBonly applies to CUDA.DS4_ASYNC_T=4(what setup writes for Windows gfx1151) measured no decode change on Linux with this set.@github-actions[bot] commented on GitHub (Oct 31, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@Niko1221 commented on GitHub (Oct 31, 2026):
Thanks for the trace. We found the same bug on Windows Strix Halo today, and your dumps match what we saw. On gfx11 the older dense dequantizer (
dq_rows_kernel) stages 704 bytes per warp, but four Q6_K blocks are 840 bytes, so the rows go NaN. UD-IQ1_S and UD-IQ1_M have Q6_K attention weights, which is why the ISTA-DAS sets never showed this failure. On your setup the NaN then reached the router, and the bad pick caused the memory fault.Your workaround is right until the update is out: set
DS4_DQ_OLD=0. We also ran it on the shipped 0.1.55 engine on Windows (gfx1151, UD-IQ1_S): the long prompt that returned garbage now gets a correct answer.The fix goes into the next 0.2.9 update.
dq_rows_kernel2becomes the default on gfx11 for every set, andDS4_DQ_OLD=1can no longer send a type to the old kernel if its staging doesn't fit. On Strix Halo under Windows, layers 0 to 2 were bit-identical across runs on UD-IQ1_S and ISTA-DAS 2.25, and long prompts gave correct answers. Prompt speed on 2.25 dropped by about 1%.We took your router suggestion too: a change that stops a NaN turning into an out-of-bounds read is being tested for the same update.
We have not run the fix on Linux gfx1151 or with UD-IQ1_M. Please try it there when the update is out and tell us what you see.
@github-actions[bot] commented on GitHub (Nov 1, 2026):
Thanks, this follows the format now.
@dturini12 commented on GitHub (Nov 1, 2026):
The same
moe_sort_kernel<false>fault happened here on Linux gfx1151 with an ISTA-DAS set that has no Q6_K weights. So the Q6_K staging overflow is probably not the only way a NaN reaches the router, and the router change you mentioned (a NaN must not become an out-of-bounds read) matters for the ISTA-DAS sets too.Environment
c62d5e3a1, engine 0.1.55,strata-dsv41built for gfx1151 from the packagingDSV41=1path, with no source changes. ROCm TheRock 7.14.1 userspace; runs in rootless Podman.dq_rows_kernel's staging exactly).--max-context 524288 --vision on --dspark auto --dspark-conf 0.65 --prefill-chunk 8192 --gpus 0 --reserve-mib 36846 --ssd-cache 14 --profile-readonly --experts 6. Env:DS4_FAST_ATTN=1(set by me; not the Linux default).DS4_DQ_OLDunset, sodq_rows_kernelis used on gfx11.What happened
The kernel log and the HIP runtime agree on the address (a read; TCP client):
Kernel log (journalctl -k)
Engine log: startup placement, last good request, the fault
What is not known: the fault happened once and I have not reproduced it. I have no
DS4_DUMP_Soutput, so a NaN at the router is the likely path (it matches your analysis androute_kernel's0x7fffffffdefault), not a confirmed one. Possible NaN sources here that I have not tested:DS4_FAST_ATTN=1at deep positions, or another kernel in the incremental chunked pass.I'll try the 0.2.9 update on this machine (Linux gfx1151, ISTA-DAS 2.00) when it is out and report back. If a specific A/B helps before that (
DS4_FAST_ATTN=0,DS4_DQ_OLD=0, or a dump variable), tell me which one.