Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Sequence Packing

Configure and validate sequence packing and long-context training in Megatron-Bridge.

56/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex · Claude Code
Stars
★ 3.8k
Last updated
today
License
Apache-2.0
sequence-packinglong-context-trainingmegatron-bridgecontext-parallelism
+2vlm-finetuningsft

What does this skill do, and when should you use it?

This skill helps Megatron-Bridge users enable, validate, and troubleshoot sequence packing and long-context fine-tuning. It distinguishes offline packed SFT for LLMs from in-batch packing for VLMs, with different micro-batch, context-parallel, and padding rules. It also covers CUDA Graph requirements, MCore THD metadata, model-family opt-outs, and loss-mask validation. It fits teams optimizing long-sequence training or investigating packing regressions.

Provides Megatron-Bridge configuration examples for offline packed SFT, VLM in-batch packing, and long-context training; checks mutual exclusion between packing modes, micro-batch constraints, and context-parallel sequence-length divisibility; documents the per-token loss and DDP settings required for CP fine-tuning; explains the cuSeqlens padding and adjacent metadata JSON required for CUDA Graph paths; and directs users to the supplied pytest unit tests for packed metadata, configuration validation, and padding-row loss masks.

Good fit
  • An LLM fine-tuning engineer needs to enable 4096-token offline packing with PackedSequenceSpecs.
  • A VLM training engineer needs to enable in-batch packing while using the required micro-batch size.
  • A long-context fine-tuning team using context parallel needs to verify sequence length, padding multiples, and loss settings.
  • A Megatron-Bridge maintainer is investigating a commit that changed sequence-packing behavior.
  • A CUDA Graph user needs to confirm cuSeqlens padding and packed-dataset metadata requirements.

How do you install this skill?

Before you use it
  • Do not conflate offline packed SFT with VLM in-batch packing; their micro_batch_size rules are opposite.
  • With CP enabled, verify divisibility by 2×CP and the required finetuning loss/DDP settings.
  • pad_cu_seqlens=True requires an adjacent metadata JSON file and pad_to_max_length=True; validate custom datasets first.
  • Long-context throughput benefits are not established, and packing support is not universal across model families.
Before you start
Your agent needs
  • Shell / CLI
  • Local filesystem
Install first
  • Python
  • uv
  • pytest
  • Megatron-Bridge

Install the specific skill with the NVIDIA skills CLI:

npx skills add nvidia/skills --skill nemo-mbridge-perf-sequence-packing --yes

The README does not document the exact installation directory; the CLI prompts for the destination.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/NVIDIA/skills.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/skills/nemo-mbridge-perf-sequence-packing" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • Enable offline packed SFT with context parallelism in Megatron-Bridge and check the sequence-length, padding-multiple, and micro-batch constraints.

After installation, trigger it with a task such as: "Enable offline packed SFT with context parallelism in Megatron-Bridge and check the sequence-length, padding-multiple, and micro-batch constraints."

For offline LLM SFT, use cfg.train.micro_batch_size = 1, cfg.dataset.enable_offline_packing = True, and PackedSequenceSpecs. For VLM in-batch packing, use cfg.dataset.enable_in_batch_packing = True with cfg.train.micro_batch_size = 2. To verify the implementation, run the uv run python -m pytest commands listed in SKILL.md.

What are this skill's strengths and limitations?

Pros
  • Clearly separates offline LLM packing from VLM in-batch packing and their opposite micro-batch rules.
  • Covers context-parallel, sequence-parallel, tensor-parallel, and CUDA Graph constraints.
  • Includes concrete configuration snippets, code anchors, and targeted unit tests.
  • Calls out model-family opt-outs, MTP incompatibility, and padding-row loss-mask pitfalls.
Limitations
  • Focused specifically on Megatron-Bridge sequence packing and long-context training rather than general training performance.
  • Support is model-family and training-path specific; Qwen3-Next, GLM-4.5, and Qwen3.5-VL have explicit opt-outs.
  • pad_cu_seqlens=True requires a metadata JSON file alongside the packed dataset.
  • The source provides no broad evidence for hardware, version, or complete end-to-end training compatibility.

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
NeMo MBridge Sequence Packing this page ✓ NVIDIA · Official 56 · Use with care ★ 3.8k today Apache-2.0
NeMo MBridge Long-Context MoE Training ✓ NVIDIA · Official 48 · Use with care ★ 3.8k today Apache-2.0
NeMo MBridge Parallelism Strategy Guide ✓ NVIDIA · Official 58 · Recommended ★ 3.8k today Apache-2.0
NeMo MBridge Hierarchical Context Parallelism ✓ NVIDIA · Official 51 · Use with care ★ 3.8k today Apache-2.0
NeMo MBridge GPU Memory Tuning ✓ NVIDIA · Official 61 · Recommended ★ 3.8k today Apache-2.0

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Use with care
56/ 100 5-point scale 2.8 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust19 / 25 · 3.8/5

The skill is limited to configuration and diagnosis of sequence packing, requests no credentials or network access, and discloses metadata requirements and model-specific opt-outs. It lacks explicit user confirmation, permission boundaries, rollback guidance, and revision-pinned source attribution; repository license metadata is also NOASSERTION, so points are deducted.

2Reliability8 / 20 · 2.0/5

The offline-SFT versus VLM in-batch rules, CP constraints, and failure conditions are internally coherent, with ValueError/assert behavior and verification commands documented. However, the selected skill's key test contents, dependency versions, and actual failure output are absent, so static evidence is insufficient and the score is conservatively capped.

3Adaptability10 / 15 · 3.3/5

Triggers, LLM/VLM scenarios, CP/SP conditions, and non-fit cases for Qwen3-Next, GLM-4.5, Qwen3.5-VL, and MTP are reasonably clear. Inputs, output contract, environment requirements, Chinese support, and mainland-China network reachability are not adequately specified, so points are deducted.

4Convention9 / 15 · 3.0/5

The SKILL.md includes enablement examples, code anchors, pitfalls, and verification commands; card.yaml adds limitations, ownership, and version clues. It lacks the recommended Instructions and Examples sections, complete author metadata, changelog, maintenance/update path, and installation dependency notes; the benchmark report records these schema gaps.

5Effectiveness6 / 15 · 2.0/5

The skill supplies directly reusable configuration snippets, CP padding/lcm formulas, CUDA-graph metadata requirements, and success criteria. A benchmark file reports good results for one positive task, but long-context performance claims are marked unclear and the key tests are not provided, so direct usability cannot be established statically and the score remains capped.

6Verifiability4 / 10 · 2.0/5

Code-path references, test-path references, a card evidence list, and one NVSkills-Eval report provide limited auditability. Coverage is only one task with no negative tasks, the report lacks independently reproducible outputs, and the referenced files are not all included, warranting only limited static evidence.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 55f18499943e Review evidence[1][2][3][4][5][6][7][8][9][10][11][12][13][14]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Who should adopt this skill?
Developers using Megatron-Bridge for LLM or VLM fine-tuning, long-context training, or performance-regression investigation.
Can offline and in-batch packing be enabled together?
No. Bridge validation requires enable_offline_packing and enable_in_batch_packing to be mutually exclusive.
What are the key context-parallel requirements?
Sequence length must be divisible by 2 × context_parallel_size; CP fine-tuning also requires calculate_per_token_loss=True and ddp.average_in_collective=False.
What environment is needed for verification?
The source provides commands using uv, Python, and pytest for Megatron-Bridge unit tests, but does not document full environment setup.

More skills from this repository

All from NVIDIA/skills

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Long-Context MoE Training

Practical Megatron Bridge guidance for sizing parallelism, managing memory, and preserving throughput in long-context MoE training.

★ 3.8k FS 48 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Parallelism Strategy Guide

Choose, combine, and validate Megatron Bridge parallelism configurations.

★ 3.8k FS 58 Recommended today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Hierarchical Context Parallelism

Enable, troubleshoot, and verify hierarchical context parallelism in Megatron-Bridge.

★ 3.8k FS 51 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge GPU Memory Tuning

Diagnose GPU OOMs in Megatron Bridge training and reduce fragmentation, activation, and PEFT memory usage.

★ 3.8k FS 61 Recommended today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE VLM Training Guide

Guides FSDP and 3D-parallel choices and tuning for MoE vision-language model training.

★ 3.8k FS 57 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Expert-Parallel Overlap

Configure, validate, and troubleshoot MoE expert-parallel communication overlap in Megatron-Bridge.

★ 3.8k FS 57 Use with care today
Dev & Engineering ✓ NVIDIA · Official

Megatron FSDP Configuration and Performance Guide

Enable, troubleshoot, and verify Megatron FSDP in Megatron-Bridge.

★ 3.8k FS 54 Use with care today
Dev & Engineering ✓ NVIDIA · Official

Megatron-Bridge Communication Overlap Guide

Configure and verify TP, DP, and PP communication overlap in Megatron-Bridge training.

★ 3.8k FS 54 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Recipe Recommender

Recommends adjustable Megatron Bridge recipes for your model, GPU budget, and training goal.

★ 3.8k FS 53 Use with care today
Dev & Engineering ✓ NVIDIA · Official

Megatron Bridge Activation Recompute

Trade extra compute for lower GPU activation memory in Megatron Bridge training.

★ 3.8k FS 59 Recommended today
Dev & Engineering ✓ NVIDIA · Official

NeMo AutoModel Distributed Training

Choose and configure multi-GPU and multi-node training strategies for NeMo AutoModel.

★ 3.8k FS 58 Recommended today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Training Resiliency

Configure fault recovery and hang detection for Megatron Bridge distributed training.

★ 3.8k FS 57 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Communication Overlap

Tune expert-parallel communication and computation overlap in Megatron Bridge.

★ 3.8k FS 56 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge CPU Offload

Configure, validate, and troubleshoot CPU offloading in Megatron Bridge to relieve GPU memory pressure.

★ 3.8k FS 55 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge CUDA Graphs

Configure, validate, and benchmark CUDA Graph capture in Megatron Bridge to reduce host-driver overhead.

★ 3.8k FS 55 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Performance Workflow

Systematically diagnose and improve MoE training throughput in Megatron Bridge.

★ 3.8k FS 53 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Training Guide

Run Megatron-LM and Megatron Bridge training and verify whether their loss curves match.

★ 3.8k FS 44 Not recommended today
Dev & Engineering ✓ NVIDIA · Official

MoE Hardware Configuration Reference

Plan MoE training layouts and throughput expectations across NVIDIA GPU platforms.

★ 3.8k FS 52 Use with care today
Automation & Ops ✓ NVIDIA · Official

Megatron-LM on SLURM

Launch, monitor, and troubleshoot multi-node Megatron-LM training on SLURM GPU clusters.

★ 3.8k FS 56 Use with care today
Data & Analysis ✓ NVIDIA · Official

TAO DAFT Dataset Converter

Guides AI agents through tao-daft conversion between supported NVIDIA TAO DAFT dataset formats.

★ 3.8k FS 54 Use with care today

Related skills