sglang-torch-profiler-analysis

Analyze SGLang torch-profiler traces to map GPU kernels to Python frames and CPU ops.

9|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/Fridge003/sglang-dev-tools --skill sglang-torch-profiler-analysis-fridge003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sglang-torch-profiler-analysis
Source: https://github.com/Fridge003/sglang-dev-tools/tree/main/ai-wheels/.claude/skills/sglang-torch-profiler-analysis
Command: npx skills add https://github.com/Fridge003/sglang-dev-tools --skill sglang-torch-profiler-analysis-fridge003

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Analyzes SGLang torch-profiler traces to map GPU kernel events to Python frames and CPU ops, enabling quick insights into overlap and fusion opportunities.

Core Features & Use Cases

  • Unified three-table triage: kernel mapping, overlap opportunities, and fuse opportunities.
  • Two-trace analysis workflow: mapping trace plus formal trace for real overlap assessment.
  • Perfetto-friendly post-processing: optional trace repair to improve Perfetto rendering.
  • Detailed source attribution: recovers Python locations for kernels and exposes actionable deployment insights.

Quick Start

Invoke the unified analysis to produce three tables from your traces: kernel mapping, overlap opportunities, and fuse opportunities.

Frequently Asked Questions about sglang-torch-profiler-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze SGLang torch-profiler traces to find GPU kernel overlap opportunities?

To analyze SGLang torch-profiler traces for overlap opportunities, you can use a unified analysis workflow that maps GPU kernels to Python frames and CPU ops. It reads trace JSONs, builds kernel maps, and outputs compact tables plus an ASCII timeline to reveal actionable deployment insights.

What is the best way to attribute GPU kernels to Python frames in a torch-profiler trace?

Attributing GPU kernels to Python frames in a torch-profiler trace involves reading the trace JSON and building a kernel map. This process recovers Python locations for kernels, enabling detailed source attribution and exposing actionable deployment insights for SGLang servers.

Can I run torch-profiler trace analysis on stored trace files instead of a live SGLang server?

Yes, torch-profiler trace analysis is applicable to both tracing from running SGLang servers and from stored trace files or directories. You can analyze existing trace JSONs directly without needing a live server connection.

How does two-trace triage work for SGLang profiler overlap analysis?

Two-trace triage for SGLang profiler overlap analysis uses a mapping trace plus a formal trace for real overlap assessment. This workflow produces a unified three-table triage: kernel mapping, overlap opportunities, and fuse opportunities.

Does this torch-profiler analysis workflow support Perfetto trace rendering?

Yes, the torch-profiler analysis workflow includes Perfetto-friendly post-processing with optional trace repair to improve Perfetto rendering. This ensures the generated trace JSONs are compatible and display correctly within the Perfetto UI.

What do I need to set up before analyzing SGLang torch-profiler traces?

To analyze SGLang torch-profiler traces, you need the included Python scripts and the proper server configuration. The analysis reads trace JSONs from either a running SGLang server or stored directories to build kernel maps and output tables.