executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
install-and-environmentInstall, inspect, and troubleshoot Megatron Core and Megatron-LM runtime environments.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task is about getting Megatron Core importable, choosing a Megatron-LM environment, checking CUDA readiness, or diagnosing dependency/build problems before training or inference.
| User asks about | Do this |
|---|---|
| "How do I install Megatron Core?" | Recommend PyPI or source install from references/install-reference.md, then run the bundled environment probe. |
| "Which extras do I need?" | Map the workflow: base import needs only megatron-core; training data/tokenizers need [training]; TE/ModelOpt/Mamba/FP8 paths require narrower optional extras or container-provided deps. |
| "CUDA is not available" | Check Torch wheel CUDA tag, driver max CUDA, device visibility, and container GPU passthrough; do not treat CPU import as GPU verification. |
| "TransformerEngine/Apex warnings appear" | Distinguish fallback-safe CPU/local paths from workflows that truly require TE/Apex/ModelOpt kernels. |
| "Editable install failed" | Check Python version, build dependencies, MAX_JOBS, and whether the user is trying to build broad dev extras outside the recommended container. |
Identify whether the task is package use, repo development, or large-scale CUDA training.
Install the smallest dependency set that covers that task. Do not install all optional groups by default.
Run:
python scripts/check_megatron_environment.py --check-cuda --optional transformer_engine apex modelopt mamba_ssm
Run the bundled script from this skill directory or copy it into a scratch area. It prints JSON-like facts and exits nonzero only when explicitly required checks fail.
If the task will run real training/inference, continue to the owning sub-skill:
megatron-core and imports as megatron.core / megatron.training.>=3.12 and base dependencies torch>=2.6.0, numpy, and packaging.MAX_JOBS, for example MAX_JOBS=4.uv.lock, lint groups, base image bump PRs, and golden-value workflows.