autokernel icon indicating copy to clipboard operation
autokernel copied to clipboard

Feature Request: better profiler to identify bottleneck in performance

Open gali-leilei opened this issue 8 months ago • 2 comments

Right now profiler.py does a single workflow to identify bottlenecks

  1. temporal breakdown: where the GPU is spending time for a given job. followed by
  2. kernel classification to pinpoint the kernel to optimise.

It would be better to give the whole suites of diagnostic tools to agent:

If the repo accepts non-python package, trace-blame has native support for agent with install-skills.

gali-leilei avatar Mar 11 '26 10:03 gali-leilei

Thanks for the suggestion. We looked into all four tools:

HTA is built for distributed training analysis (multi-rank communication overlap, idle time). AutoKernel profiles a single model on one GPU so most of HTA's value doesn't apply here.

tlparse analyzes torch.compile logs. AutoKernel writes raw Triton/CUDA kernels and doesn't use torch.compile, so this is a different optimization path entirely.

mosaic analyzes memory usage. AutoKernel optimizes kernel throughput, not memory. Tangential to what we do.

trace-blame has some relevance for source-level attribution but our profiler already ranks kernels by GPU time which is exactly what the agent needs.

That said, we added opt-in flags for all of them (--export-trace, --memory-snapshot, --torch-compile-log) in case anyone finds them useful for debugging. They don't change the core workflow but they're there if you want them.

jaberjaber23 avatar Mar 11 '26 23:03 jaberjaber23

Great work! May I also suggest looking at nsight-python as a library for computing additional metrics? nsight-python runs ncu to extract metrics.

srib avatar Mar 12 '26 04:03 srib