PerfModel: unify kernel library classification - #984
Open
ajassani wants to merge 17 commits into
Open
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Map Kernel stream and category kernel-time_ms columns, cover import with checked-in report fixtures, and Black-format the new files.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Parse perf_params and kernel_details_summary from Python repr into JSON so they are queryable. Kernel rows now come from each unified op's kernel_details_summary with a unified_row_id FK, replacing the flat kernel_summary.csv import. Add gemm_perf, sdpa_perf, and conv_perf satellite tables keyed on unified_row_id for shape-based SQL. Update the how-to schema diagram and tests accordingly. Co-authored-by: Cursor <cursoragent@cursor.com>
The table holds one row per kernel belonging to a specific op (via unified_row_id), not the aggregate kernel_summary.csv sheet. Rename it to op_kernels to avoid colliding with that report sheet name and to reflect that each row is a per-op kernel. Update indexes, ingest, docs diagram, and tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Document what each test in test_trace_index.py verifies so the suite reads as a table of contents for the catalog behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
Add an example-queries section to the trace-index how-to showing depthwise convolution and longest-context attention lookups against the shape satellite tables, so shape questions are SQL filters rather than trace reopens. Co-authored-by: Cursor <cursoragent@cursor.com>
Include sample result tables and short takeaways for the depthwise-convolution and longest-attention example queries so the how-to shows the payoff of the shape satellite tables, not just the SQL. Co-authored-by: Cursor <cursoragent@cursor.com>
Catalog ingest is append/build only. Remove the unused directory scanner and stop exporting import_report_dir; existing CSV reports go through append --report-dir. Tests for real report fixtures now use that public path. Co-authored-by: Cursor <cursoragent@cursor.com>
The HTTP query server and sqlite-sql intentionally run caller-provided SELECT statements. They are already restricted to a single read-only statement and opened with SQLite query_only/mode=ro. Add CodeQL suppressions so that expected use is not reported as SQL injection. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover health, tables, GET/POST /query, write rejection, 404s, and result truncation. Close SQLite connections in the handler; a connection context manager does not close the DB and leaked handles in tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Extract write_stub_trace/write_mini_report fixtures, use a query_server context manager for HTTP server lifecycle, and merge the two server test functions. Drop redundant store-boundary test covered by append/import paths. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ajassani
requested review from
devalshahamd,
gabeweisz and
tsrikris
as code owners
August 30, 2026 23:12
gabeweisz
previously approved these changes
Aug 31, 2026
tsrikris
previously approved these changes
Aug 31, 2026
ajassani
dismissed stale reviews from tsrikris and gabeweisz
September 2, 2026 20:43
The base branch was changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Tracks #983.
Addresses Kyle's #674 review on
TraceIndex/utils.py: replace inline kernel-library heuristics with shared classification used by agent analysis.TraceLens/PerfModel/kernel_library.py—classify_kernel_library(extracted fromanalysis_utils)kernel_name_parser(is_rocm_gemm,is_cuda_gemm); extend when Improve GEMM kernel parsing #805 mergeskernel_flagsdelegates to shared classifier; passes parent op name during importanalysis_utilsimports shared module (no duplicate rules)Stacked on #674 so kernel-library refactor lands separately from TraceIndex core.
Test plan
pytest tests/test_kernel_library.pypytest tests/test_analysis_agent_utils.py::test_classify_kernel_librarypytest tests/test_trace_index.py