Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

sglang-torch-profiler-analysissglang torch profiler 分析

Agent Skill

sglang-torch-profiler-analysis 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

364

周安装

15

GitHub Stars

143

下载量

119
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sglang-torch-profiler-analysis(sglang torch profiler 分析)
来源仓库:https://github.com/bbuf/sglang-auto-driven-skills
仓库路径:skills/sglang-torch-profiler-analysis
安装命令:
npx skills add https://github.com/bbuf/sglang-auto-driven-skills --skill sglang-torch-profiler-analysis
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/bbuf/sglang-auto-driven-skills --skill sglang-torch-profiler-analysis

简介

sglang-torch-profiler-analysis 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 适用于分析 sglang 与 PyTorch 集成的性能瓶颈,如推理延迟或内存占用问题。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 可结合来源仓库和 SKILL.md 继续核验功能细节,确保与项目需求匹配。

SKILL.md

SGLang Torch Profiler Analysis

Overview

Use this skill for SGLang torch.profiler analysis.

There is only one public workflow:

  • triage

Use the unified entrypoint:

triage always prints the same three tables:

  • kernel table
  • overlap-opportunity table
  • fuse-pattern table

By default, all three tables only render rows at or above 1.0% cumulative GPU-time share. Treat anything below that as noise unless the user explicitly asks for a lower cutoff.

The script-level fuse-pattern table should stay source-backed and deterministic. Do not build a fuzzy string-matching engine into the script for typo-tolerance.

If exact/source-backed matching is weak but the agent judges that a cluster of kernels still looks semantically close to a known pattern, add a short AI note after the table with one of these labels:

  • high: very likely the same pattern family; naming drift or minor implementation reshaping is the main uncertainty
  • medium: several signals line up, but one important piece is still ambiguous
  • low: weak resemblance only; mention it only if it is still worth a human follow-up

When To Use It

  • inspect an SGLang torch profiler trace or profile directory
  • profile a live SGLang server and immediately analyze the output
  • summarize which kernel families dominate prefill or decode
  • map kernels back to Python code paths
  • judge whether a code path still has overlap headroom
  • check whether an already-known fusion or overlap path should have applied

Diffusion Backend Gate

For diffusion benchmark or profiling work, only analyze traces produced by the native SGLang diffusion backend.

If the run that generated the trace logs any of:

  • Falling back to diffusers backend
  • Using diffusers backend
  • Loaded diffusers pipeline

stop the workflow instead of analyzing the trace. Treat it as a backend-selection issue, not as valid SGLang diffusion profiler evidence.

Main Flows

1. Single-trace triage from an existing profile dir or trace

python3 scripts/analyze_sglang_torch_profile.py \
  --input /path/to/profile_dir_or_trace.json.gz

Use this when you want the fastest read on kernel share and likely fused-kernel pattern matches. The overlap table stays conservative in single-trace mode and will tell you when a mapping/formal pair is needed.

2. Single-trace triage from a running server

python3 scripts/analyze_sglang_torch_profile.py \
  --url http://127.0.0.1:30000 \
  --num-steps 5 \
  --profile-by-stage

3. Two-trace triage from existing profile dirs or traces

python3 scripts/analyze_sglang_torch_profile.py triage \
  --mapping-input /path/to/graph_off_profile_dir \
  --formal-input /path/to/graph_on_profile_dir

Use this when you need stronger overlap conclusions and cleaner kernel-to-source attribution.

4. Two-trace triage from running servers

python3 scripts/analyze_sglang_torch_profile.py triage \
  --mapping-url http://127.0.0.1:31025 \
  --formal-url http://127.0.0.1:31026 \
  --num-steps 5 \
  --profile-by-stage

profile_by_stage

profile_by_stage is not only for PD disaggregation.

  • On ordinary non-PD serving, it is still useful because prefill and decode usually have very different bottlenecks.
  • On the current profile-v2 path inside SGLang, stage-based profiling is effectively the normal path.
  • PD-disaggregated serving adds one extra rule: prefill workers and decode workers must be profiled separately. That is stricter than ordinary profile_by_stage.

How To Choose The Triage Shape

Single-trace triage

Use when you want the lowest-friction report:

  • one trace is already available
  • you mainly want kernel share and fusion clues
  • you are comparing two runs side by side by running triage once per trace

This is the recommended default.

Two-trace triage

Use when you need:

  • a stronger answer about overlap headroom
  • graph-off source mapping plus graph-on final behavior
  • more trustworthy overlap recommendations in the middle table
  1. mapping trace with --disable-cuda-graph --disable-piecewise-cuda-graph
  2. formal trace with the real serving optimizations enabled

Do not call the mapping pass a "fast profile". It exists to recover kernel -> cpu_op -> python scope.

Workflow

Single-trace workflow

  1. If the user only wants a quick diagnosis, one trace is enough.
  2. Prefer rank-local TP-0 traces over merged traces.
  3. For a live server, this skill can call sglang.profiler and automatically send a small probe request.
  4. Prefer --profile-by-stage even on standard serving unless the user explicitly wants an all-stage mixed trace.

Two-trace workflow

  1. Produce a mapping trace first with graph disabled.
  2. Produce a formal trace second with graph enabled and the real serving flags kept on.
  3. Run triage for the compact three-table report.
  4. Read the results in this order:

- kernel table - overlap-opportunity table - fuse-pattern table

  1. Before calling something a "new" optimization idea, compare the top rows against both references/fuse-overlap-catalog.md and references/overlap-catalog.md. Check mainline rows first, then the PR-backed / in-flight sections for still-moving upstream work. Prefer reporting:

- an existing fused or overlap path that should already apply here - an existing path that appears disabled, unsupported, or regressed in this trace - an upstream pattern that is mainline elsewhere but missing locally, or still open upstream - a truly new opportunity only when no catalog entry fits

  1. If no exact pattern fully matches but the trace still looks semantically close to a known family, add one flat AI similarity judgment note after the tables. Use high, medium, or low only. Base that note on the full pattern shape, not on one kernel name alone. Prefer semantic cues such as producer-consumer chain, source locations, CPU op names, TP context, and model-specific structure. Do not rewrite the script table itself to include these heuristic judgments.

References

Load these only when needed:

- upstream SGLang profiler entrypoints and trace-writing source paths

- overlap labels, dependency-risk interpretation, and limits

- mixed source-backed catalog of existing fuse and overlap patterns, including mainline rows plus PR-backed / in-flight rows

- overlap-only lookup table across LLM, VLM, diffusion, disaggregation, HiSparse, and speculative scheduling

Output Contract

Return:

  • trace path or generated profile path
  • model/server args when available
  • kernel table
  • overlap-opportunity table
  • fuse-pattern table
  • optional AI similarity judgment note with high / medium / low when exact matching is inconclusive
  • one short conclusion about what dominates the run
  • whether the overlap conclusion came from single-trace triage or mapping/formal two-trace triage

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.75%
按下载量换算43

Claude

27.29%
按下载量换算32

Cursor

18.16%
按下载量换算22

Gemini CLI

8.99%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills