Repository navigation
[ASM] [gfx1250] mla v4 prefill: rebuild sparse_pfl with the tail store rework - #5580
Merged
Merged
Conversation
… rework Rebuild mla_a8w8_qh128_1tg_32mx4_32nx1_sparse_pfl.co from the current 32mx4_32nx1 source. Binary-only change; the kernarg layout, the symbol name and the mla_v4_asm.csv row are all unchanged, so no host or dispatch code moves. What is in the new build, on top of the one shipped by #5367: * tail store address hoist (T1 + T5-b) -- the store address comes out of the inner loop, two alternating pack buffers on a global parity let the fence relax to `vm_vsrc: 1`, and the WAR distance becomes two stores everywhere. The 46 idle cycles per iteration were not free issue slots before: the wave was parked on the `s_wait_alu { vm_vsrc: 0 }` sitting right after ds_store. * split final R writeback (T6) -- the 32 KB tensor_store_from_lds became two per-q transfers. A 20-tile ttrace measured the TAIL as one hole, not many: every one of the 16 waves had exactly one gap above 100 cycles, four instructions from the end, 2519..4050 cyc, 56-67% of TAIL. q0's sixteen rows are complete in LDS halfway through the batched store, so issuing that half early puts it in flight across q1's scale/convert work. Same bytes, same order. * prologue index prefetch and prologue scheduling reworked; the final R LDS stores are pipelined and batched. * HEAD_KV_PTL_PREFETCH added behind a knob and left OFF -- on a warmed capture it moved nothing (HEAD 3423 -> 3500, K0 span 796 -> 836) and cost 28 B when off. Whether it pays on a genuinely cold first dispatch is untested. Measured with op_tests/test_pa_sparse_prefill.py, backend=asm prec=fp8 h_q=128 d=512, on gfx1250 (256 CU). Each figure is the median of three alternating before/after passes; both binaries ran in the same window on an otherwise idle GPU. mode N total_pages before us after us speedup sparse 1024 4096 241.57 235.57 1.025x sparse 1024 16384 741.08 739.83 1.002x sparse 4096 4096 1278.32 1269.58 1.007x sparse 4096 16384 3081.76 3073.65 1.003x dense 1024 4096 378.67 375.47 1.009x dense 1024 16384 1231.62 1227.15 1.004x The gain is small here and that is expected: this round of work is all in the head and the tail, which are a fixed cost per dispatch, so their share shrinks as the tile count grows. It is largest at the shortest rows (N=1024, total_pages=4096) and the ordering is consistent -- across two independent runs the new binary was faster in 36 of 36 repeat-wise pairs. Source: my_agent_skills 0805_base/32mx4_32nx1.sp3 at 07257d72c6a7, SHA256 e017a703168b88b885f5a00080ff60dd6cb966723c175ad8a1d4556eff3ca99f. New .co SHA256 f55d85ece7ab7b6b3f26a1d3097a9d1687fcb8b7f9b5c4cff12f6bde3a43475f. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update head and tail part
🤖 Generated with Claude Code