服务端 Profiling
SkillDev toolsCapture torch.profiler traces on a running FlashRec server. Use when the user asks to profile, trace, Chrome trace, start_profile, stop_profile, sglang.bench_serving --profile, or 性能剖析.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the 服务端 Profiling skill
What this skill tells your AI
The instructions your AI receives, as published by sohu-mptc/flashrec in .claude/skills/profile-serving/SKILL.md and read by ahel’s review.
接口与 SGLang 对齐,可直接给 sglang.bench_serving --profile 用。start/stop
在 GPU worker 线程上生效——不要在 HTTP 线程上包 torch.profiler。
采集
默认输出目录:FLASHREC_TORCH_PROFILER_DIR → SGLANG_TORCH_PROFILER_DIR → /tmp。
scripts/serve.sh 会设成仓库下 profiles/。
curl -s -X POST http://127.0.0.1:8000/start_profile \
-H 'Content-Type: application/json' \
-d '{"output_dir":"./profiles","num_steps":20,"activities":["CPU","GPU"],"with_stack":true}'
curl -s -X POST http://127.0.0.1:8000/stop_profile
到 num_steps 会自动停。Body:output_dir、num_steps、start_step、
activities(CPU/GPU)、profile_by_stage、with_stack、record_shapes、
profile_prefix。
Chrome trace 区间名:flashrec.batch.wait / prefill / decode_fwd /
expand / finalize。
解读
- 窄 beam + 低并发:
batch.wait或单请求开销主导,不要据此调 graph - 宽 beam:看
expand是否在 CUDA graph 内;eager expand 说明bs % n != 0或捕获宽度不够 finalize过重:检查FLASHREC_DENSE_FINALIZE(默认1)- 对照 SGLang 时两侧都要用 FlashInfer,并关掉 SGLang overlap schedule
Signals
- GitHub stars
- 104
- Forks
- 4
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
profile-serving- Source
- github.com/sohu-mptc/flashrec