Skip to content

[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 into
pytorchsim-triton-backendfrom
refactor/r441-7b-togsim-result
Oct 24, 2026
Merged

student-Jungmin merged 1 commit into
pytorchsim-triton-backendfrom
refactor/r441-7b-togsim-result

Conversation

@student-Jungmin

@student-Jungmin student-Jungmin commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • TOGSim's results are the file it writes with --result (--result <json>: the run's results as data, the values its end-of-run lines print TOGSim#60). get_result_from_file and its five regexes go. Both launch paths pass --result, and TOGSimProcess.read_result returns the JSON. template_timing takes total_cycles from it.
  • A session's TOGSim output is kept. The session 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.
  • 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 there is pytorchsim_tpuv6e, which nothing in this tree names.

Behavior change

  • A run that wrote no result file is a FileNotFoundError, not inf cycles with only a warning. A timed candidate still turns it into a logged inf.
  • Sessions now write their .log.
  • The compiler pin.

tests/system/test_togsim_result.py pins all three. It runs a stub Simulator that writes a result file TOGSim 5791272 wrote for a tpuv6e test_matmul.py run, and checks:

  • both paths pass --result and read it back;
  • a session keeps the Simulator's output in its .log beside its .trace and .json;
  • a run without a file is an error.

Checked locally

PTB 70221f4 with TOGSim 5791272:

No cycle numbers here: only where the frontend reads them from moves.

…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).
@student-Jungmin student-Jungmin changed the title [Refactor 6/7] TOGSim's results from --result, a session keeps its log, and the compiler pin is PTB main 70221f4 [Refactor 6/8] TOGSim's results from --result, a session keeps its log, and the compiler pin is PTB main 70221f4 Oct 24, 2026
@student-Jungmin student-Jungmin changed the title [Refactor 6/8] TOGSim's results from --result, a session keeps its log, and the compiler pin is PTB main 70221f4 [Refactor 6/9] TOGSim's results from --result, a session keeps its log, and the compiler pin is PTB main 70221f4 Oct 24, 2026
@student-Jungmin
student-Jungmin marked this pull request as ready for review October 24, 2026 14:00
@student-Jungmin
student-Jungmin changed the base branch from refactor/r441-7-simulator to pytorchsim-triton-backend October 24, 2026 14:01
@student-Jungmin
student-Jungmin merged commit cbe92e6 into pytorchsim-triton-backend Oct 24, 2026
@YWHyuk
YWHyuk deleted the refactor/r441-7b-togsim-result branch October 27, 2026 07:46
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