nvidia-nemo/megatron-bridge/build-and-dependency
Claude Code and agent skill by nvidia-nemo/megatron-bridge
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Dev environment setup for Megatron Bridge — container-based development, uv package management, lockfile regeneration, adding dependencies, Slurm container usage, and common build pitfalls.
Install
npx vskill@latest install nvidia-nemo/megatron-bridge/build-and-dependencySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as nvidia-nemo/megatron-bridge/build-and-dependency.
Build and Dependency
Two core principles: build and develop inside containers, and always use uv.
Why Containers
Megatron Bridge depends on CUDA, NCCL, PyTorch with GPU support, Transformer Engine, and optional components like TRT-LLM, vLLM, and DeepEP. Installing these on a bare host is fragile and hard to reproduce. The project ships production-quality Dockerfiles that pin every dependency.
Use the container as your development environment. This guarantees:
- Identical CUDA / NCCL / cuDNN versions across developers and CI.
uv.lockresolves the same way locally and in CI (the lockfile is
Linux-only; it cannot be regenerated on macOS).
- GPU-dependent operations work out of the box.
Container Options
Option 1: NeMo Framework Container (fastest)
Find available tags at https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo/tags
Option 2: Build the Megatron Bridge Container
See @docker/README.md for build commands, build arguments, and the full NeMo-FW image stack.
Running the Container
Mounting $HOME/.cache/uv avoids re-downloading wheels on every run.
Containers on Slurm
On Slurm clusters with Enroot/Pyxis, pass containers directly to srun:
If you bind-mount a custom source tree into the container, only rank 0 should sync while others wait:
Note: --no-container-mount-home is an srun flag, not an #SBATCH directive. Set UV_CACHE_DIR to shared storage to avoid filling /root/.cache/.
Always Use uv
Never use `pip install`, `conda`, or bare `python` — always go through uv. All uv commands must be run inside a container. Never install or upgrade dependencies outside the CI container.
Essential Commands
| Task | Command | |
|---|---|---|
| Install all deps from lockfile | uv sync --locked | |
| Install with all extras and dev groups | uv sync --locked --all-extras --all-groups | |
| Run a Python command | uv run python script.py | |
| Run distributed training | uv run python -m torch.distributed.run --nproc_per_node=N script.py | |
| Add a new dependency | uv add <package> | |
| Add an optional dependency | uv add --optional --extra <group> <package> | |
| Regenerate the lockfile | uv lock (Linux/container only) | |
| Install pre-commit hooks | uv run --group dev pre-commit install |
Adding Dependencies
Submit dependency changes as a separate PR before the feature PR:
Commit both modified files:
Regenerating uv.lock
The lockfile is Linux-only (resolves CUDA wheels). Run inside Docker:
Switching MCore Branches
Quick Start
Common Pitfalls
| Problem | Cause | Fix | |
|---|---|---|---|
uv sync --locked fails on macOS | Lockfile resolves CUDA wheels that don't exist on macOS | Run inside Docker or on a Linux machine | |
ModuleNotFoundError after pip install | pip installed outside uv-managed venv | Use uv add + uv sync, never bare pip install | |
uv sync --locked fails after MCore branch switch | Lockfile generated against main MCore | Use uv sync (without --locked) on dev | |
uv: command not found inside container | Container doesn't have uv | Use the megatron-bridge image built from Dockerfile.ci | |
No space left on device during uv ops | Cache fills container's /root/.cache/ | Set UV_CACHE_DIR to shared/persistent storage | |
| Pre-commit fails with ruff errors | Code style violations | Run uv run ruff check --fix . && uv run ruff format . |
Security
- Security scanPassed, 95 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 repositoryCheckingskills/build-and-dependency/SKILL.md
Popularity
- Repository stars
- 775
- Repository forks
- 401
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
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/nvidia-nemo/megatron-bridge/build-and-dependency)