界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
部署与运维 · SKILL.md

nvidia-nemo-rl-build-and-dependency

nvidia-nemo-rl-build-and-dependency

【部署与运维】Build and dependency management for NeMo-RL. Covers Docker image building and running, uv usage, venv setup, and adding dependencies.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: nvidia-nemo-rl-build-and-dependency description: Build and dependency management for NeMo-RL. Covers Docker image building and running, uv usage, venv setup, and adding dependencies. license: Apache-2.0 AND CC-BY-4.0 metadata: when_to_use: Setting up a dev environment; building or running the Docker container; adding or removing a dependency; uv errors; 'how do I install', 'ModuleNotFoundError', 'build the image', 'run in Docker', 'uv sync fails'. author: NVIDIA

Build and Dependency Guide


Docker Images

Build the release image (includes all dependencies and pre-fetched venvs):

# Build from local source
docker buildx build -f docker/Dockerfile --tag nemo-rl:latest .

# Build from a specific git ref (no local clone needed)
docker buildx build -f docker/Dockerfile \
    --build-arg NRL_GIT_REF=main \
    --tag nemo-rl:latest \
    https://github.com/NVIDIA-NeMo/RL.git

Skip optional backends to reduce build time:

# Skip vLLM and SGLang
docker buildx build -f docker/Dockerfile \
    --build-arg SKIP_VLLM_BUILD=1 \
    --build-arg SKIP_SGLANG_BUILD=1 \
    --tag nemo-rl:latest .

See @docs/docker.md for full options.


Always Use uv

Never use pip install directly — always go through uv.

# Run a script
uv run examples/run_grpo.py

# Run tests
uv run --group test bash tests/run_unit.sh

# Install all deps from lockfile
uv sync --locked

Exception: Dockerfile.ngc_pytorch is exempt from this rule.


Adding Dependencies

# Add a runtime dependency
uv add <package>

# Add an optional dependency
uv add --optional --extra <group> <package>

# Regenerate the lockfile after changes
uv lock

Commit both pyproject.toml and uv.lock together:

git add pyproject.toml uv.lock
git commit -s -m "build: add <package> dependency"

Common Pitfalls

ProblemCauseFix
uv sync --locked failsDependency conflict or stale lockfileRe-run uv lock and commit updated lock
ModuleNotFoundError after pip installpip installed outside uv-managed venvUse uv add + uv sync, never bare pip install
Docker build fails at vLLMvLLM build time overheadPass --build-arg SKIP_VLLM_BUILD=1
我的收藏