Install any skill in seconds. Free to start, no credit card required.
Get Started Free →nvidia/nemo-mbridge-perf-sequence-packing
Validate and use packed sequences and long-context training in Megatron-Bridge, distinguishing offline packed SFT for LLMs from in-batch packing for VLMs, and applying the right CP constraints.
Passed 21 of 22 test cases with the skill, and 11 of 22 without it.
and 10 more in the full report
10 fixed11 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 10 test cases the skill fixed. Same model, same prompt, with and without the skill.
If a custom kernel requires fixed final token tensor width across all packed micro-batches, which dictionary parameter should be updated in `cfg.dataset`?
| Checked | Without skill | With skill |
|---|---|---|
| The response specifies setting pad_to_max_length to True inside dataset_kwargs. | Missed | Passed |
The instructions your model reads when the skill loads.
For stable background and recommendation level, see:
Offline packed SFT for LLM finetuning:
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),
)
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:
token_slots_per_step = packed_sequence_size * global_batch_size
test cases passed, vs 11 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.