Add --kernel and --launch-id to Reproducer
#209
Draft
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.
Summary
This PR adds support for reproducing kernel launches by kernel name and launch ID, eliminating the need to manually find line numbers in trace files.
Changes
reproducer/cli.py:--kernelargument (str, default=None)--launch-idargument (int, default=0, 0-based)--linehelp text to indicate mutual exclusivityreproducer/orchestrator.py:reproduce()function signature:line_index: int(required, maintains backward compatibility)out_dir: str(required, no default value)template: str(required, no default value)kernel_name: Optional[str] = None(new, placed after required params)launch_id: int = 0(new)kernel_nameis provided, usesfind_launch_index_by_kernel()to find the actualline_index.ndjson,.ndjson.gz, and.bin.ndjsonformatscli.py:--kerneland--line(non-zero) are providedreproduce()call to pass new parameters using unified calling patterntests/test_tritonparse.py:TestTritonparseCPUclass:_get_test_ndjson_file(): Get test file pathsetup_temp_reproduce_dir(): Create temporary directorycleanup_temp_reproduce_dir(): Cleanup temporary directorytest_reproduce_mutual_exclusivity(): Test parameter mutual exclusivitytest_reproduce_kernel_default_launch_id(): Test default launch_idtest_reproduce_kernel_launch_id(): End-to-end integration testtest_reproduce_kernel_not_found(): Test error handlingtest_reproduce_launch_id_out_of_range(): Test boundary conditionsTestTritonparseCUDApatternPathandtritonparse.reproducer.orchestratorUsage
Testing
Tests use real data from
tests/example_output/parsed_output_complex/dedicated_log_triton_trace_findhao__mapped.ndjson.gzwhen possible, mock data for edge cases.Notes
--lineusage continues to work