Repository navigation
[Refactor 6/9] TOGSim's results from --result, a session keeps its log, and the compiler pin is PTB main 70221f4 - #461
Merged
student-Jungmin merged 1 commit intoOct 24, 2026
Conversation
…d the compiler pin is PTB main 70221f4 get_result_from_file read TOGSim's end-of-run lines with five regular expressions, and a log it could not parse came back as infinite cycles with only a warning. TOGSim writes the same values as JSON with --result (PSAL-POSTECH/TOGSim#60, in TOGSim 5791272). Both launch paths hand it a path, and TOGSimProcess.read_result returns that object; template_timing takes total_cycles from it, and a run that wrote no file is a FileNotFoundError, which a timed candidate turns into a logged inf. The regexes, FINISH_STR and the unused TOGSIM_RESULT_PATH_KEY go. A session's TOGSim output was never kept: the process was started without a pipe, so shutdown's read of its stdout was always empty and no .log was written. Its stdout now goes to the session's .log directly (a pipe could fill and stall a long session), and a run's .log, .trace and .json share one stamp, _stamp(). The compiler pin moves from PTB 522042a to main 70221f4, whose TOGSim is 5791272: a TOGSim without --result refuses it. The kernel object stays format 8; the accelerator is named pytorchsim_tpuv6e there, which nothing in this tree names. test_togsim_result runs a stub Simulator that writes a result file TOGSim 5791272 wrote for a tpuv6e test_matmul.py run, and pins that both paths pass --result and read it back, that a session keeps the Simulator's output in its .log beside its .trace and .json, and that a run without a file is an error. Checked on PTB 70221f4 with TOGSim 5791272: test_matmul in timing mode 11/11, every kernel's total_cycles from its JSON equal to its log's Total execution cycles (14 runs); test_select in timing mode, test_add, test_eager, test_patch_scope, test_histc, test_topk, test_grouped_mm, test_togsim_exit pass; test_conv_decomposition's depthwise_grad fails as on 522042a (PTB #351).
This was referenced Oct 24, 2026
Closed
student-Jungmin
marked this pull request as ready for review
October 24, 2026 14:00
student-Jungmin
changed the base branch from
refactor/r441-7-simulator
to
pytorchsim-triton-backend
October 24, 2026 14:01
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.
Draft: waiting for verification (CI and the validation reports) before review.
Part 6 of 9 of the frontend refactor. It is one commit of this part's final state. Stacked on #455 (
refactor/r441-7-simulator); review only this PR's commit. It carries what #446 opened, which is closed in its favour.What
--result(--result <json>: the run's results as data, the values its end-of-run lines print TOGSim#60).get_result_from_fileand its five regexes go. Both launch paths pass--result, andTOGSimProcess.read_resultreturns the JSON.template_timingtakestotal_cyclesfrom it.shutdown's read of its stdout was always empty and no.logwas written. Its stdout now goes to the session's.logdirectly. A pipe could fill and stall a long session..log,.traceand.jsonshare one stamp,_stamp().--resultrefuses it. The kernel object stays format 8. The accelerator there ispytorchsim_tpuv6e, which nothing in this tree names.Behavior change
FileNotFoundError, notinfcycles with only a warning. A timed candidate still turns it into a loggedinf..log.tests/system/test_togsim_result.pypins all three. It runs a stub Simulator that writes a result file TOGSim 5791272 wrote for a tpuv6etest_matmul.pyrun, and checks:--resultand read it back;.logbeside its.traceand.json;Checked locally
PTB 70221f4 with TOGSim 5791272:
test_matmulin timing mode: 11/11. Every kernel'stotal_cyclesfrom its JSON equals its log'sTotal execution cycles(14 runs).test_selectin timing mode,test_add,test_eager,test_patch_scope,test_histc,test_topk,test_grouped_mm,test_togsim_exit,test_togsim_result: pass.test_conv_decomposition'sdepthwise_gradfails as on 522042a until fit-transfers folds a gather's tile-shaped index buffer with its data tile PyTorchSim-Triton-Backend#351.No cycle numbers here: only where the frontend reads them from moves.