sglang-torch-profiler-analysis

Analyze SGLang torch-profiler traces to rank GPU kernels and identify optimization opportunities.

Updated Jun 16, 2026
One-click install
npx skills add https://github.com/spacecat2002/oscar --skill sglang-torch-profiler-analysis-spacecat2002
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sglang-torch-profiler-analysis
Source: https://github.com/spacecat2002/oscar/tree/main/sglang-research/.claude/skills/sglang-torch-profiler-analysis
Command: npx skills add https://github.com/spacecat2002/oscar --skill sglang-torch-profiler-analysis-spacecat2002

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill turns complex SGLang torch-profiler traces into a compact diagnosis of dominant kernels, overlap headroom, and likely fusion opportunities, reducing the effort required to identify performance bottlenecks.

Core Features & Use Cases

  • Kernel Triage: Rank GPU kernels by stage, runtime share, category, launch count, CPU operation, and mapped Python location.
  • Overlap Analysis: Compare graph-off mapping traces with formal graph-on traces to identify exposed work, hidden work, dependency risk, and practical overlap recommendations.
  • Fusion Detection: Match trace patterns against source-backed SGLang fusion and overlap catalogs while distinguishing existing, disabled, unsupported, regressed, and upstream in-flight optimization paths.
  • Live or Offline Workflows: Analyze existing trace files and profile directories or trigger profiling against a running SGLang server, including separate prefill and decode views.
  • Use Case: When decode latency is dominated by attention preparation and MoE support kernels, use this Skill to map those kernels back to source code and determine whether an existing fusion or dual-stream path should apply.

Quick Start

Ask the Skill to triage the SGLang torch-profiler trace or profile directory at the provided path and return the kernel, overlap-opportunity, and fuse-pattern tables.

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 bottlenecks?

To analyze SGLang torch profiler traces, you can triage existing trace files or directories to rank dominant GPU kernels by runtime share and launch count. This identifies performance bottlenecks and maps them to source-backed Python locations.

How does kernel fusion detection work for SGLang GPU performance optimization?

Kernel fusion detection for SGLang GPU performance matches trace patterns against source-backed fusion and overlap catalogs. It distinguishes existing, disabled, unsupported, regressed, and upstream in-flight optimization paths to find actionable opportunities.

Can I profile a live SGLang server to diagnose prefill and decode latency?

Yes, you can trigger profiling against a running SGLang server to diagnose prefill and decode latency. This live workflow generates separate stage views to map dominant attention and MoE support kernels back to source code.

What is the best way to compare graph-off and graph-on CUDA traces for overlap analysis?

The best way to compare graph-off and graph-on CUDA traces is through dependency-aware overlap analysis. This identifies exposed work, hidden work, and dependency risks to provide practical kernel overlap recommendations.

Does SGLang trace analysis require source-backed kernel attribution for accurate reporting?

Yes, SGLang trace analysis requires source-backed kernel attribution to accurately map GPU kernels to Python locations. This ensures conservative dependency-aware overlap analysis and compact tabular reporting of optimization priorities.