nemo-automodel-launcher-config

작성자: nvidia

대화형 실행, Slurm 클러스터 및 SkyPilot 클라우드 실행을 위한 NeMo AutoModel 작업 실행을 구성합니다.

npx skills add https://github.com/nvidia/skills --skill nemo-automodel-launcher-config

Launcher Configuration

NeMo AutoModel supports three launch methods: interactive (torchrun), Slurm (HPC clusters), and SkyPilot (cloud-agnostic).

Instructions

For launcher questions, answer directly from this skill without inspecting the repository unless the user asks you to edit files. Keep the answer focused on the relevant launch YAML, required fields, and the expected runtime behavior.

Use these compact answer patterns for common questions:

  • Slurm multi-node: show a slurm: YAML block with job_name, nodes, ntasks_per_node, time, account or partition, container_image, hf_home, optional extra_mounts, env_vars, and master_port; explain that the launcher derives WORLD_SIZE = nodes * ntasks_per_node and sets MASTER_ADDR and MASTER_PORT.
  • SkyPilot spot: show a skypilot: YAML block with cloud, accelerators, num_nodes, use_spot: true, disk_size, region, setup, and env_vars; warn that spot instances can be preempted, set a short step_scheduler.checkpoint_interval, and resume with restore_from.path.
  • Nsight Systems on Slurm: show slurm.nsys_enabled: true alongside normal Slurm fields, say the launcher wraps the training command with nsys profile, and state that it produces a .nsys-rep report file. Treat profiling as diagnostic-only: use short profiling runs and disable it for normal production training because it adds overhead and large artifacts.

For Slurm answers, start with this minimal template and then adjust only the fields the user asked about:

slurm:
  job_name: llm_finetune
  nodes: 2
  ntasks_per_node: 8
  time: "04:00:00"
  account: my_account
  partition: batch
  container_image: nvcr.io/nvidia/nemo:dev
  hf_home: ~/.cache/huggingface
  master_port: 13742
  env_vars:
    HF_TOKEN: "${HF_TOKEN}"

For Slurm-only questions, do not discuss SkyPilot or profiling unless the user asks. For profiling questions, say the .nsys-rep report is written in the Slurm job working or output directory, using the launcher's Nsys output setting when one is configured.

Routing Boundary

Use this skill only for launch mechanics: interactive execution, Slurm, SkyPilot, containers, mounts, environment variables, rendezvous settings, and profiling.

Do not use this skill for implementing or registering new model architectures, Hugging Face state-dict adapters, model files, or capability flags. Those are model onboarding tasks, not launcher configuration tasks.

Launch Methods

  1. Interactive (default): runs torchrun on the current node. Suitable for single-node development and debugging.
  2. Slurm: submits a batch job to an HPC cluster scheduler. Handles multi-node setup, container management, and environment configuration.
  3. SkyPilot: cloud-agnostic job submission to AWS, GCP, Azure, Lambda, or Kubernetes. Supports spot instances.

Interactive Launch

# Single GPU
automodel finetune llm -c config.yaml

# Multi-GPU (all GPUs on current node)
torchrun --nproc_per_node=8 -m nemo_automodel._cli.app finetune llm -c config.yaml

No additional YAML section is needed for interactive mode. The CLI routes to torchrun automatically when no slurm: or skypilot: section is present in the config.

Slurm Configuration

The SlurmConfig dataclass generates an SBATCH script from a template.

YAML Example

slurm:
  job_name: llm_finetune
  nodes: 2
  ntasks_per_node: 8
  time: "04:00:00"
  account: my_account
  partition: batch
  container_image: nvcr.io/nvidia/nemo:dev
  hf_home: ~/.cache/huggingface
  extra_mounts:
    - source: /data
      dest: /data
  env_vars:
    WANDB_API_KEY: "${WANDB_API_KEY}"
    HF_TOKEN: "${HF_TOKEN}"

Key Fields

  • job_name: Slurm job identifier
  • nodes: number of nodes to request
  • ntasks_per_node: number of tasks (GPUs) per node
  • time: wall-time limit in HH:MM:SS format
  • account, partition: Slurm scheduling parameters
  • container_image: Enroot/Pyxis container image path
  • nemo_mount: mount point for NeMo AutoModel source inside the container
  • hf_home: HuggingFace cache directory path
  • extra_mounts: list of VolumeMapping(source, dest) for additional container bind mounts
  • master_port: port for distributed communication (default 13742)
  • env_vars: environment variables passed into the job
  • nsys_enabled: when true, wraps the training command with nsys profile for Nsight Systems profiling

SkyPilot Configuration

The SkyPilotConfig dataclass defines cloud job parameters.

YAML Example

skypilot:
  cloud: aws
  accelerators: "H100:8"
  num_nodes: 2
  use_spot: true
  disk_size: 200
  region: us-east-1
  setup: "pip install nemo-automodel"
  env_vars:
    HF_TOKEN: "${HF_TOKEN}"

Key Fields

  • cloud: target cloud provider (aws, gcp, azure, lambda, kubernetes)
  • accelerators: GPU type and count (e.g., "H100:8", "A100-80GB:4")
  • num_nodes: number of cloud instances
  • use_spot: use preemptible/spot instances for cost savings
  • disk_size: disk size in GB per node
  • region: cloud region for instance placement
  • setup: shell commands to run before the training job (e.g., install dependencies)
  • env_vars: environment variables for the job

SkyPilot spot checklist

When using spot or preemptible instances:

  • Set use_spot: true in the skypilot: section.
  • Include accelerators, num_nodes, disk_size, region, setup, and required env_vars.
  • Use short checkpoint intervals in the recipe, for example step_scheduler.checkpoint_interval, because spot instances can be preempted.
  • Resume from the most recent checkpoint after preemption with the recipe's restore_from setting.

Minimal spot-resume recipe keys:

step_scheduler:
  checkpoint_interval: 100

restore_from:
  path: /checkpoints/latest

Multi-Node Environment

For multi-node training (both Slurm and SkyPilot), the launcher automatically configures:

  • MASTER_ADDR: hostname of the first node
  • MASTER_PORT: port for rendezvous (default 13742)
  • WORLD_SIZE: total number of processes (nodes * ntasks_per_node)
  • NCCL environment variables for optimized collective communication

Nsys Profiling

Enable Nsight Systems profiling in Slurm jobs:

slurm:
  job_name: llm_profile
  nodes: 1
  ntasks_per_node: 8
  time: "00:30:00"
  account: my_account
  partition: batch
  container_image: nvcr.io/nvidia/nemo:dev
  nsys_enabled: true

This is a Slurm launcher setting. Normal Slurm fields such as job_name, nodes, ntasks_per_node, time, account or partition, and container_image still apply.

When nsys_enabled: true, the launcher wraps the training command with nsys profile and writes a .nsys-rep report file for performance analysis in the Slurm job working or output directory. Profiling is diagnostic-only: run it for a short investigation, expect overhead and large artifacts, and turn it off for normal production training.

Code Anchors

  • components/launcher/slurm/config.py - SlurmConfig dataclass, VolumeMapping
  • components/launcher/slurm/template.py - SBATCH script template generation
  • components/launcher/slurm/utils.py - Slurm submission utilities
  • components/launcher/skypilot/config.py - SkyPilotConfig dataclass
  • _cli/app.py - CLI entry point and launcher routing logic

Pitfalls

  • Port collisions: if the default master_port (13742) is in use by another job on the same node, change it to avoid connection failures.
  • Container mounts: the source path in extra_mounts must exist on all nodes in the allocation. Missing paths cause container startup failures.
  • Slurm fault tolerance: the fault tolerance plugin is Slurm-specific and does not work with SkyPilot or interactive mode.
  • SkyPilot spot preemption: spot instances (use_spot: true) may be preempted by the cloud provider. Enable checkpointing with short intervals to minimize lost work.
  • Environment variable syntax: use ${VAR} syntax in YAML for shell variable expansion. Bare variable names will not be expanded.
  • Time limit vs async checkpoint: if the Slurm time limit is too short, an in-progress async checkpoint write may be killed before completion, resulting in a corrupted checkpoint. Leave at least 5-10 minutes of margin.

nvidia의 다른 스킬

fhir-basics
nvidia
에이전트에게 FHIR R4 API의 작동 방식, 사용 가능한 리소스, 검색 매개변수를 사용한 쿼리 방법, 모든 응답 형식을 올바르게 파싱하는 방법을 가르칩니다…
compileiq-validate-result
nvidia
검색이 완료된 후, 속도 향상을 청구하거나 ACF를 발송하기 전에 사용합니다. dump_results CSV를 로드하고, 상위 K개 후보(단일 목표)를 추출합니다…
changelog-audit
nvidia
릴리스 전에 Warp CHANGELOG.md를 감사합니다: 누락된 항목 복구, 사용자 영향별 정렬, 항목 언어 다듬기, 줄 바꿈, (릴리스 브랜치 모드) 비교 업데이트…
dgx-diagnose
nvidia
일반적인 DGX Station GB300 문제 진단 — CUDA 충돌, 잘못된 GPU 타겟팅, vLLM/SGLang 컨테이너 버그, MIG 상태 문제, NVLink/Fabric Manager 오류,…
aicr-managing-openvex
nvidia
Use when adding, updating, or removing CVE/GHSA suppressions in `.openvex.json` — the OpenVEX document consumed by the daily image vulnerability scan workflow.…
aicr-creating-slide-decks
nvidia
기술 개념이나 워크플로우에 대한 독립형 HTML 슬라이드 덱 또는 시각적 발표 자료(예: demos/*.html)를 만들 때 사용하세요. 전체 화면으로 표시하거나…
aicr-creating-guided-demos
nvidia
대화형 안내 데모 스크립트(demos/*.sh)를 라이브 또는 자기 주도 방식으로 Frame → Tell → Show → Close 패턴에 따라 구조화한다. "데모 스크립트", "안내…"와 같은 표현에 반응한다.
aicr-analyzing-snapshots
nvidia
AICR 스냅샷 YAML 파일을 분석하거나, 클러스터 상태를 검토하거나, 공급자 특성을 비교하거나, GPU/네트워크 토폴로지 인사이트를 추출할 때 사용합니다...