Summary
Add a first-class Insight Trace replay workflow that consumes kernel args dump artifacts and generates a MindStudio Insight-compatible simulator trace directory.
The runtime side already has dump producer work, including tensor dump infrastructure and args metadata export. This feature covers the consumer side: take a dump directory, select a target kernel dispatch, reconstruct replay arguments, generate a replay workspace, run msprof op simulator, and export the simulator/ directory that MindStudio Insight can open.
Motivation / Use Case
When debugging or profiling a single incore kernel, developers need a way to move from an observed runtime execution to an offline replay artifact that can be inspected in MindStudio Insight.
Before this feature, the workflow required manually converting dump output into an --arg-spec JSON file. That manual step is error-prone and duplicates information already present in dispatch-level kernel args dumps.
A direct dump-to-replay path would allow developers to:
- Reuse runtime dump artifacts as replay inputs
- Select a specific
func_id and dispatch_id
- Avoid manually writing tensor/scalar arg specs
- Generate a replay workspace for a single
kernel_entry(args) kernel
- Export a MindStudio Insight-compatible
simulator/ artifact
Proposed API / Behavior
Add CLI support similar to:
python -m simpler_setup.tools.insight_trace \
<test_module> \
--case <case_name> \
--func-id <func_id> \
--dump-dir <dump_output_dir> \
--dispatch-id <dispatch_id>
Expected behavior:
- Load the scene case and select the target incore kernel by
--func-id.
- Read
kernel_args_dump.json from either:
<dump-dir>/kernel_args_dump.json
<dump-dir>/tensor_dump/kernel_args_dump.json
- Select the dispatch matching both
func_id and dispatch_id.
- Convert tensor and scalar entries into replay
TraceArg values.
- Ignore runtime context slots such as local/global context pointers when generating single-task replay args.
- Generate the replay workspace and run the existing
msprof op simulator collect/export path.
- Print the generated MindStudio Insight input directory:
<workspace>/insight_export/OPPROF_*/simulator/
Relationship to Existing Work
This is the consumer side of the dump pipeline.
Related existing work:
This issue is related to those diagnostics capabilities, but it does not close them. It adds the offline replay/Insight consumption path on top of dump artifacts.
Acceptance Criteria
simpler_setup.tools.insight_trace accepts --dump-dir and --dispatch-id for the simpler backend.
- The CLI requires
--func-id when --dump-dir is used.
- Dispatch-level tensor/scalar args are parsed from
kernel_args_dump.json.
- Local/global context slots are filtered out for single-task replay.
- Unit tests cover dump arg parsing, context slot filtering, and
func_id + dispatch_id matching.
- A real paged_attention
CaseSmall1 / SF replay can generate a MindStudio Insight-compatible simulator/ directory.
Summary
Add a first-class Insight Trace replay workflow that consumes kernel args dump artifacts and generates a MindStudio Insight-compatible simulator trace directory.
The runtime side already has dump producer work, including tensor dump infrastructure and args metadata export. This feature covers the consumer side: take a dump directory, select a target kernel dispatch, reconstruct replay arguments, generate a replay workspace, run
msprof op simulator, and export thesimulator/directory that MindStudio Insight can open.Motivation / Use Case
When debugging or profiling a single incore kernel, developers need a way to move from an observed runtime execution to an offline replay artifact that can be inspected in MindStudio Insight.
Before this feature, the workflow required manually converting dump output into an
--arg-specJSON file. That manual step is error-prone and duplicates information already present in dispatch-level kernel args dumps.A direct dump-to-replay path would allow developers to:
func_idanddispatch_idkernel_entry(args)kernelsimulator/artifactProposed API / Behavior
Add CLI support similar to:
Expected behavior:
--func-id.kernel_args_dump.jsonfrom either:<dump-dir>/kernel_args_dump.json<dump-dir>/tensor_dump/kernel_args_dump.jsonfunc_idanddispatch_id.TraceArgvalues.msprof op simulatorcollect/export path.Relationship to Existing Work
This is the consumer side of the dump pipeline.
Related existing work:
This issue is related to those diagnostics capabilities, but it does not close them. It adds the offline replay/Insight consumption path on top of dump artifacts.
Acceptance Criteria
simpler_setup.tools.insight_traceaccepts--dump-dirand--dispatch-idfor the simpler backend.--func-idwhen--dump-diris used.kernel_args_dump.json.func_id + dispatch_idmatching.CaseSmall1/SFreplay can generate a MindStudio Insight-compatiblesimulator/directory.