Agent skill

Megatron Memory Estimator

by yzlnew in yzlnew/infra-skills

Estimate GPU memory usage for Megatron-based MoE (Mixture of Experts) and dense models.

No licenceAuto-check passedAI & LLM Engineering

Install Megatron Memory Estimator

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

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yzlnew/infra-skills megatron-memory-estimator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yzlnew/infra-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/megatron-memory-estimator .claude/skills/megatron-memory-estimator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
megatron-memory-estimator
GitHub stars
149
Token cost
~2.2k tokens
SKILL.md length
492 words
Files
13 (incl. scripts, references)
Skills in repo
8
Repo updated
First seen
Licence
None found

At a glance

Estimate GPU memory usage for Megatron-based MoE (Mixture of Experts) and dense models.

  • Works in 5 steps: Enable Distributed Optimizer (included… → Activation Recomputation… → Increase Expert Parallelism (MoE only)… → …
  • Estimate memory from HuggingFace model configs (DeepSeek-V3
  • SKILL.md covers Quick Start, Available Scripts, Common Workflows and Understanding Output, plus 6 more sections
  • Runs Python and Shell scripts from its folder; calls python and pip; reaches github.com

What it does

Megatron Memory Estimator is an agent skill from yzlnew/infra-skills. Estimate GPU memory usage for Megatron-based MoE (Mixture of Experts) and dense models. Use when users need to (1) estimate memory from HuggingFace model configs (DeepSeek-V3, Qwen, etc.), (2) plan GPU resource allocation for training, (3) compare different parallelism strategies (TP/PP/EP/CP), (4) determine if a model fits in available GPU memory, or (5) optimize training configurations for memory efficiency.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 16 other files, including scripts and reference files (for example `megatron_memory_estimator/__init__.py`, `megatron_memory_estimator/estimate_013.py` and `megatron_memory_estimator/moe_mem_estimator/__init__.py`).

It sits in AI & LLM Engineering, covering Model hubs and datasets. It works with NVIDIA AI Platform, Hugging Face, DeepSeek and Qwen. The repository describes itself as: A collection of specialized agent skills for AI infrastructure development, enabling Claude Code to write, optimize, and debug high-performance systems.

When your agent uses it

  • Estimate memory from HuggingFace model configs (DeepSeek-V3
  • Plan GPU resource allocation for training
  • Compare different parallelism strategies (TP/PP/EP/CP)
  • Determine if a model fits in available GPU memory

Example prompts

  • “/megatron-memory-estimator”

Requirements

  • Python 3
  • A Bash shell

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Enable Distributed Optimizer (included by default)
  2. Activation Recomputation (--recompute-granularity full)
  3. Increase Expert Parallelism (MoE only) (--ep N)
  4. Increase Pipeline Parallelism (--pp N)
  5. Reduce Batch Size (--micro-batch-size 1)

What it can do on your machine

Read from SKILL.md and the folder at commit f3a8d7d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python and Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Megatron Memory Estimator loads about 2.2k tokens when it runs, and up to ~5.9k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 492 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~110
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 492 words (~2,224 tokens).

“Estimate GPU memory usage for Megatron-based models directly from HuggingFace configs or custom specifications.”

— opening of SKILL.md by yzlnew
name
megatron-memory-estimator

Read the full SKILL.md on GitHub

Files

SKILL.md and 12 other files (scripts, references) in megatron-memory-estimator of yzlnew/infra-skills.

  • SKILL.md
  • megatron_memory_estimator/.gitattributes
  • megatron_memory_estimator/.gitignore
  • megatron_memory_estimator/__init__.py
  • megatron_memory_estimator/estimate_013.py
  • megatron_memory_estimator/moe_mem_estimator/__init__.py
  • megatron_memory_estimator/moe_mem_estimator/base.py
  • megatron_memory_estimator/moe_mem_estimator/gpt_model.py
  • megatron_memory_estimator/moe_mem_estimator/layers.py
  • references/configuration_guide.md
  • references/parallelism_strategies.md
  • scripts/estimate_from_hf.py
  • scripts/setup_env.sh

Open the folder on GitHubat commit f3a8d7d

Compare with similar skills

Megatron Memory Estimator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Megatron Memory Estimator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Megatron Memory Estimator this skillyzlnew/infra-skills149—~2.2kAutomated safety check: PassNone
Add Modelguoqingbao/xinfer334—~4.2kAutomated safety check: NotesMIT
Setup Benchmark Inputsmlc-ai/pith-train355—~399Automated safety check: PassApache-2.0
Qwen Mtp GgufR6410418/Jackrong-llm-finetuning-guide1.7k—~1.7kAutomated safety check: PassMIT
Veomni New ModelByteDance-Seed/VeOmni2.2k—~2kAutomated safety check: PassApache-2.0
Resolvealexziskind1/model-shelf130—~792Automated safety check: PassMIT

Similar skills

  • Add Model

    guoqingbao/xinfer

    Adapt and port new LLM model architectures to this xinfer project.

    334 GitHub stars~4.2k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check: notes
  • Setup Benchmark Inputs

    mlc-ai/pith-train

    Set up the minimal set of artifacts (tokenized DCLM corpus shard + released HuggingFace checkpoint converted to DCP) required to benchmark, profile, or regression-test a MoE model in PithTrain.

    355 GitHub stars~399 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Qwen Mtp Gguf

    R6410418/Jackrong-llm-finetuning-guide

    Complete agent-ready workflow for Qwen-family MTP or nextn GGUF conversion and release.

    1.7k GitHub stars~1.7k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Veomni New Model

    ByteDance-Seed/VeOmni

    A skill your agent uses when adding support for a new model to VeOmni.

    2.2k GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Resolve

    alexziskind1/model-shelf

    Always resolve Hugging Face models via model-shelf before any download.

    130 GitHub stars~792 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Check Model

    guoqingbao/xinfer

    Check model compatibility with xinfer before loading. An agent skill from guoqingbao/xinfer.

    334 GitHub stars~3.8k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from yzlnew/infra-skills

All 8 skills in this repo
  • Hf Architecture Tikz

    yzlnew/infra-skills

    Draw Sebastian-Raschka-gallery-style TikZ architecture diagrams for any HuggingFace decoder-only LLM, with per-block parameter formulas and concrete numbers.

    149 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • HTML Flowchart Anthropic

    yzlnew/infra-skills

    Create and revise pure HTML/CSS flowcharts using an Anthropic-inspired design language.

    149 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Openai Dotcom Viz

    yzlnew/infra-skills

    Build figures in OpenAI's blog / research / system-card "dotcom" visual style — both (a) bar charts (monochrome bars with a darker same-hue stroke, rounded corners, a black y-axis with outward ticks…

    149 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Slime User

    yzlnew/infra-skills

    Guide for using SLIME (LLM post-training framework for RL Scaling).

    149 GitHub stars~3.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Tilelang Developer

    yzlnew/infra-skills

    Write, optimize, and debug high-performance AI compute kernels using TileLang (a Python DSL for GPU programming).

    149 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Material You Slides

    yzlnew/infra-skills

    Create presentation slides using Material You (Material Design 3) style.

    149 GitHub stars~3.7k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Megatron Memory Estimator

What does Megatron Memory Estimator do?

Estimate GPU memory usage for Megatron-based MoE (Mixture of Experts) and dense models. Megatron Memory Estimator is an agent skill from yzlnew/infra-skills. Estimate GPU memory usage for Megatron-based MoE (Mixture of Experts) and dense models.

When should I use Megatron Memory Estimator?

Megatron Memory Estimator fits situations like: estimate memory from HuggingFace model configs (DeepSeek-V3; plan GPU resource allocation for training; compare different parallelism strategies (TP/PP/EP/CP); determine if a model fits in available GPU memory.

How do I install Megatron Memory Estimator in Claude Code?

Run `npx skills add yzlnew/infra-skills --skill megatron-memory-estimator -a claude-code`. Or copy the skill folder (megatron-memory-estimator in yzlnew/infra-skills) into .claude/skills/megatron-memory-estimator in your project. Claude Code loads it when a task matches its description.

How do I install Megatron Memory Estimator in Codex?

Run `npx skills add yzlnew/infra-skills --skill megatron-memory-estimator -a codex`. Or copy the skill folder (megatron-memory-estimator in yzlnew/infra-skills) into .agents/skills/megatron-memory-estimator in your project. Codex loads it when a task matches its description.

Can I use Megatron Memory Estimator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yzlnew/infra-skills --skill megatron-memory-estimator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/megatron-memory-estimator, .gemini/skills/megatron-memory-estimator, .github/skills/megatron-memory-estimator and .opencode/skills/megatron-memory-estimator in your project.

What does Megatron Memory Estimator need to run?

Going by SKILL.md and its folder, Megatron Memory Estimator needs Python and a shell for the scripts in its folder and the command-line tools its instructions call (python and pip). Our summary lists: Python 3; A Bash shell.

Does Megatron Memory Estimator access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Megatron Memory Estimator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Megatron Memory Estimator use?

No licence was found for Megatron Memory Estimator or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Megatron Memory Estimator use?

About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.7k tokens, read only when the agent opens those files.

What are the alternatives to Megatron Memory Estimator?

Skills that share tags, products or a category with Megatron Memory Estimator: Add Model (guoqingbao/xinfer, 334 stars), Setup Benchmark Inputs (mlc-ai/pith-train, 355 stars), Qwen Mtp Gguf (R6410418/Jackrong-llm-finetuning-guide, 1.7k stars) and Veomni New Model (ByteDance-Seed/VeOmni, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Megatron Memory Estimator?

yzlnew (a GitHub user) maintains it in yzlnew/infra-skills, which has 149 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on July 9, 2026.

Source: yzlnew/infra-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.