Repository navigation
[tpuv3-support] [Frontend] Block budgets are the machine's spad_budget, not half the scratchpad - #445
Closed
student-Jungmin wants to merge 1 commit into
Closed
student-Jungmin wants to merge 1 commit into
student-Jungmin wants to merge 1 commit into
Conversation
…scratchpad reduction_block_for divided a lane's scratchpad by 2 and gemm_tile_candidates took half of it, the same fact the compiler states as Target.spad_budget, spad_size over the machine's vpu_spad_buffers (2 when unsaid), and refuses a kernel over. Both now read the machine: reduction_block_for divides by CONFIG_MACHINE.spad_buffers, gemm_tile_candidates takes CONFIG_MACHINE.spad_budget per lane and times the lanes for the whole tile. No change on the shipped machines, which state no vpu_spad_buffers: 2 is what they get, and every block and tile is the one before. test_reduction_tiling's new case pins it: a machine of four buffers halves the reduction block and leaves fewer GEMM tiles, each among those of two; on the old code the block stays 8192 too wide.
student-Jungmin
force-pushed
the
spad-budget-tiling
branch
from
October 24, 2026 07:27
738a9c5 to
28ffd45
Compare
student-Jungmin
marked this pull request as ready for review
October 24, 2026 08:53
Collaborator
Author
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.
Change
reduction_block_fordivided a lane's scratchpad by 2 andgemm_tile_candidatestook half of it: the same fact the compiler states asTarget.spad_budget(spad_size // spad_buffers,vpu_spad_buffers2 when unsaid) and refuses a kernel over. Both now read the machine:reduction_block_fordivides byCONFIG_MACHINE.spad_buffers,gemm_tile_candidatestakesCONFIG_MACHINE.spad_budgeta lane, times the lanes for the whole tile.No change on the shipped machines, which state no
vpu_spad_buffers: 2 is what they get, and every block and tile is the one before.Checked (local, compiler at PSAL-POSTECH/PyTorchSim-Triton-Backend#343, target tpuv6e)
tests/system/test_reduction_tiling.py: all 7 pass, the newtest_the_tile_budget_is_the_machine_s_spad_budgetamong them (a machine of four buffers halves the reduction block and leaves fewer GEMM tiles, each among those of two). On the oldtiling.pythe new case fails, its block 8192 too wide.scripts/ci/triton_route_passing.txt); CI runs it.CI
Triton route (smoke gate + coverage sweep)fails with the same 7 tests as this PR's base, pytorchsim-triton-backend dd80d8c (run 40063855238): Gemma 2-2b and 7b, Mixtral, Yolo, CLIP, ConvNeXtV2 and test_compiler_failure, "6 allowlisted test(s) failed or left the route" on both. None is new with this change.