Step-by-step tutorial for adding a new lightweight JIT CUDA kernel to sglang.kernels JIT infrastructure and public operator groups
日本語の概要は準備中です。原文の説明を表示しています。
Generate an e2e profiling trace of an SGLang server run. Launches a server, validates accuracy, captures a Chrome-compatible trace, and returns the profile path.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
This skill launches an SGLang server, validates it with a quick accuracy test, generates a profiling trace, and returns the profile file path.
pip install -e . or equivalent)CUDA_VISIBLE_DEVICES=<gpu_id> sglang serve --model-path <model> --port <port> &
Qwen/Qwen3-8B (good balance of speed and quality)30000Poll the health endpoint until the server is ready:
for i in $(seq 1 120); do
if curl -s http://127.0.0.1:<port>/health 2>/dev/null | grep -q "ok\|healthy"; then
echo "Server ready"
break
fi
sleep 5
done
The server prints "The server is fired up and ready to roll!" to stdout when ready. The health endpoint returns 200 once the server can accept requests.
Typical startup time: 30-90 seconds depending on model size and whether CUDA graphs are being compiled.
sgl-eval run gsm8k --base-url http://127.0.0.1:<port>/v1 --num-examples 20
python3 -m sglang.test.send_one --profile
This command:
/tmp/<timestamp>/<timestamp>-TP-0.trace.json.gz — Chrome trace format (open in chrome://tracing or Perfetto)server_args.json — the server configuration usedOutput format:
Dump profiling traces to /tmp/<timestamp>
The profile path is printed to stdout. Parse it from the output.
Optional flags:
--profile-steps N — number of profiling steps (default: 5)--profile-by-stage — profile by stage (prefill/decode separately)--profile-prefix <path> — custom output prefixpkill -9 -f "sglang.launch_server\|sglang serve\|sglang.srt"
Wait a moment and verify no sglang processes remain:
sleep 2 && pgrep -af "sglang serve" || echo "Server killed"
Return the profile directory path (e.g., /tmp/1773999986.4769795) and list its contents so the user knows what files were generated.
# 1. Launch server
source cleanup/bin/activate
CUDA_VISIBLE_DEVICES=1 sglang serve --model-path Qwen/Qwen3-8B --port 30000 &
# 2. Wait for ready
for i in $(seq 1 120); do
curl -s http://127.0.0.1:30000/health | grep -q "ok" && break
sleep 5
done
# 3. Accuracy check
python3 -m sglang.test.run_eval --host 127.0.0.1 --port 30000 --eval-name gsm8k --num-examples 20
# Expected: Accuracy > 0.8
# 4. Profile
python3 -m sglang.test.send_one --profile
# Output: "Dump profiling traces to /tmp/1773999986.4769795"
# 5. Cleanup
pkill -9 -f "sglang.launch_server\|sglang serve\|sglang.srt"
sleep 2
# 6. Check output
ls -la /tmp/1773999986.4769795/
# 1773999986.4851577-TP-0.trace.json.gz (Chrome trace)
# server_args.json (server config)
--port <port> and use --host 127.0.0.1 --port <port> for test commands--tp <N> for tensor parallelism; trace files will be generated per TP rank--profile-steps 10 for more steps in the trace--profile-by-stage to separate prefill and decode phasesOpen the .trace.json.gz file in:
chrome://tracing (load the file)Both support the gzipped Chrome trace format natively.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Step-by-step tutorial for adding a new lightweight JIT CUDA kernel to sglang.kernels JIT infrastructure and public operator groups
日本語の概要は準備中です。原文の説明を表示しています。
Step-by-step tutorial for adding a heavyweight AOT CUDA/C++ kernel to sgl-kernel (including tests & benchmarks)
日本語の概要は準備中です。原文の説明を表示しています。
Start and persistently pursue a goal to babysit an SGLang pull request until selected GitHub Actions workflows pass on the latest PR head. Use when asked to monitor, babysit, retry, or fix PR CI for lint.yml, pr-test.yml, pr-test-extra.yml, AMD, or other named workflows; classify failures as PR-related versus flaky or infrastructural, auto-fix and push only small clean fixes, rerun failed jobs only up to 10 times, and ignore unselected workflows.
日本語の概要は準備中です。原文の説明を表示しています。
Audit the existing test tree and CI configuration for improvements, using a catalog of patterns previously applied in this repo. Use when asked to audit tests or CI, shrink CI time or cost, find redundant or misplaced tests, clean up a test group, or review whether a CI change follows established practice.
日本語の概要は準備中です。原文の説明を表示しています。
Guide to SGLang CI workflow orchestration — stage ordering, fail-fast, gating, partitioning, execution modes, and debugging CI failures. Use when modifying CI workflows, adding stages, debugging CI pipeline issues, or understanding how tests are dispatched and gated across stages.
日本語の概要は準備中です。原文の説明を表示しています。
Audit SGLang startup logs, save evidence, and propose cleanup for user review. With no arguments, run Qwen3-8B at TP1 and TP2 plus gpt-oss-20b at TP1.
日本語の概要は準備中です。原文の説明を表示しています。