build-and-dependency

Manage Megatron-LM container builds and uv dependency synchronization.

17.4k|4.3k|Updated Mar 21, 2019
One-click install
npx skills add https://github.com/NVIDIA/Megatron-LM --skill build-and-dependency-nvidia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-and-dependency
Source: https://github.com/NVIDIA/Megatron-LM/tree/main/skills/build-and-dependency
Command: npx skills add https://github.com/NVIDIA/Megatron-LM --skill build-and-dependency-nvidia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents broken, non-reproducible local setups by guiding you to build and manage the exact containerized CUDA/PyTorch/native-extension environment Megatron-LM expects.

Core Features & Use Cases

  • Container-first development: Ensures the correct CUDA/NCCL/cuDNN, PyTorch GPU build, and precompiled native extensions (e.g., TransformerEngine, DeepEP) are available without fragile host installation.
  • Deterministic dependency management with uv: Uses the container’s /opt/venv and uv workflows to keep uv.lock consistent across developers and CI, avoiding “works on my machine” issues.
  • Dev vs LTS image workflows: Supports dev for most development and lts for stability testing, including guidance on where LTS pins live and how to rebuild the LTS image.
  • Operational support for common failures: Provides fixes for typical issues such as uv sync --locked failures, ModuleNotFoundError from wrong installation paths, container build/secret errors, and cache-related disk space problems.

Quick Start

Use the build-and-dependency skill to launch the provided Megatron-LM CI container variant and then run uv commands inside it to sync dependencies using the existing lockfile.

Frequently Asked Questions about build-and-dependency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a reproducible Megatron-LM dev environment with Docker?

You set up a reproducible Megatron-LM dev environment by building and launching the CI-derived Docker container, which provides the exact CUDA, NCCL, and PyTorch GPU builds needed without fragile host installations.

Why does uv sync --locked fail when updating Megatron-LM dependencies?

The uv sync --locked command fails when uv.lock is inconsistent with pyproject.toml. You must regenerate uv.lock by running the uv lock command inside the container's managed venv rather than attempting manual conflict resolution.

How do I resolve ModuleNotFoundError in Megatron-LM containers?

You resolve ModuleNotFoundError in Megatron-LM containers by running all uv operations inside the container's managed /opt/venv, ensuring dependencies are installed in the correct path rather than the host environment.

When should I use the dev image versus the lts image for Megatron-LM?

Use the dev image for most Megatron-LM development and the lts image for stability testing. LTS pins are stored separately, requiring you to rebuild the LTS image to apply stability updates.

Can I install Megatron-LM native extensions like TransformerEngine directly on my host?

Installing Megatron-LM native extensions like TransformerEngine directly on your host is fragile. The build-and-dependency workflow uses containerized builds to ensure precompiled native extensions match the expected environment.

What is the best way to manage uv.lock consistency across Megatron-LM developers and CI?

The best way to manage uv.lock consistency is to execute uv operations within the provided Megatron-LM CI container, ensuring the lockfile remains deterministic and avoiding works on my machine issues.