Skip to content

Feat/gw rename directories#750

Draft
gabeweisz wants to merge 8 commits into
mainfrom
feat/gw_rename_directories
Draft

Feat/gw rename directories#750
gabeweisz wants to merge 8 commits into
mainfrom
feat/gw_rename_directories

Conversation

@gabeweisz

Copy link
Copy Markdown
Collaborator

Follow the skills spec here

Note that we fudged a bit with the sub-agent directory, but it worked in cursor

HOLD UNTIL AFTER AI DAY. Need to run evals too.

Ran test with agent --print --force --trust --output-format stream-json "set TL_EXTENSION=TraceLens_internal for all operations and commands. Use the full Tracelens Agent Analysis using venv_tracelens_refactor to analyze ~/torch_trace_output and put the results in ~/torch_trace_output_refactor"
analysis.md
perf_improvement

tsrikris and others added 5 commits June 16, 2026 10:45
Heuristic Findings Ordering
## Summary

Replace the heuristic `_extract_launcher_path()` with the pre-computed
`entry_point` column from `unified_perf_summary`, and switch
`module_chain`/`call_chain` extraction to parse the new
`call_stack_full` format.
This PR accompanies #743. All
changes in #743 are in this PR.

---

## Problem

The agent's `_extract_launcher_path()` re-derived the dispatch entry
point at analysis time by walking the old `" => "`-delimited
`call_stack` string from `unified_perf_callstacks.csv`.

Now that `unified_perf_callstacks.csv` has been replaced by two columns
`entry_point` and `call_stack_full` in `unified_perf_summary`, the agent
can use `entry_point` for the `Kernel Path` column in the tables.
`extract_module_chain` and `extract_call_chain` can use
`call_stack_full`.

## Changes

**`orchestrator_prepare.py`** — Removed the
`unified_perf_callstacks.csv` join block. `entry_point` and
`call_stack_full` are now columns in `unified_perf_summary.csv` and flow
directly to per-category CSVs.

**`analysis_utils.py`**:
- `build_operation_metrics()`: reads `row["entry_point"]` as primary
`launcher_path`. When `entry_point` is `"Not found"`, falls back to
module chain (`"LlamaModel > LlamaDecoderLayer > LlamaMLP"`), then
library name (`"Triton (vendor)"`), then `"Not found"`. Reads
`row["call_stack_full"]` for `module_chain`/`call_chain`.
- Added `_parse_call_stack()`: parses `call_stack_full` (Python list
repr) via `ast.literal_eval`, keeping only top-level string frames and
discarding nested sublists. The sublists represent diverging kernel
tails in multi-kernel ops — they contain GPU kernel names that the agent
doesn't use in prose context.
- Deleted `_extract_launcher_path()`, `_extract_backward_context()`, and
`_SKIP_PY_PATTERNS`.

---------

Co-authored-by: gabeweisz <162640284+gabeweisz@users.noreply.github.com>
Add kernel name information to TraceLens Agent output tables. Kernel
Name comes from `call_stack_full` column in `unified_perf_summary`.

If there is only one kernel called by the CPU op, the column looks like:
| Operation | Args | Kernel Path | Kernel Name | Time (ms) | %E2E |
Count | FLOPS/Byte | Efficiency | Bound |

|-----------|------|-------------|-------------|-----------|------|-------|------------|------------|-------|
| aten::addmm | — | — | nvjet_tst_64x64_64x16_2x1_2cta_v_bz_bias_TNT | —
| — | — | — | — | — |
| aten::addmm | — | — | nvjet_tst_64x16_64x16_2x4_2cta_h_bz_bias_TNT | —
| — | — | — | — | — |
| aten::mm | — | — | nvjet_tst_192x8_64x8_4x1_v_bz_TNT | — | — | — | — |
— | — |

If there are multiple kernels it looks like:
| Operation | Args | Kernel Path | Kernel Name | Time (ms) | %E2E |
Count | FLOPS/Byte | Efficiency | Bound |

|-----------|------|-------------|-------------|-----------|------|-------|------------|------------|-------|
| vllm::moe_forward | — | — | Kernel 1: void
moe::dev::routing::routingRenormalize::routingIndicesHistogramScoresKe...<br>Kernel
2: void
moe::dev::routing::routingIndicesOffsetsKernel<moe::dev::routing::rout...<br>Kernel
3: void
tensorrt_llm::kernels::quantize_with_block_size<(tensorrt_llm::BlockSc...<br>Kernel
4: void
moe::dev::routing::routingIndicesHistogramKernel<moe::dev::routing::ro...<br>Kernel
5: void
moe::dev::finalize::finalizeKernelVecLoad<moe::dev::finalize::KernelPa...<br>Kernel
6:
bmm_Bfloat16_MxE2m1MxE4m3_Fp32_t128x16x256u2_s3_et128x16_m128x16x32_cga1x1x...<br>Kernel
7:
bmm_MxE4m3_MxE2m1MxE4m3_Fp32_t128x16x256u2_s3_et128x16_m128x16x32_cga1x1x1_...
| — | — | — | — | — | — |

The kernel name is truncated to include the first 75 characters (better
kernel name shortening strategy can be explored later).
Co-authored-by: Cursor <cursoragent@cursor.com>
Move eval-post-processing, workflow-llm-eval, and quality-llm-eval into
skills/<name>/SKILL.md and reference.md, remove .cursor/skills, and update
README and EVAL_RUBRICS paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
Base automatically changed from staging_agent to main June 19, 2026 20:16
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.

3 participants