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 skills add redai-infra/Relax --skill perf-doctorgit clone --depth 1 https://github.com/redai-infra/RelaxWrote 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/redai-infra/relax/perf-doctor)<a href="https://agentmods.dev/skills/redai-infra/relax/perf-doctor"><img src="https://agentmods.dev/badge/skills/redai-infra/relax/perf-doctor/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.
<a href="https://agentmods.dev/skills/redai-infra/relax/perf-doctor"><img src="https://agentmods.dev/badge/skills/redai-infra/relax/perf-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00089 | $0.01212 |
| Opus 5 | $0.00044 | $0.00606 |
| Sonnet 5 | $0.00018 | $0.00242 |
| Haiku 4.5 | $0.00009 | $0.00121 |
Grade A, and why
perf-doctor 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 11d 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 — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
perf-doctor
诊断 Relax 训练启动脚本(scripts/training/**/*.sh),找出影响 执行性能(耗时 / MFU) 或 显存占用(所需卡量) 的不合理配置。
使用方式
/perf-doctor scripts/training/text/run-qwen36-35B-A3B-8xgpu.sh
参数:单个启动脚本绝对或相对路径。
执行步骤
- 读取脚本 — 收集
*_ARGS=( ... )数组与ray job submit ... train行里的所有--flag value。同时 followsource ${MODEL_CONFIG_DIR}/...拿模型架构(dense / MoE、是否 multimodal)。 - 抽取 context —
- 文件名解析:
run-<model>-<size>-<NxgpuY>(-async|-image|-video)?.sh→ 总 GPU 数、节点数、模式、模态 - flag 解析:TP/PP/CP/EP/ETP、
--colocatevs--fully-async、--rollout-max-response-len、--max-tokens-per-gpu、--resource、--num-iters-per-train-update、--max-staleness、--num-data-storage-units - 默认 GPU 假设:H20 96GB,除非用户在 prompt 里给出别的(A100 80G / H100 80G 等)
- 文件名解析:
- 加载规则 — 读
references/rules.md,逐条判断 applies / borderline / not-applicable - 对照 baseline — 读
references/baselines.md,若用户脚本与某条 baseline 同模型 + 同 GPU 数量级,把 baseline 的并行 / batch / mem 配置作为合理区间锚点;偏离 ≥ 2 档时把 baseline 数值写进对应 finding 的Cost一栏佐证 - 输出报告 — 严格按下方 输出模板 渲染
触发判断原则
- 不要机械触发:CPU offload 三件套在 35B-A3B 4×H20 这种边界 case 是必需的;规则
Skip when节里写了什么时候它就是对的,要尊重 - 不要 false positive:脚本里如果有
# NOTE(...)注释解释为什么开 / 关某个 flag,把它当作有效理由,降级到 info 或跳过 - 借助推理而非穷举:
references/rules.md是知识库不是判定表 — 模型大小 × dtype 估算显存预算、TP×CP×PP 是否合理、async 资源比是否平衡,都要 case-by-case 算
输出模板
# perf-doctor: <script-name>
**Context:** model=<X> (<dense|MoE>, <text|mm|video>) · GPUs=<N> (<nodes>×<g/n>) · mode=<colocate|fully-async> · TP<x>/PP<x>/CP<x>/EP<x>/ETP<x> · max-resp-len=<X> · GPU=H20 96GB (assumed)
---
## 🚀 Performance findings
### [WARN] R-P0X — <short title>
- **Setting:** `--flag value`(脚本行号或所在 ARGS 组)
- **Cost:** <估算的 MFU / 耗时影响>
- **Fix:** <可直接照抄的 flag 修改>
- **Skip if:** <什么情况下当前设置反而是对的>
(more findings...)
## 💾 Memory findings
### [WARN] R-M0X — <short title>
- **Setting:** `--flag value`
- **Cost:** <显存影响 / 卡量影响>
- **Fix:** <修改建议>
- **Skip if:** <justified condition>
(more findings...)
---
## Summary
- Critical: N · Warn: N · Info: N
- **Top action:** <一句话最该改的>
What ships with it
2 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.
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.
- 11d ago First seen · 86 lines · 89 tokens per session scan A 5318dcab0ecb
perf-doctor is a skill published in the GitHub repository redai-infra/Relax (580 stars, last pushed 13d ago), licensed Apache-2.0. It adds 89 tokens to every session and 1,212 once invoked, about $0.0004 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
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.