Add info CLI Subcommand
#210
Closed
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 the
infosubcommand to query kernel information from NDJSON trace files. It automatically detects raw logs and parses them, enabling users to list kernels and their launches without manual parsing.Changes
info/cli.py(NEW):_add_info_args(): Add CLI arguments for info subcommandinfo_command(): Main command implementationinfo/parse_helper.py(NEW):parse_and_compress_raw_log(): Parse and compress raw log filesparse_single_file()andgzip_single_file()from parse moduleinfo/kernel_query.py:list_launches_for_kernel(): List all launches for a specific kernel with grid infofind_similar_kernels(): Fuzzy matching usingdifflib.get_close_matches()list_kernels_fast(): Optimized listing usinglaunch_diffevents when availablelist_kernels()for raw logsinfo/__init__.py:list_launches_for_kernel,find_similar_kernels,list_kernels_fastcli.py:infosubcommand integration_add_info_argsandinfo_commandfrominfo.clitests/test_tritonparse.py:test_info_kernel_query_functions(): Combined unit test for 3 query functionstest_info_list_kernels(): Integration test for listing all kernelstest_info_kernel_launches(): Integration test for listing kernel launchestest_info_kernel_not_found(): Integration test for error handling with suggestionsUsage
Features
launch_diffevents for fast kernel listing when availableTesting
Notes
Test Plan