Repository navigation
systolic_array_split on by default, with the unit table the frontend now passes - #341
Merged
student-Jungmin merged 4 commits intoOct 12, 2026
Merged
Conversation
This was referenced Oct 12, 2026
…ngs its own unit table systolic_array_split now defaults to round_robin; none turns it off. A --trace_so run without --unit_table is refused unless the config says none. Under --models_list a kernel's trace_units.tsv, beside its trace.so, joins one table the simulator keeps: UnitTable::append shifts its tile_ids behind the rows already held and the kernel's computes carry the same shift. A unit the first table does not name is an error. With the split on, a launched kernel without the file is refused. core_serial: the serial cases set none; the split cases run on the default; a default run without a table is refused.
emit_trace writes each sampled tile's unit rows (the vcix units, the CPU's own, and Issue) from gem5's stats.txt beside trace_cycles.tsv. A standalone run passes it as --unit_table; a launched kernel is found by TOGSim beside its trace.so. The autotune launch links it like the cycle table, and a workdir that has cycles but no unit rows is emitted again.
get_result_from_file looked for 'Systolic Array Utilization(%)', 'MatMul
active cycle', 'DRAM CH[n]' and 'DRAM: AVG BW Util', none of which TOGSim
prints any more, so its core and DRAM results were always empty. It now
reads the per-unit rows ('Core [i] : <unit> utilization(%): ...', and the
Total rows of a several-core run), the per-array rows of a run without the
unit table, and the '[DRAM] channel n | ...' lines. core_metrics['units']
holds every row; the old flat keys are filled from the machine's array unit
and its vector unit. A log that never finished now returns five values like
any other, so the caller that takes the last one still gets the cycles.
tests/system/test_togsim_result.py pins both forms on logs cut from real
runs.
…pute at its full length util_viewer matched only the per-array and Vector unit lines, which a run with the unit table does not print, and that is now every frontend run: its systolic and vector series came out empty. It reads the Systolic (or Msa) and Vpu rows as well, in the periodic blocks and the final one. Checked on a 2048x2048x2048 log of each form: 50.66 / 26.39 with the table, 36.33 per array without it. trace_timeline drew a compute as compute_cycle - overlapping_cycle. TOGSim runs it for compute_cycle since the one-compute-at-a-time change, so a nonzero overlap column drew the slice shorter than it ran. The test joins scripts/ci/triton_route_passing.txt, and the comments this branch added to the Python sources come out, per the repository rule.
student-Jungmin
force-pushed
the
systolic-split-default
branch
from
October 12, 2026 09:44
81ac628 to
059d4aa
Compare
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.
What
systolic_array_splitwas opt-in and reachable only by hand: it needs--unit_table, the frontend never passed one, and--models_list(the pathlaunch_modeltakes) refused the table and silently ran unsplit.TOGSim
systolic_array_splitdefaults toround_robin;noneturns it off.--trace_sowithout--unit_tableis refused unless the config saysnone(as before for an explicitround_robin).--models_list: a kernel'strace_units.tsv, beside itstrace.so, joins one table the simulator keeps.UnitTable::appendshifts its tile_ids behind the rows already held, and the kernel's computes carry the same shift (trace_to_tilegraph(..., unit_tile_base)). A unit the first table does not name is an error. With the split on, a launched kernel without the file is refused.Frontend
gem5.unit_rowsreads each sampled tile's unit admissions (vcix units, the CPU's own, Issue) from the gem5 run that already gives the cycles. For the samem5outit gives the rows PTB'stests/runtime/devicewrites.emit_tracewrites them astrace_units.tsv; the standalone launch passes--unit_table; the autotune launch links the file like the cycle table. A workdir with cycles but no unit rows is emitted again.Result parser
get_result_from_filelooked for lines TOGSim no longer prints (Systolic Array Utilization(%),MatMul active cycle,DRAM CH[n],DRAM: AVG BW Util), so its core and DRAM results were always empty. It now reads the per-unit rows, the per-array rows of a run without the table, and the[DRAM] channel n | ...lines.core_metrics["units"]holds every row; the old flat keys are filled from the array unit and the vector unit. An unfinished log returns five values like any other.Scripts
scripts/util_viewer.pymatched only the per-array andVector unitlines, which a run with the unit table does not print; it now reads theSystolic/MsaandVpurows too. On a 2048x2048x2048 log of each form: 50.66 / 26.39 with the table, 36.33 per array without it.scripts/trace_timeline.pydrew a compute ascompute_cycle - overlapping_cycle; TOGSim runs it forcompute_cycle, so it now draws that.Tests
tests/system/test_togsim_result.py(new, listed in the workflow): both output forms, on logs cut from real runs.TOGSim/tests/core_serial/run_core_serial.sh: PASS, 14 checks. The serial cases setnone, the split cases run on the default, and a default run without a table is refused (new).End to end (
torch.matmulthroughlaunch_model, tpuv6e, no cache, PTB with PR 54): 20 shapes, all exit 0.Measured
v6e GEMM, total cycles; sim/TPU against the torch_xla table. "before" is 3984351 with PTB 670ae21, "PTB 54" adds the masked-stream fix only, "this" adds the split.
M = 1 (384x1152, 768x768, 768x3072, 2048x2048, 3072x768): cycles unchanged (13517, 10223, 39095, 50514, 40244).
M >= 512 median sim/TPU 1.69 -> 1.10; within 25% of the TPU 3 -> 10 of 15.
To decide
configs/hasvpu_num_lanes; a config without it now needssystolic_array_split: none.