Skip to content

--result <json>: the run's results as data, the values its end-of-run lines print - #60

Merged
YWHyuk merged 1 commit into
mainfrom
result-json
Oct 24, 2026
Merged

YWHyuk merged 1 commit into
mainfrom
result-json

Conversation

@student-Jungmin

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

Copy link
Copy Markdown
Collaborator

What

--result <path> writes the run's results as one JSON object when the run ends, so a consumer no longer has to match the log lines. PyTorchSim's frontend does that today, with five regexes, and picks template configs by the total it finds.

The file holds:

  • version, total_cycles, wall_clock_s (models_list only; null with --tog_so)
  • core_cycles
  • units: every unit line, Core [i] and Total, with or without a unit table
  • dma: each core's DMA line
  • dram: the channels and their combination
  • kernels: each kernel's completion (scheduler, kernel_id, started, finished)

Each value is recorded where its line prints it (Result.h, result()), unrounded. The lines themselves are unchanged. Without --result nothing is written; a path that cannot be written is refused, exit 1. The key table is in docs/output-lines.md ("The result file").

The completion line's TOG path and operation are left out of the file: both are the placeholder kernel (main.cc passes it as the graph's path and name).

Tests

  • tests/result/ (5 cases) checks each value in the file against its printed line: --tog_so with a unit table, --tog_so with systolic_array_split: none and no unit table, and a session of two kernels. It also covers no option (no file) and an unwritable path (refused).
  • Full suite: 359/360 pass. examples/mistakes fails the same way before and after this change (its valid.so is not found in this environment).

Version

The command line is item 3 of docs/compatibility.md, so this moves MINOR (1.0.0 -> 1.1.0). I left the bump out; please set it as you prefer.

Follow-up

PyTorchSim reads this file instead of the log in PSAL-POSTECH/PyTorchSim#446 (draft, waits for this PR and the pin bumps).

… lines print

A consumer reads TOGSim's results by matching its log lines (PyTorchSim's
frontend does, with five patterns, and picks template configs by the total it
finds). --result writes them as one JSON object when the run ends: the total,
the wall clock (models_list), each core's cycles, every unit line (Core [i] and
Total; with or without a unit table), each core's DMA line, the DRAM channels
and their combination, and each kernel's completion. Each value is recorded
where its line prints it (Result.h, result()), unrounded; the lines are
unchanged. Without --result nothing is written; a path that cannot be written
is refused, exit 1.

tests/result/ pins each value against its line, for --tog_so with and without
a unit table and for a session of two kernels, and the two edges. The suite:
359 of 360 pass; examples/mistakes fails before this change as after (its
valid.so is not found here).

The command line is item 3 of docs/compatibility.md, whose rule moves MINOR;
the bump to 1.1.0 is left to the maintainer.
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.

2 participants