LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

mcore-run-on-slurm

How to launch distributed Megatron-LM training jobs on a SLURM cluster. Covers a minimal sbatch skeleton, environment-variable setup for torch.distributed.run, CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes, container conventions, monitoring, and per-rank failure diagnosis.

2,779stars322forksUpdated 8/4/2026
Data Science & ML#megatron-lm#nvidia#slurm#distributed-training#python

Security Assessment

Safe(95/100)
Security Score95/100

About mcore-run-on-slurm

The mcore-run-on-slurm skill is a reference guide for launching distributed Megatron-LM training jobs on a SLURM cluster. It solves the problem of correctly wiring up multi-node distributed training, an area where subtle mistakes in environment variables, launcher choice, or hardware-specific tuning flags cause jobs to fail, deadlock, or assert. It leads with answer-first constants so an agent can respond to text-only setup questions before reproducing a full script.

The guide provides a minimal, annotated sbatch skeleton with one srun task per node launching workers through uv run python -m torch.distributed.run (not bare torchrun), deriving MASTER_ADDR from scontrol, and computing NNODES, GPUS_PER_NODE, and WORLD_SIZE. It codifies the nuanced CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes: set to 1 on pre-Blackwell Hopper/Ampere with TP>1 or CP>1 in non-FSDP mode, unnecessary on Blackwell, must not be 1 under Torch-FSDP2 or Megatron-FSDP, and 32 when overlap_moe_expert_parallel_comm is enabled. It also covers multi-node filesystem rules (shared worktree visible to all nodes), container conventions, monitoring, and per-rank failure diagnosis.

Target users are ML engineers and researchers running Megatron-LM at scale on SLURM GPU clusters who need to write or debug sbatch scripts, configure torch.distributed, and diagnose job failures. Prerequisites include a SLURM login with GPU-partition submission rights, Megatron-LM checked out on a shared filesystem, and uv installed with the training/dev extras synced.

FAQ

When should I use this skill?

When submitting a SLURM job, writing or debugging an sbatch script, configuring multi-node distributed training, setting MASTER_ADDR/MASTER_PORT/WORLD_SIZE, or diagnosing a SLURM job failure for Megatron-LM.

What value should CUDA_DEVICE_MAX_CONNECTIONS take?

It depends on hardware and parallelism mode. Pre-Blackwell Hopper/Ampere with TP>1 or CP>1 and non-FSDP requires 1 (the code path asserts otherwise); Blackwell does not need it; Torch-FSDP2 or Megatron-FSDP must not use 1; and overlap_moe_expert_parallel_comm uses 32. Do not export it unconditionally.

What are the prerequisites?

A SLURM cluster login with submission rights to a GPU partition, Megatron-LM checked out on a filesystem visible to all nodes (NFS, Lustre, or similar), and uv installed with uv sync run once for the training and dev (or lts) extras so the .venv is materialized for every node.

Why launch through torch.distributed.run instead of bare torchrun?

The skill prescribes one srun task per node launching workers via uv run python -m torch.distributed.run as a single worker group across all nodes, rather than starting independent single-node jobs, so ranks coordinate correctly.

Does it handle transient failures?

The guide focuses on setup and diagnosis; the associated test tooling documents retry behavior, but for run-on-SLURM the emphasis is correct configuration, writing checkpoints and logs to shared storage, and per-rank failure diagnosis.

All Files

5 files
BENCHMARK.md2.7 KB
View
SKILL.md7.1 KB
View
skill.oms.sig4.5 KB
View
evals/evals.json0.0 KB
View
skill-card.md2.8 KB
View

Install mcore-run-on-slurm

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

nvidia/skills

Related Skills

dbt-sf-to-bq-translator

21,076

build-models

102

html-prototype

3,588

doc

448