sglang-diffusion-benchmark-profile

sglang-diffusion-benchmark-profile is a skill for Claude Code from sgl-project/sglang. It costs 26 tokens per session (2,229 once invoked), scanned A, original, Apache-2.0.

A benchmarking and profiling guide for SGLang's image-generation diffusion code. It measures denoising speed and helps locate the operations causing slowdowns.

In plain words
What is it for?
Use it to run denoising benchmarks, capture profiler traces, rank slow operations, compare performance before and after changes, and check known fast paths.
Why use it?
It helps distinguish a real performance bottleneck from measurement noise before changing low-level code. It also checks whether an existing optimization already addresses the problem.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to run denoising benchmarks, capture profiler traces, rank slow operations, compare performance before and after changes, and check known fast paths.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sgl-project/sglang/sglang-diffusion-benchmark-profile
About the project

SGLang is a framework for running inference for large language models and multimodal models, meaning it processes inputs to produce model outputs such as text or other media. It is used to serve and accelerate open AI models and related workloads.

sgl-project/sglang · 35,682 stars · on GitHub · sglang.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sgl-project/sglang --skill sglang-diffusion-benchmark-profile
Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sglang-diffusion-benchmark-profile

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-benchmark-profile/github.svg)](https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-benchmark-profile)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-benchmark-profile"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-benchmark-profile/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sglang-diffusion-benchmark-profile

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-benchmark-profile"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-benchmark-profile.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,229 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.02229
Opus 5 $0.00013 $0.01115
Sonnet 5 $0.00005 $0.00446
Haiku 4.5 $0.00003 $0.00223

Measured 3d ago against content hash 2a6a9e168af8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sglang-diffusion-benchmark-profile scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/bench_diffusion_denoise.py, scripts/diffusion_skill_env.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

python/sglang/multimodal_gen/.claude/skills/sglang-diffusion-benchmark-profile/SKILL.md · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SGLang Diffusion Benchmark and Profile

Use this skill when measuring denoise performance, finding the slow op, checking whether an existing fast path can solve it, or verifying that a hotspot is real before any kernel work in sglang.multimodal_gen.

This skill is diagnosis-first. It owns:

  • checked-in denoise benchmark presets
  • same-GPU quality/BCG applicability checks with repeated lossless, extra-high, and high rows
  • perf dump collection and before/after comparison
  • torch.profiler trace capture and quick hotspot ranking
  • mapping hot kernels back to known fast paths and fusion families
  • packaging confirmed kernel work with enough evidence for the appropriate kernel, Nsight, or framework-specific optimization workflow

This skill does not own low-level kernel authoring or standalone Nsight workflows.

Preflight

Before running any benchmark, profiler, or kernel-validation command:

  • use scripts/diffusion_skill_env.py to derive the repo root from sglang.__file__
  • verify the repo is writable
  • export HF_TOKEN before using gated Hugging Face models such as black-forest-labs/FLUX.*
  • export FLASHINFER_DISABLE_VERSION_CHECK=1
  • set SGLANG_DIFFUSION_SYNC_STAGE_PROFILING=1 when comparing stage-level denoise/decode timings; the preset helper sets it by default unless the caller explicitly overrides it
  • for downloaded checkpoints, use the preset helper's task-owned --model-cache-root together with --cleanup-model-cache; verify the JSONL ledger reports zero residual weight files before moving to the next model
  • choose idle GPU(s) before starting perf work; for a comparison matrix, hold the same GPU set and verify it has no foreign process at every run boundary

Native Backend Gate

All diffusion benchmark and profiling results owned by this skill must come from the native SGLang diffusion backend.

Treat any of the following as a hard stop condition:

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

Read the full file on GitHub · 146 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · +2 lines 2a6a9e168af8
  2. 7d ago Changed 88aa2ac4d993
  3. 10d ago First seen · 144 lines · 26 tokens per session scan A 7ace3382cc48

Subscribe to this mod's changes

sglang-diffusion-benchmark-profile is a skill published in the GitHub repository sgl-project/sglang (35,682 stars, last pushed today), licensed Apache-2.0. It adds 26 tokens to every session and 2,229 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.