用途:该技能只处理 NeMo AutoModel 的启动机制,包括交互式执行、Slurm、SkyPilot、容器、挂载、环境变量、rendezvous 设置与性能分析;不用于实现或注册新模型架构、Hugging Face state-dict 适配器、模型文件或能力标志,这些属于模型接入任务。
三种启动方式:交互式(默认)在当前节点运行 torchrun,适合单节点开发调试;Slurm 向 HPC 调度器提交批处理作业,处理多节点、容器与环境配置;SkyPilot 面向 AWS、GCP、Azure、Lambda 或 Kubernetes 的云无关提交,支持 spot 实例。
交互式用法:autonomodel config.yaml --nproc-per-node 1(单 GPU)、autonomodel config.yaml --nproc-per-node 8(多 GPU),或 torchrun --nproc-per-node=8 -m nemo_automodel.cli.app config.yaml。配置中无 slurm: 或 skypilot: 段时 CLI 自动路由到 torchrun。
Slurm 配置:SlurmConfig 数据类由模板生成 SBATCH 脚本,关键字段有 job_name、nodes、ntasks_per_node、time、account、partition、container_image、nemo_mount、hf_home、extra_mounts、master_port(默认 13742)、env_vars、nsys_enabled。
SkyPilot 配置:SkyPilotConfig 定义 cloud、accelerators、num_nodes、use_spot、disk_size、region、setup、env_vars。使用 spot 时设 use_spot: true,并配合较短的 step_scheduler.checkpoint_interval 与 restore_from.path 以便抢占后恢复。
多节点环境:启动器自动配置 MASTER_ADDR、MASTER_PORT、WORLD_SIZE(nodes * ntasks_per_node)及 NCCL 环境变量。
Nsight Systems:在 Slurm 中设 nsys_enabled: true,启动器用 nsys profile 包装训练命令并生成 .nsys-rep 报告,写入作业工作或输出目录。该功能仅用于诊断,有额外开销和大体积产物,生产训练应关闭。
限制与注意:默认端口 13742 冲突时需修改;extra_mounts 源路径须在所有节点存在;容错插件仅适用于 Slurm;spot 实例可能被抢占;YAML 中环境变量须用 ${VAR} 语法;Slurm 时限过短可能中断异步检查点写入,建议留 5-10 分钟余量。