one2piece2hello/faibench_frontier_infrabench/numerics-debugging
Claude Code and agent skill by one2piece2hello/faibench_frontier_infrabench
- community
Checking that the SKILL.md file is still in the repository.
Capture and compare per-op activations between two TorchTitan runs to spot numerics divergence (eager vs aot_fx_trace, FSDP vs no-FSDP, before vs after a refactor). Use when the user wants to debug bitwise / numeric drift in training, or invokes /numerics_debugging.
Install
npx vskill@latest install one2piece2hello/faibench_frontier_infrabench/numerics-debuggingSKILL.md
Numerics Debugging (DebugMode-based)
Per-op activation capture + comparison toolkit. Captures activations on a designated step via torch.utils._debug_mode.DebugMode, then diffs two captures into an HTML report to surface numerics divergence between runs that should agree (bitwise, or within float32 reduction-order noise).
Two pieces live in agent_tooling/numerics_debugging/:
activation_tracer.py— runtime capture, driven fromProfilerby
ActivationCaptureProfiler. Output: {dump_folder}/numerics/rank_{N}_activations.log.
compare_numerics.py— diffs two logs, produces an HTML report.
agent_tooling/ sits outside the torchtitan package on purpose. Nothing in core torchtitan or graph_trainer references it; an agent must edit torchtitan to wire it in before a capture run, and revert the edits when done (they don't belong on main).
The two runs being compared must use the same dtype and seed. Thematcher keys on shape + float64 L1 norm; a precision change (bf16 vsfp32) makes every row diverge and the matcher degrades to thestructural-onlystatspass.
Workflow
- Patch torchtitan to wire the capture into
Profiler(and
graph_trainer if you're capturing the traced path). Full patch set: references/patching.md.
- Capture twice, once per run you want to compare:
``bash ./run_train.sh \ --dump_folder ./outputs/run_A \ --training.steps 2 \ --profiler.dump_numerics \ --profiler.profile_freq 2 \ --debug.seed 42 \ --debug.deterministic \ --training.mixed_precision_param float32 ` The capture step is profile_freq. With profile_freq=2 and training.steps=2`, step 1 warms up and step 2 is the snapshot. Capture adds ~10–40% memory only on the capture step (stats are computed inline in float64; tensors aren't held).
- Diff the two logs:
``bash python -m agent_tooling.numerics_debugging.compare_numerics \ outputs/run_A/numerics/rank_0_activations.log \ outputs/run_B/numerics/rank_0_activations.log \ --name1 run_A --name2 run_B \ -o diff.html ` Open diff.html`. Each row pairs one op from each run; cells turn red when a stat diverges; the "Match method" chip shows which of the four matching passes (override / exact key / fuzzy key / stats) paired the row.
Customizing
Excluded ops, numel / dtype filter, hash function, the manual-override file format, and HTML appearance are all tunable. See references/customization.md, which also catalogs the common eager-vs-traced mismatch patterns (AC-recompute FQN drift, per-layer counter shifts, collective renaming) you'll see in the diff and how to express them as overrides.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtasks/lh/wli-torchtitan-gptoss-expert-compute/environment/repo/.claude/skills/numerics_debugging/SKILL.md
Popularity
- Repository stars
- 69
- Repository forks
- 4
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/one2piece2hello/faibench_frontier_infrabench/numerics-debugging)