mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1258] gfx1151 (Strix Halo) prompt: per-kernel profile of a 16K prompt (rocprofv3) - where would outside help be useful? #517
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#517
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 @huppiflupp on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1258
Box. Ryzen AI Max+ 395, 128 GB (gfx1151, Radeon 8060S, 40 CUs, 2.9 GHz), Linux 7.2, ROCm 7.14.1 (TheRock, hipBLASLt 100401), Strata
82f46a8built per docs/STRIX_HALO.md.Run. UD-IQ4_XS with a Q6_K dense trunk, one 16,058-token prompt,
--prefill 16384 --kv int8 --mmap-experts --expert-cache 24576 --no-prefill-borrow --spec 4 --mtp mtp/rt --mtp-q4 all, the section-5 switches of STRIX_HALO.md.rocprofv3 --kernel-trace --stats(1,193 tok/s under the profiler, 1,230 without).GPU time by kernel (12.8 s total, top entries):
pfg::kernel_bk64(FP16 prompt projections)native_w11_kernel<IQ3_S, gate/up>prompt_attn_wmma_kernelnative_w11_kernel<IQ4_NL, down>gr_write_norm_rs_kernelgr_upmix_kernelgdn_rec_quad2c_kernelmoe_combine4_kernelpfg::kernel_hcd_exact__amd_rocclr_fillBufferAligneddequant_kernel<Q6_K>Rough efficiency (my arithmetic, please correct):
gr_write_norm_rsmoves >= ~1 GB per call (R fp32 in, xn16 out) in 10.0 ms = ~100 GB/s;gr_upmix>= ~1 GB per call in 9.0 ms = ~110 GB/s, against ~256 GB/s theoretical. Together withkernel_hcd_exactthat is 2.26 s (17.6 %), the largest share after the expert kernels.Question for the maintainers: you are actively working on gfx1151 (the Aurora port, the W bundle
528c1fbfused-expert exact wins). Where would outside help be useful and not get in your way? Candidates I can see from this profile: (a) the memory-bound hyper-connection kernels (norm_rs / upmix at ~40 % of bandwidth), (b) the routed-expert kernels, (c) a unified-memory default that skips the prompt-path loan (see #1236: +5.2 % prompt in the server here). I can run interleaved A/B measurements and bitwise checks on this box for any branch you point me at, and I can test the #1139 fix on gfx1151 with--parallel.The trace CSVs are available if useful.
Measured and written with an AI assistant (Claude Code).
@huppiflupp commented on GitHub (Oct 6, 2026):
Correction to the efficiency estimate above:
gr_write_norm_rs_kernelalso writes R back, so a call moves >= ~1.8 GB (R fp32 read and write plus xn16, 10 bytes per element at T = 16,058), not ~1 GB. At 10.0 ms per call that is >= ~180 GB/s, i.e. already close to what this memory delivers, not ~100 GB/s. The upmix figure needs the same recount before anyone acts on it. The expert-kernel and per-kernel timing numbers stand.Written with an AI assistant (Claude Code).
@Masterihawk commented on GitHub (Oct 7, 2026):
Thanks very much to Niko1221, My gfx1151 runs IQ3_S at decode speed 44~55 tok/s , very nice, I'm so glad !
@libratechw commented on GitHub (Oct 12, 2026):
This is a partial answer to the question here, from a Ryzen AI Max+ 395 (128 GB, gfx1151, ROCm 7.14.1, clang 23, Linux) on v0.1.43. I profiled UD-Q4_K_XL and UD-IQ4_XS prompts next to gufo's engine (same prompts, rocprofv3 on both), took the kernels that stood out, and opened five PRs, one change each:
block_topk_reg_kernel)STRATA_QPREP=1(q split + norm + rope in one kernel),STRATA_ATTN_GATE=1(gate_attn in the attention epilogue), opt-inSTRATA_PF_F16=1: routed experts on the F16 matrix cores (gufo'sRoutedF16GEMMKernel, MIT, attribution in the file), opt-inAll five together against v0.1.43 (prompt tok/s, medians of 3 interleaved rounds of fresh servers, 1 discarded,
--prefill 16384, the section-5 switches withSTRATA_PF_SWITCH_MIN_T=2048; decode is not part of the claim):STRATA_PF_F16=1 STRATA_QPREP=1 STRATA_ATTN_GATE=1)STRATA_PF_FUSED_KQ=1)The generated text is identical to v0.1.43 in all 18 runs of the "always on" column; it differs with F16, as expected (it rounds differently). One round of UD-IQ4_XS 4K in that column started slowly (725.7 tok/s), so I used the median.
Where the time goes now (kernel-trace of one 128K UD-Q4_K_XL prompt, gufo's trace next to it): dense GEMM and the hyper-connection kernels are equal to gufo's, the routed experts are faster than gufo's after #2020 (UD-Q4_K_XL 32K / 128K: 1,437 / 1,368 tok/s here against gufo's 1,512 / 1,410 measured earlier on the same box). What is still behind gufo, at 128K, is attention about 1.0 s, the indexer about 1.5 s (#2016 takes part of it), the GDN conv + L2 about 1.3 s, small kernels about 2.1 s, and a 0.2-0.6 s re-fill of the borrowed expert-cache slots after the prompt (
--no-prefill-borrowavoids it; UD-Q4_K_XL 4K +13%, 32K +4%, 128K +2% with it, mixed on UD-IQ4_XS). #1896 looks like the right place for the re-fill.Where I would look next if useful: attention, and the GDN conv fused into the recurrence (a register version of the recurrence was bit-exact but only 2% faster, so I dropped it).
One more thing I found while measuring, unrelated to the PRs: with
STRATA_PF_SWITCH_MIN_T=4096(section 5), a "4K" prompt is cut into 4,095-token chunks and stays under the threshold, so its dense GEMM runs hipBLASLt solutions that are not in the tuning table (26% of the GPU time at 4K). On the same server, 4 runs of a 4K prompt: 1,052-1,106 tok/s at 4096 against 1,262-1,298 at 2048 (UD-Q4_K_XL). I'll open a separate issue for that.🤖 Generated with Claude Code
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.