mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #491] DeepSeek-V4.1-Flash Maya-XS on Strix Halo (gfx1151, Linux): ~0.1 tok/s decode, q8_mv_kernel and iq1 expert kernels ~100x too slow #196
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#196
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 @mdziemianko on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/491
Hello,
First time trying Project Maya and was expecting about 25 tokens/sec. Instead run into the problem described below.
Various models I am running on llama.cpp have decent performance, but I can not figure out what is wrong here.
Any help appreciated.
Summary
Maya-XS loads and answers correctly on a 128 GB Ryzen AI Max+ 395, but decode runs at 0.1 tok/s (about 6-10 s of GPU time per token). The GPU is 100% busy at full clock. A plain HIP bandwidth test on the same machine reads at 237 GB/s, so the platform is healthy. A rocprofv3 kernel trace shows nearly all the time in the Q8_0 dense matvec kernel and the IQ1 expert kernels, each call taking tens to hundreds of milliseconds.
I have seen reports of 35-37 tok/s for this model on this class of hardware, so I'm looking for what differs on my setup.
Environment
4615f34),./setup.sh --backend hip --gpu 0 --model DeepSeek-V4.1-Flash-1017 --ds4-quant maya-xsrepo.radeon.com/rocm/apt/7.2.4 noble, installed on 26.04; Ubuntu's own ROCm 7.1.1 packages were not recognised by Maya's check)lldneedslibxml2.so.2, 26.04 only ships.so.16; I symlinked it into a privateLD_LIBRARY_PATHdirectory. Compile and link otherwise work.amd_iommu=off amdgpu.gttsize=131072 ttm.pages_limit=33554432 ttm.page_pool_size=33554432 amdgpu.gfxoff=0, no crashkernel, swap offmem_info_vram_total= 1 GiB, GTT 128 GiB); RAM 124 GiB usable. Also tested with a 96 GiB UMA carve-out (see below).Memory
--vram-experts 1.0fails:maya-ds4: cudaMalloc of layer 39's 356 experts on CUDA0 failedat about 112 GiB. A standalonehipMallocloop (1 GiB chunks) also stops at 112 GiB while about 9 GB of free RAM remains, all of it shown as CMA free in the kernel'sMem-Info(free_cmais nearly all offree), so it is not usable for GPU buffers.--vram-experts 0.88(99.2 GB of experts on the GPU, 1047 experts on the CPU lane) and--max-context 32768. At 0.95 with swap off the kernel OOM killer fired and killed the desktop session.Symptoms
Engine's own statistics (
DS4_PROF=1,--ids 1,2,3 --n 6):Through the server (
maya.sh, 32K context): a 32-token prompt takes 116 s to read (0.3 tok/s), decode is 0.1 tok/s, expert cache hit rate 99.8%. The answers are correct.What I ruled out
hipMallocbuffer gets 237 GB/s; 239 GB/s after holding 90 GiB of other buffers; 241 GB/s on individual 1 GiB buffers. FP32 FMA test: 7.6 TFLOPS.DS4_HIP_ATTN_SWIZZLE=1, and GTT versus dedicated VRAM (next section).Further experiments (none changed the picture)
DS4_PROFGPU time per token, same prompt (--ids 1,2,3 --n 6),--max-context 32768,--dspark none:HIP_FORCE_DEV_KERNARG=1 HSA_ENABLE_SDMA=0HSA_XNACK=0/=1DS4_HIP_ATTN_SWIZZLE=1DS4_HIP_ATTN_SWIZZLE=1made no measurable difference.HIP_FORCE_DEV_KERNARG=1 HSA_ENABLE_SDMA=0gave about a 1.7x gain, but still far from usable.rocprofv3 kernel trace
rocprofv3 --kernel-trace, 4 decode tokens plus a 3-token prompt, 10,399 dispatches, 53.3 s of kernel time:strata::ds4::gguf::q8_mv_kernel<1,true>strata::ds4::gguf::q8_mv_kernel<4,true>strata::ds4::gguf::iq1::gate_up_kernel<19,1,1,false,1>strata::ds4::gguf::iq1::gate_up_kernel<19,4,1,false,1>strata::ds4::gguf::iq1::down_kernel<19,1,1,false,2>strata::ds4::gguf::iq1::down_kernel<19,4,1,false,2>Everything else is under 0.2 s in total (for example
finish_kernel190 ms over 676 calls,index_score_kernel153 ms over 32). I can attach the.dbfromrocprofv3 -d.For scale: reading all 8.5 GB of dense weights once at 237 GB/s takes about 36 ms, but one
q8_mv_kernelcall averages 37 ms, and the trace has 1,004 of them over roughly 7 token passes (about 140 per pass). The 675 ms outlier calls look like stalls, not arithmetic.Questions
q8_mv_kerneland theiq1expert kernels that setup should have selected, or an env var I should set?--dspark noneis in my config only because the speed calibration crashed on the memory failure above; I assume that is unrelated.I can run any diagnostic build or env setting you want and post the results.
@mw00 commented on GitHub (Oct 27, 2026):
Thank you for the profile and the rocprof trace - they rule out a lot. Every kernel is slow by about the same factor, and a plain HIP bandwidth test is fine, so this looks like the platform rather than one Maya kernel. A setup close to yours does run at full speed: #510 / #541 use Ubuntu 26.04, kernel 7.0.0-38 and ROCm 7.2.4 with a Radeon 8060S working beside two RX 7900 XTX. The main difference we can see is how ROCm was installed there: AMD's runfile, installed in isolation, not the noble apt packages on 26.04.
Could you try these, and say which ones change the speed?
rocm-smi --showclocks --showperflevelduring decode.On the 9 GB CMA: that is the kernel's own reservation and not something Maya sets. Maya-XS fits on a 128 GB machine with
--vram-expertsbelow 1.0, as you found.