Nemo megatron bridge

From NVIDIA-NeMo/Nemotron · View interactive version

Nemo megatron bridge is an AI agent skill from the GitHub repository NVIDIA-NeMo/Nemotron. Run the Nemotron-3 Ultra Text2SQL LoRA fine-tuning tutorial (NeMo Megatron-Bridge) end-to-end for the user on their SLURM cluster: data prep, distributed checkpoint conversion, and packed LoRA fine-tuning of the 550B hybrid Mamba-Transformer MoE, ending at a saved adapter. Use when the user wants to

How to use this skill

Skill file

Nemotron-3 Ultra Text2SQL LoRA — runbook for a coding agent

This skill helps you run the cookbook in this directory (mbridge_lora_cookbook.ipynb) on the

user's behalf. The notebook is generic and ships with placeholders; your job is to gather the

user's environment details, fill them in, launch the SLURM jobs, watch them, and report results.

What the tutorial does

Three steps, in order, each a SLURM job:

  1. Data prep — builds a BIRD Text2SQL training.jsonl from both the no-reasoning and reasoning

splits, formatted with Ultra's tokenizer/chat template. Short CPU job.

  1. Convert — distributed import of the Hugging Face base checkpoint into Megatron-Bridge format.

A multi-node GPU job (CPU import is not feasible for a 550B model).

  1. LoRA fine-tune — packed-sequence LoRA training on the prepared data; saves a LoRA adapter.

A multi-node GPU job.

What you must understand before running

node, so every heavy step is a multi-node SLURM job submitted with sbatch and run in a

container via Pyxis/enroot. Run everything from a cluster login node where sbatch/squeue/

sacct are available.

is derived automatically as 48 / GPUS_PER_NODE (e.g. 12 nodes at 4 GPUs/node). The user's QOS

must permit a job of that size — an interactive or small-node-capped QOS will not work.

cell generates from the values you fill in. Every step and every slurm/*.sbatch script sources

it. You can run the notebook cell, or write config.env directly with the same keys.

$WORKSPACE/{base, dataprep, trained, cache/hf, logs}. The base checkpoint (HF_MODEL_PATH) is

the only separate, read-only path.

status (sacct/squeue), and a sanity cell confirms the expected output exists before you

move on. Follow this loop; don't skip the sanity check.

Information to gather from the user

Before launching anything, ask the user for the following and confirm the prerequisites. Don't

guess these — a wrong value wastes a large multi-node allocation. Prefer asking all of them up front

in one batch.

How to reach the cluster

SLURM settings

interactive or small-node-capped QOS). Confirm the wall-clock limit is enough (convert is short;

training is well under a couple of hours by default).

derives from this).

Paths (all on a shared filesystem the compute nodes can mount)

input). The tutorial does not download the base model; confirm it is present.

and HF_MODEL_PATH).

Container & credentials

ships a placeholder; this must be filled with a real Ultra-capable image.

${WORKSPACE}/cache/hf/token; ask the user to place it there (or provide it so you can), and

reference it by path — never print or echo a token.

If the user has an environment-reference document for their cluster, ask for it first and pull these

values from there instead of asking one by one.

How to run it

  1. From the login node, cd into this cookbook directory (it must be on the shared filesystem).
  2. Fill the config: either edit the notebook's Environment & SLURM Setup cell and run it, or

write config.env directly with the values gathered above. The setup cell has a guard that

refuses to proceed while any placeholder (<...>) remains — make sure none are left.

  1. Run the three steps in order. For each: submit via the launch cell/sbatch, poll the check

cell until the job reaches COMPLETED, then run the sanity cell.

  1. Poll, don't block. These are long-running multi-node jobs. Submit, then check back

periodically with sacct/squeue — do not hold an interactive session open waiting, and do not

stream logs live.

Verifying success per step

shows the Nemotron-3 chat template.

exist.

latest_checkpointed_iteration.txt and an iter_* adapter checkpoint; the training log shows the

loss trending down and ends with a LORA_TRAIN_DONE marker.

Report per-step status and elapsed time (from sacct) and the final training loss.

Things already handled — do not change them

runtimes the async-save path can hang; leave it as configured.

the tensor-parallel degree differs, so the converted checkpoint reshards cleanly on load. Don't

retune these unless you change GPUS_PER_NODE, in which case keep the world size at 48 GPUs.

the Ultra recipe — no need to configure them.

checkpoint already exists. Safe to re-run.

Expected friction (so you don't misread it)

~15 minutes with no log output and the GPUs at 100%. This is normal; do not cancel the job. Later

iterations are fast.

progress for far longer than the warmup window can be cancelled and resubmitted; a fresh

allocation usually clears it.

a crash — judge success by the job state and the sanity check, not by log chatter.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.