multi-node-slurm

Convert single-node PyTorch distributed launches into multi-node Slurm sbatch jobs.

Updated May 23, 2026
One-click install
npx skills add https://github.com/yo-steven/skills-exploration-20260522 --skill multi-node-slurm-yo-steven
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: multi-node-slurm
Source: https://github.com/yo-steven/skills-exploration-20260522/tree/main/skills/Megatron-Bridge/multi-node-slurm
Command: npx skills add https://github.com/yo-steven/skills-exploration-20260522 --skill multi-node-slurm-yo-steven

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common failure-prone task of converting single-node PyTorch distributed commands into reliable multi-node Slurm sbatch jobs for containerized training and debugging.

Core Features & Use Cases

  • Convert launchers: Turn single-node uv run ... torch.distributed.run workflows into proper multi-node Slurm sbatch jobs using either an srun-native approach or a legacy torch.distributed approach.
  • Avoid distributed edge-case failures: Diagnose and mitigate NCCL rendezvous/barrier timeouts, port collisions, incorrect WORLD_SIZE setup, container cache inconsistencies, and common MoE OOMs.
  • Container + shared cache correctness: Ensure NEMO_HOME, HF/UV caches, and warmup steps are on a shared filesystem so all nodes see the same prepared artifacts.
  • Interactive debugging path: Provide an salloc + srun workflow to iteratively reproduce and fix multi-node issues.

Quick Start

Use the Skill to generate a two-phase sbatch script that warms the uv cache on one process and then launches a multi-node srun-based distributed run with MASTER_ADDR, MASTER_PORT, and ranks auto-derived from SLURM environment variables.

Frequently Asked Questions about multi-node-slurm

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

FAQPage Schema
How do I convert a single-node PyTorch distributed launch into a multi-node Slurm sbatch job?▼

To convert single-node PyTorch distributed launches into multi-node Slurm sbatch jobs, you can generate a two-phase script that warms the uv cache on one process and then launches an srun-based distributed run with MASTER_ADDR, MASTER_PORT, and ranks auto-derived from SLURM variables.

How do I fix NCCL timeout errors during multi-node distributed training on Slurm?▼

To fix NCCL timeout errors during multi-node distributed training on Slurm, diagnose rank and environment issues, mitigate NCCL rendezvous and barrier failures, resolve port collisions, and ensure correct WORLD_SIZE setup derived from SLURM variables.

What is the best way to run containerized Megatron Bridge training across multiple Slurm nodes?▼

The best way to run containerized Megatron Bridge training across multiple Slurm nodes is using an srun-native or legacy torch.distributed approach with a valid multi-node execution template, ensuring shared filesystem caches for all containerized artifacts.

Do I need a shared filesystem to run multi-node Slurm jobs with enroot containers?▼

Yes, you need a shared filesystem to run multi-node Slurm jobs with enroot containers so that NEMO_HOME, HF caches, UV caches, and warmup steps are consistently visible to all nodes, preventing container cache inconsistencies.

How do I debug multi-node Slurm failures and OOM errors interactively?▼

To debug multi-node Slurm failures and MoE OOM errors interactively, use an salloc and srun workflow to iteratively reproduce and fix multi-node issues across the allocated GPUs and nodes.

Should I use srun-native or torch.distributed.run for multi-node PyTorch training on Slurm?▼

Choosing between srun-native and torch.distributed.run for multi-node PyTorch training on Slurm depends on your workflow needs; srun-native integrates directly with Slurm task configuration, while the legacy approach wraps torch.distributed.run commands.