nemo-mbridge-perf-sequence-packing
Validate and use packed sequences and long-context training in Megatron-Bridge, including offline LLM packing, collate-time VLM packing, Energon online…
Skill by NVIDIA
Chalk Labs
Need help deploying nemo-mbridge-perf-sequence-packing?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/nvidia-nemo-mbridge-perf-sequence-packing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/nemo-mbridge-perf-sequence-packing
What's inside
- Skill name
nemo-mbridge-perf-sequence-packing- Description
- Validate and use packed sequences and long-context training in Megatron-Bridge, including offline LLM packing, collate-time VLM packing, Energon online packing, and CP constraints.
- License
- Apache-2.0
- Instructions
- 303 lines in SKILL.md · view on GitHub
Files (6)
- BENCHMARK.md
- SKILL.md
- card.yaml
- evals.json · evals/
- skill-card.md
- skill.oms.sig
SKILL.md (first lines)
# Sequence Packing Skill
For stable background and recommendation level, see:
- @docs/training/packed-sequences.md
- @skills/nemo-mbridge-perf-sequence-packing/card.yaml
## Enablement
Offline packed SFT for LLM finetuning:
```python
import math
from megatron.bridge.data.datasets.packed_sequence import PackedSequenceSpecs
cfg.train.micro_batch_size = 1
cfg.train.global_batch_size = 8
cfg.dataset.seq_length = 8192
cfg.model.seq_length = 8192
cfg.dataset.enable_offline_packing = True
cp_size = cfg.model.context_parallel_size
tp_size = cfg.model.tensor_model_parallel_size
cp_multiple = 2 * cp_size if cp_size > 1 else 1
sp_multiple = cp_size * tp_size if cfg.model.sequence_parallel and tp_size > 1 else 1
cfg.dataset.offline_packing_specs = PackedSequenceSpecs(
packed_sequence_size=8192,
pad_seq_to_mult=math.lcm(cp_multiple, sp_multiple),
)
```
### Choose the offline pack length
For text-only LLM SFT and PEFT verification, start with an 8192-token offline
pack when the model context limit, memory, and model-family support allow it.
Benchmark pack lengths at equal token slots per optimizer step:
```text
token_slots_per_step = packed_sequence_size * global_batch_size
```
For example, 2K/GBS32, 4K/GBS16, and 8K/GBS8 each expose 65,536 token slots per
step. Longer packs aggregate more source examples into each physical MBS1 row
and can reduce gradient accumulation and per-step overhead. They also increase
activation memory and may expose kernel-width constraints, so select the
largest measured configuration that fits rather than assuming longer is
always faster.
Offline packing requires MBS1. Require `global_batch_size % data_parallel_size
== 0` and `global_batch_size >= data_parallel_size`; an 8K/GBS8 workload
therefore needs DP no larger than 8. Keep `model.seq_length`,
`dataset.seq_length`, and `packed_sequence_size` equal, use a fresh packed-data
output root after changing any of them, and inspect the resolved post-setup
configuration.
Equal token slots do not make different pack lengths numerically identical:
the longer target changes truncation and pack membership. Rerun finite-loss,
no-skip/NaN, and convergence sentinels before replacing verified evidence.
For finetuning with CP enabled:
```python
cfg.model.context_parallel_size = 2
cfg.model.calculate_per_token_loss = True
cfg.ddp.average_in_collective = False
```
Use the same alignment formula for SFT and PEFT. It produces 1 for TP1/CP1 with
SP disabled and 4 for TP4/CP1 with SP enabled. Offline packing does not derive
the value automatically, so pin it explicitly and rebuild packed data after a
topology change.
If a dispatcher or kernel requires a fixed final token width:
```python
cfg.dataset.dataset_kwargs = {
**(cfg.dataset.dataset_kwargs or {}),
"pad_to_max_length": True,
}
```
Choose `packed_sequence_size` to satisfy the kernel multiple. For example,
HybridEP with a 128-token combine chunk requires a width divisible by 128.
This is separate from `pad_seq_to_mult`, which aligns each constituent
sequence for CP/SP.
If CUDA graphs are enabled for this packed path, fixed token width is required
and packed metadata must also have a static shape:
```python
cfg.dataset.offline_packing_specs.pad_cu_seqlens = True
cfg.dataset.dataset_kwargs["pad_to_max_length"] = True
```
**Note:** `pad_cu_seqlens = True` also requires a metadata JSON file alongside
the packed dataset (asserted in `src/megatron/bridge/data/datasets/sft.py`).
Custom packed datasets that omit the metadata file will hit an assertion at
dataset initialization.
In-batch packing for GPT SFT and supported VLM finetuning:
```python
cfg.dataset.enable_in_batch_packing = True
cfg.dataset.dataloader_type = "single"
cfg.train.micro_batch_size = 4
```
For local or materialized GPT-SFT JSONL, this keeps the existing mmap-backed
dataset and performs tokenization lazily. Both prompt/completion
(`GPTSFTDataset`) and chat (`GPTSFTChatDataset`) preserve their loss-mask
semantics. Use `dataloader_type="single"` or `"cyclic"` so every DataLoader
yield is one logical microbatch; GPT-SFT in-batch packing does not support the
global-batch `"batch"` dataloader.
Energon online packing for Qwen-VL uses Energon's per-worker candidate buffer
instead of limiting selection to one collator micro batch:
```pythonFrom NVIDIA/skills, Apache-2.0.
More from NVIDIA/skills
- 0.846score
nemo-fabric-integrate
NVIDIA Corporation and Affiliates
Use this skill when integrating NVIDIA NeMo Fabric into a consumer application, service, evaluation harness, or platform through the typed Python SDK —…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
jetson-video-pipeline
Vinit Bansal <vinitkumarb@nvidia.com>
Use when planning, executing, and independently validating Jetson Video Codec SDK or PyNvVideoCodec encode/decode, transcode, segmentation, container decode…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
nvflare-convert-pytorch
NVIDIA FLARE Team <federatedlearning@nvidia.com>
Convert existing plain or manual PyTorch training code into an NVFLARE federated job using Client API model exchange, local validation, and job export; use…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
nemo-relay-get-started
NVIDIA Corporation and Affiliates
Use this skill when first-time NeMo Relay users want help selecting and following an appropriate quick-start guide or verifying their first working integration.
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
jetson-video-recipe
Vinit Bansal <vinitkumarb@nvidia.com>
Use when turning a Jetson encoder use case into one surface-neutral recipe with native Video Codec SDK and PyNvVideoCodec projections.
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
nvidia-broadcast
NVIDIA Broadcast Team <broadcast-skills-dev@nvidia.com>
Use when controlling NVIDIA Broadcast through MCP to apply effects, process local media, select devices, or change camera resolution, or when Broadcast is…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
jetson-video-setup
Vinit Bansal <vinitkumarb@nvidia.com>
Use when installing, repairing, reusing, inspecting, or verifying readiness of the native NVIDIA Video Codec SDK or PyNvVideoCodec on Jetson, including the…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
nvflare-diagnose-job
NVIDIA FLARE Team <federatedlearning@nvidia.com>
Use when the user asks why a reported NVFLARE job failure signal occurred: the job failed, stalled, timed out, lost clients, ended with EXECUTION_EXCEPTION…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
nvflare-convert-lightning
NVIDIA FLARE Team <federatedlearning@nvidia.com>
Convert existing PyTorch Lightning training code into an NVFLARE federated job using the Lightning Client API patch, local validation, and job export; use…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
nemo-relay-install
NVIDIA Corporation and Affiliates
Use this skill when choosing or running NeMo Relay installation for an agent runtime, application language, framework integration, or plugin bundle, or…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
nvflare-fed-stats
NVIDIA FLARE Team <federatedlearning@nvidia.com>
Compute federated statistics over tabular data (count, sum, mean, stddev, var, histogram, quantile, noise-protected min/max) and image data (count…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.846score
jetson-video-capability
Vinit Bansal <vinitkumarb@nvidia.com>
Use when Jetson codec, profile, chroma, bit-depth, dimension, engine-count, or operational support must be reconciled from live APIs, authenticated NVIDIA…
SkillAFreshness: A★ 3.7KClaude Code +9
Signals
- Stars
- 3,718
- Forks
- 457
- Open issues
- 8
- Last commit (this folder)
- Aug 24, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/NVIDIA/skills
- Website
- docs.nvidia.com/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from NVIDIA
- 0.745score
cdf-video-data-augmentation
NVIDIA
Run the CDF Video Data Augmentation Airflow workflow on Kubernetes or OSMO to create Cosmos video-to-video variants and auto-label both source and generated…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.745score
nvidia-skill-finder
NVIDIA
Use for NVIDIA-related requests where an NVIDIA skill might help, even if the user did not ask for a skill.
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.745score
cdf-image-attribute-augmentation
NVIDIA
Run the CDF Orchestration Image Attribute Augmentation DAG on Kubernetes - person-crop clothing augmentation, attribute search, and augmented dataset…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.745score
cdf-orchestration-preflight
NVIDIA
Set up missing Linux prerequisites and audit whether a Cosmos Data Factory (CDF) Orchestration checkout and its Kubernetes or OSMO environment are ready to…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.745score
ethos-write
NVIDIA
Writes an AI agent's ethos.md — a durable snapshot of its purpose, intended behavior, boundaries, and success criteria — from the answers gathered by…
SkillAFreshness: A★ 3.7KClaude Code +9 - 0.745score
cdf-autonomous-vehicle-dataset-generation
NVIDIA
Prepare payloads, run and monitor the Autonomous Vehicle Dataset Generation Airflow workflow, and inspect results for driving-clip retrieval and Cosmos3-Nano…
SkillAFreshness: A★ 3.7KClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get nemo-mbridge-perf-sequence-packing running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
nemo-mbridge-perf-sequence-packing skill. Agent Mart. https://agentmart.dev/skills/nvidia-nemo-mbridge-perf-sequence-packing (last updated 2026-10-24)