Skip to main content
skill CX Codex

megatron-memory-estimator — Claude Code skill: memory estimates

megatron-memory-estimator is a Claude Code skill that estimates GPU memory for dense and MoE Megatron models from HuggingFace configs. Compare parallelism and check model fit.

no license ★ 158 updated 2026-07-09

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add yzlnew/infra-skills --skill megatron-memory-estimator -a claude-code
Open on GitHub

What megatron-memory-estimator does

The skill estimates memory from a HuggingFace model path or a local config.json. Its main script, scripts/estimate_from_hf.py, converts the model configuration to Megatron format and calculates memory for the chosen training settings. Results can include a detailed model breakdown or be emitted as JSON.

Set TP, PP, EP and CP along with the GPU count, micro-batch size and sequence length to compare configurations. The estimator also accepts activation recomputation through --recompute-granularity and reports peak memory per GPU. Expert parallelism can be included for MoE models.

When the layer count cannot be divided evenly across PP stages, specify the layer count for the first or last stage. Otherwise, the chosen pipeline layout may not match the model’s layer distribution.

What it helps with

  • Estimate GPU memory from a HuggingFace configuration
  • Check whether a model fits the available GPU memory
  • Compare TP, PP, EP and CP layouts
  • Test training settings with activation recomputation

Example prompts for the agent

  • Estimate memory for deepseek-ai/DeepSeek-V3 on 128 GPUs with TP 4, PP 4 and EP 8.
  • Calculate memory for a local config.json using TP 2 and PP 2.
  • Compare parallelism setups for Qwen/Qwen3-235B-A22B and return JSON.

How to install megatron-memory-estimator

1Skills CLI (Vercel)

npx skills add yzlnew/infra-skills --skill megatron-memory-estimator -a claude-code

2Manually: put the files in place

~/.claude/skills/megatron-memory-estimator/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/megatron-memory-estimator/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about megatron-memory-estimator

How do I install megatron-memory-estimator in Claude Code?

Run npx skills add yzlnew/infra-skills --skill megatron-memory-estimator -a claude-code. The skill file is at ~/.claude/skills/megatron-memory-estimator/SKILL.md.

What does megatron-memory-estimator do?

It estimates GPU memory for dense and MoE Megatron models using a HuggingFace configuration or local config.json. You can compare parallelism settings and inspect peak memory per GPU.

How do I handle layers that cannot be divided evenly across PP stages?

Set the layer count for the first or last stage with --num-layers-in-first-pipeline-stage or --num-layers-in-last-pipeline-stage.

Similar skills

All skills for AI and ML →
nemo-mbridge-perf-megatron-fsdp NVIDIA nemo-mbridge-perf-megatron-fsdp guides Megatron FSDP enablement in Megatron-Bridge. Sets sharding options, handles checkpoint types, and flags incompatible distributed parameters. CX Codex +1 1,800installs nemo-mbridge-perf-moe-comm-overlap NVIDIA nemo-mbridge-perf-moe-comm-overlap — a skill for MoE expert-parallel communication overlap in Megatron Bridge: dispatch/combine, flex dispatcher backends, expert wgrad scheduling. CX Codex +1 1,800installs memory-dispose-geometry zebbern memory-dispose-geometry is a Claude Code rule that tells the agent to release geometry when removing scene objects. It applies to Three.js resource cleanup. CX Codex +1 ★ 4,719repo stars distributed-training-megatron-core Orchestra Research distributed-training-megatron-core — a Claude skill that plans large-scale LLM training on NVIDIA Megatron-Core: picks a parallelism layout and builds the launch command. CX Codex +1 88installs miles-rl-training Orchestra Research miles-rl-training — a skill that walks your agent through RL training of large MoE models on miles: FP8, INT4, speculative rollout. Useful when you're setting up training on H100/H200. CX Codex +1 1,100installs amazon-sales-estimator nexscope-ai amazon-sales-estimator — a skill to estimate monthly sales on Amazon by BSR, ASIN, or keyword search across 12 marketplaces. No API key required—built for sellers and researchers sizing niches or analyzing competitor products. CX Codex +1 1,300installs

From the same set8

Project sponsors

Companies that keep this analytics open