perf-doctor

perf-doctor is a skill for Claude Code from redai-infra/Relax. It costs 89 tokens per session (1,212 once invoked), scanned A, original, Apache-2.0.

A checker for Relax training launch scripts. It reviews settings that affect training speed, GPU memory use, parallel work across GPUs, and the number of GPUs needed.

In plain words
What is it for?
Use it to audit a training shell script, investigate slow runs or GPU memory problems, and check parallelism, batching, rollout limits, offloading, and execution-mode settings.
Why use it?
It helps find configuration choices that make training slower or cause out-of-memory failures before a long training run starts. It also compares settings with relevant baseline configurations when available.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Good fit Use it to audit a training shell script, investigate slow runs or GPU memory problems, and check parallelism, batching, rollout limits, offloading, and execution-mode settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/redai-infra/relax/perf-doctor
Install

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.

Any agent
npx skills add redai-infra/Relax --skill perf-doctor
Clone the repo
git clone --depth 1 https://github.com/redai-infra/Relax

Made for: Claude Code.

Wrote 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.

agentmods badge for perf-doctor

README.md
[![agentmods](https://agentmods.dev/badge/skills/redai-infra/relax/perf-doctor/github.svg)](https://agentmods.dev/skills/redai-infra/relax/perf-doctor)
Your own site
<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.

agentmods 80×15 button for perf-doctor

Your own site · 80×15
<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>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,212 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 11d ago against content hash 5318dcab0ecb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

skills/perf-doctor/SKILL.md · 86 lines

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

参数:单个启动脚本绝对或相对路径。

执行步骤

  1. 读取脚本 — 收集 *_ARGS=( ... ) 数组与 ray job submit ... train 行里的所有 --flag value。同时 follow source ${MODEL_CONFIG_DIR}/... 拿模型架构(dense / MoE、是否 multimodal)。
  2. 抽取 context
    • 文件名解析:run-<model>-<size>-<NxgpuY>(-async|-image|-video)?.sh → 总 GPU 数、节点数、模式、模态
    • flag 解析:TP/PP/CP/EP/ETP、--colocate vs --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 等)
  3. 加载规则 — 读 references/rules.md,逐条判断 applies / borderline / not-applicable
  4. 对照 baseline — 读 references/baselines.md,若用户脚本与某条 baseline 同模型 + 同 GPU 数量级,把 baseline 的并行 / batch / mem 配置作为合理区间锚点;偏离 ≥ 2 档时把 baseline 数值写进对应 finding 的 Cost 一栏佐证
  5. 输出报告 — 严格按下方 输出模板 渲染

触发判断原则

  • 不要机械触发: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:** <一句话最该改的>

Read the full file on GitHub · 86 lines

Files

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.

Changes

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.

  1. 11d ago First seen · 86 lines · 89 tokens per session scan A 5318dcab0ecb

Subscribe to this mod's changes

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.

Related

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.

davila7/claude-code-templates · 51 tokens

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.

davila7/claude-code-templates · 72 tokens

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.

OpenLAIR/dr-claw · 51 tokens

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.

OpenLAIR/dr-claw · 72 tokens

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.

Orchestra-Research/AI-Research-SKILLs · 51 tokens

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.

Orchestra-Research/AI-Research-SKILLs · 72 tokens