Skip to content

TOGSim: trace path only (drop the ONNX parser and STONNE), plus doc and device cleanup - #321

Merged
student-Jungmin merged 3 commits into
pytorchsim-triton-backendfrom
togsim-trace-only
Oct 8, 2026
Merged

student-Jungmin merged 3 commits into
pytorchsim-triton-backendfrom
togsim-trace-only

Conversation

@student-Jungmin

Copy link
Copy Markdown
Collaborator

Three commits on top of pytorchsim-triton-backend (af32efa).

[Docs] Drop docs/design/togsim_cpp_trace.md (it describes the trace producer as frontend code; it is the compiler's now), remove three pointers to the missing triton_backend/README.md, correct where CycleSimulator lives, and drop the LLVM 20/23 seam the bridge docstrings described.

[Device] _fused_sdp_choice returns math only. The overrideable branch picked the MLIR FlashSDPA kernel, which the Triton route does not have, and the device already disables flash/overrideable SDP at init.

[TOGSim] Trace path only. Removes TileGraphParser (ONNX TOG), SparseCore and the STONNE core type with its config keys, the sparse-instruction / stonne-tile flags, and the onnx, protobuf and stonneCore submodules with their CMake wiring. launchKernel and run_standalone require the kernel's trace.so instead of falling back. The four stonne_* / heterogeneous_c2 configs used the removed core type. The frontend's STONNE path (extension_op.py, AsmParser/) was already gone, so nothing produced an ONNX TOG any more.

Note for PTB: setup/togsim.sh checks TOGSim/extern/onnx/CMakeLists.txt; that line has to go when PYTORCHSIM_REF moves past this.

Verified

On a cleared cache, against PTB run-modes (c90c8d7, main + 2) with vcix-accelerator ba69dc8 (gem5 vcix-v0.3.0, Spike 9457402), TOGSim and the device rebuilt:

  • functional: test_add, test_matmul, test_gqa, test_inplace_partial_write, test_expert_mask, test_eager pass
  • timing: test_add, test_matmul_vector pass; cycles identical to the previous TOGSim binary (test_add 100/336/5557/643789/5211, test_matmul_vector 1524/1540)
  • test_indirect_access (timing): the first two cases pass; the third fails in the compiler's TTGIR lowering before TOGSim is reached (not on the allowlist, same as test_sort)
  • test_scheduler (not on the allowlist) did not finish within 40 minutes on the previous run; its kernels enqueued through the trace path before it stalled in Spike on a resnet18 conv

docs/design/togsim_cpp_trace.md described the C++ trace producer as code in
this repository (PyTorchSimFrontend.tog, extension_op.py, AsmParser); it is
the compiler's now. Removes three pointers to the missing
triton_backend/README.md, corrects where CycleSimulator lives, drops the
LLVM 20 vs 23 seam the bridge docstrings described (the frontend holds no
MLIR any more), and lists TOGSim's remaining externals.
The overrideable branch picked the MLIR FlashSDPA kernel, which the Triton
route does not have; the device already disables flash and overrideable SDP
at init, so the branch was never taken.
Every kernel now reaches TOGSim as a trace.so, and the STONNE sparse path
that was the last user of the ONNX TOG is gone from the frontend. Removed
TileGraphParser and SparseCore, the STONNE core type and its config keys, the
sparse-instruction and stonne-tile flags, and the onnx, protobuf and
stonneCore submodules with their CMake wiring. launchKernel and
run_standalone now require the kernel's trace.so instead of falling back.
The four stonne_* / heterogeneous configs used the removed core type.
@student-Jungmin

Copy link
Copy Markdown
Collaborator Author

Rebased onto 2fd095a (the semaphore and spad commits landed after this opened). Conflicts were only in Instruction.h (kept the new wait-key accessors, dropped the sparse flags) and main.cc (trace-only launchKernel).

On the new base: TOGSim builds; functional test_add, test_matmul, test_gqa, test_eager pass.

Timing could not be rerun on this base: 2fd095a moves the producer ABI to 14, and PTB main (PYTORCHSIM_REF af32efa, ABI 13) still emits ABI 13 trace.cpp, so the trace fails to compile or load with or without this PR. It needs PTB's dma-semaphore pairing. On af32efa this PR's timing cycles matched the previous binary exactly.

@student-Jungmin
student-Jungmin merged commit 6ba6e62 into pytorchsim-triton-backend Oct 8, 2026
@student-Jungmin
student-Jungmin deleted the togsim-trace-only branch October 8, 2026 08:35
student-Jungmin added a commit to PSAL-POSTECH/PyTorchSim-Triton-Backend that referenced this pull request Nov 10, 2026
…ps requiring onnx

PSAL-POSTECH/PyTorchSim#321 removed TileGraphParser (the ONNX TOG), SparseCore, the STONNE core
type and the onnx, protobuf and stonneCore submodules; nothing produced an ONNX TOG any more.
2fd095a..6ba6e62 holds only that, a docs cleanup and a device fix -- TOGSim ABI 14 on both
sides. togsim.sh's `test -f TOGSim/extern/onnx/CMakeLists.txt` would now fail, and goes.

Checked: setup/togsim.sh on a fresh prefix clones extern/ as booksim and ramulator2 only and
builds Simulator; tests/run.py --timing on smoke, gather_index_computed_per_program and
loop_store_waited_in_the_next_trip, 8/8, every line and TOGSim cycle count identical to 2fd095a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant