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.
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.
npx agentmods add skills/sgl-project/sglang/debug-cuda-crashnpx skills add sgl-project/sglang --skill debug-cuda-crashgit clone --depth 1 https://github.com/sgl-project/sglangWrote 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.
[](https://agentmods.dev/skills/sgl-project/sglang/debug-cuda-crash)<a href="https://agentmods.dev/skills/sgl-project/sglang/debug-cuda-crash"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/debug-cuda-crash.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00024 | $0.05261 |
| Opus 5 | $0.00012 | $0.02631 |
| Sonnet 5 | $0.00005 | $0.01052 |
| Haiku 4.5 | $0.00002 | $0.00526 |
Grade A, and why
debug-cuda-crash 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 6d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 658 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Tutorial: Debugging CUDA Crashes with Kernel API Logging
This tutorial shows you how to debug CUDA crashes and errors in SGLang using the @debug_kernel_api logging decorator.
Goal
When your code crashes with CUDA errors such as illegal memory access, device-side assert, out-of-bounds, or NaN/Inf, use kernel API logging to:
- Capture input tensors BEFORE the crash occurs
- Understand what data caused the problem
- Track tensor shapes, dtypes, and values through the call boundary that triggered the crash
- Detect numerical issues such as NaN, Inf, or obviously wrong shapes
Why Use Kernel API Logging?
Problem: CUDA errors often crash the program before normal debugging output is flushed.
Solution: SGLang's @debug_kernel_api decorator logs inputs before execution, so you can still see what caused the crash even after the program aborts.
What Is Covered?
The current logging coverage focuses on the highest-value kernel boundaries in SGLang:
- Custom ops registered through
register_custom_op(...) - External custom ops registered through
register_custom_op_from_extern(...) - LLM attention, linear, quantization, and multi-platform wrapper entry points
- Diffusion attention impl, linear, rotary, and custom-op wrapper entry points
- Selected direct
torch.ops.sglang.*hotspots and model-specific bypasses
This means the logging is useful for both LLM and diffusion kernel debugging, but it does not automatically cover every pure PyTorch call in the repository.
Step 1: Enable Kernel API Logging
Basic Logging (Function Names Only)
export SGLANG_KERNEL_API_LOGLEVEL=1
export SGLANG_KERNEL_API_LOGDEST=stdout
python my_script.py
Output:
================================================================================
[2026-03-19 00:47:06] SGLang Kernel API Call: RMSNorm.forward
================================================================================
[2026-03-19 00:47:06] SGLang Kernel API Call: sglang.quant_method.UnquantizedLinearMethod.apply
================================================================================
[2026-03-19 00:47:06] SGLang Kernel API Call: sglang.custom_op.fused_inplace_qknorm
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.
- 6d ago First seen · 658 lines · 24 tokens per session scan A 748f8a4449b4
debug-cuda-crash is a skill published in the GitHub repository sgl-project/sglang (35,483 stars, last pushed today), licensed Apache-2.0. It adds 24 tokens to every session and 5,261 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.
Other skills, from other repositories
perf-host-analysis
Analyze host/CPU overhead in TensorRT-LLM inference from nsys traces. Detect whether host overhead is the bottleneck using GPU idle ratio, host prep exposed ratio, and per-phase evidence. For regressions, isolate forward steps via allreduce/NVTX patterns, compare host operation breakdowns across versions, and identify…
perf-host-optimization
Profiles and optimizes TensorRT-LLM host/CPU overhead using lineprofiler (with nsys support planned). Runs iterative profile-analyze-optimize-validate rounds. Use when GPU utilization is low or optimizing PyExecutor throughput.
llama-factory
Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.
mooncake-api
Help users work with the Mooncake Python APIs for distributed storage and high-performance data transfer. Use when working with Mooncake Store (distributed KV cache), Transfer Engine (RDMA/TCP transfers), service setup (master, metadata server), PyTorch tensors in the Store, zero-copy/buffer management, batch…
release-notes
Draft concise release notes.
mooncake-ci-local
Run Mooncake pre-PR local validation through scripts/runcitest.sh. Use this skill whenever the user wants to validate a branch before opening or submitting a PR, run local CI, run ci test, check changes before PR, reproduce GitHub Actions locally, or force a full pre-submit verification. Trigger on phrases like "提交 PR…