llm-pipeline-analysis
Inspect LLM torch profiler traces at forward-pass, layer, and kernel level. Use when you need layer timings, anchor-kernel…
Parse SGLang/vLLM startup logs to explain GPU memory use and request capacity. Use for KV cache budget, mem-fraction-static comparisons, OOM triage, and max-concurrency estimates.
$ npx -y skills add BBuf/AI-Infra-Auto-Driven-SKILLS --skill llm-serving-capacity-planner --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/llm-serving-capacity-plannerContext preview
The summary Claude sees to decide when to auto-load this skill.
Parse SGLang/vLLM startup logs to explain GPU memory use and request capacity. Use for KV cache budget, mem-fraction-static comparisons, OOM triage, and max-concurrency estimates.
name: llm-serving-capacity-planner description: "Parse SGLang/vLLM startup logs to explain GPU memory use and request capacity. Use for KV cache budget, mem-fraction-static comparisons, OOM triage, and max-concurrency estimates."
Use this when a serving log has enough memory lines to explain where GPU HBM went. The analyzer reads SGLang/vLLM startup logs, extracts weight load, KV pool, CUDA graph, framework overhead, and token-capacity lines, then estimates concurrent requests for common token lengths.
For DeepSeek-V4.1, read the [KV layout and page-allocation contract](../llm-torch-profiler-analysis/references/fuse-overlap-catalog.md#paged-kv-storage-contract) before using 528 B/288 B in an estimate. These are per-stored-token payload and scale sizes, not allocation after page padding or total model KV bytes. Verify actual pool layout, compression ratios and sharing from the pinned source and logs.
Before running analysis, collect or verify these inputs:
| Item | Why it matters | How to obtain | Default if user skips | |---|---|---|---| | Log file path | Primary input; all memory data comes from here | Ask user for the serving startup log | — (required) | | GPU type | Determines total HBM for decomposition validation | Ask user or infer from log | Auto-detected from log if possible | | nvidia-smi output | Provides per-rank actual memory for cross-validation | Capture with `nvidia-smi --query-gpu=index,memory.used,memory.free --format=csv,noheader > smi.txt` | — (optional, but recommended) | | Model config.json | Enables theoretical KV cache byte calculation and replication factor analysis | Ask user for the model's config.json path | — (optional, log data used instead) | | Request token length | Determines concurrency estimate denominator | Ask user | 4096, 6144, 8192 |
The user should provide the startup log from an SGLang or vLLM serving instance. Key log lines that the analyzer needs:
Legacy `ServerArgs(...)`, `Memory profiling:` and `Capture cuda graph end.` remain accepted for older/private branch logs; they are not current main emitters.
Current vLLM V1 logs instead expose:
If the log is from a running instance, capture it by redirecting stdout/stderr to a file at launch time.
For per-rank memory comparison:
docker exec <container> nvidia-smi --query-gpu=index,memory.used,memory.free --format=csv,noheader > smi.txt
python3 skills/llm-serving-capacity-planner/scripts/capacity_analyzer.py \ --log-file /path/to/sglang.log \ --nvidia-smi-file /path/to/smi.txt \ --gpu h200 \ --config-json /path/to/config.json
For JSON output (automation):
python3 skills/llm-serving-capacity-planner/scripts/capacity_analyzer.py \ --log-file /path/to/sglang.log \ --format json
The analyzer prints:
1. **Memory breakdown table**: each category (weights, KV pool, CUDA graph, framework, other) with GiB, MiB, percentage, and derivation 2. **Per-rank comparison**: nvidia-smi data across all TP ranks 3. **KV pool detail**: pool configuration, KV dtype, replication factor, per-token byte calculation 4. **Concurrency estimate**: max concurrent requests for different token lengths 5. **Tuning notes**: configuration changes that may increase capacity
For vLLM, the report also includes a `vLLM Startup Evidence` section. Values that are not present in the log stay unknown; do not translate them into SGLang-only fields.
The inspected SGLang source reserves runtime headroom from **pre-model-load free memory**: `headroom = pre_model_load_memory * (1 - mem_fraction_static)`. The KV budget starts from currently free memory minus this headroom and other model-specific reservations. It is not `post_weight_free * fraction`. Post-capture sizing may update the pool again. Use final logged capacity and rank-local evidence; see [source contracts](../../docs/upstream-source-contracts.md).
The def
**Agent-ready skills for LLM serving benchmarks, profiler triage, capacity planning, model Day-0 support, code review, incident triage, and model PR history across SGLang, vLLM, TensorRT-LLM, and TokenSpeed — plus SGLang PR and article explainer videos.**
Inspect LLM torch profiler traces at forward-pass, layer, and kernel level. Use when you need layer timings, anchor-kernel…
Framework-independent LLM serving benchmark skill for comparing SGLang, vLLM, TensorRT-LLM, TokenSpeed, or another serving…
Analyze existing Torch Profiler Chrome traces or capture from SGLang, vLLM, TensorRT-LLM and TokenSpeed servers. Return kernel…
Return public original model architecture diagrams for user-specified LLM, VLM, MoE, diffusion, OCR, and SGLang/sgl-cookbook…
Build an operator-level compute template for an LLM and estimate FLOPs/MFU for a serving shape. Use when you need tensor shapes,…
Build or audit an evidence-driven SGLang Day-0 support program for a new LLM, VLM, MoE, hybrid-attention, or speculative-decoding…