·
Last changedVersion:
This version passed the hardening gate. Hardening updated the skill content and independently checked the resulting changes. Classified findings before hardening: 1. Classified findings closed: 0. Classified findings remaining: 1. Unclassified scanner findings remaining: 0. Review findings closed: 0. Review findings remaining: 7.
1
1
Expand | File | Group | Subtype | Severity | Status |
|---|---|---|---|---|---|
BENCHMARK.md | Sensitive Data & Secret Exposure | Agent snooping | Medium | Open |
1 finding
For stable background and recommendation level, see:
Offline packed SFT for LLM finetuning:
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:
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:
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:
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:
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:
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:
packing_buffer_size is the sole native-packing selector; leave the legacy
collator- and step-owned packing flags at their defaults. Use vlm_step. The
buffer size counts prepared candidate samples per worker, not bytes or packed
tokens. Since prepared image/video patch tensors remain in
host memory until selection, start at 8-16 for high-resolution or video data
and measure worker RSS, first-batch latency, and bin fill before increasing it.
This path does not write offline packs; the source WebDataset shards remain
unchanged. It supports eager Qwen-VL with MBS1 and rejects MTP, CUDA graphs,
Qwen3-VL DistTrain, and PP. Requested MoE expert-parallel communication overlap
is disabled with a warning. Standard eager alltoall EP has functional coverage
for Qwen3.6-35B-A3B at TP1/PP1/EP8 with overlap disabled; this is not performance
evidence. Other EP dispatchers are accepted with fixed-width native packs but do
not yet have equivalent runtime evidence. The Qwen-VL model derives a MoE
padding mask from logical and physical THD boundaries so fixed-width gaps do not
enter auxiliary-loss, z-loss, or expert-bias statistics. Current MCore may still
dispatch padded positions; expert-capacity/token-dropping configurations lack
native-packing runtime coverage.
Long-context baseline:
LLM packed SFT config surface:
The shared text-dataset helper currently opts into fixed-width packs. Treat that as a helper default, not a universal offline-packing runtime requirement; preserve it when the selected dispatcher, kernel, or CUDA-graph path requires static width.
Bridge validation:
Collate-time in-batch runtime used by VLM providers:
GPT-SFT direct-row packing:
Packed THD runtime constraint:
dataloader_type="single" or "cyclic"; it does not support "batch".2 * context_parallel_size divisibility.calculate_per_token_loss=True and ddp.average_in_collective=False are required.pad_cu_seqlens=True also requires pad_to_max_length=True.Qwen3-Next, GLM-4.5, and Qwen3.5-VL contain explicit opt-outs in different paths.samples_mapping, must retain an all-zero loss mask.global_batch_size must be divisible by and no smaller than data parallel size when offline packing uses MBS1.pad_seq_to_mult from CP/TP/SP for both SFT and PEFT; do not hardcode different values by workload type.pad_to_max_length controls final pack width and is conditional on fixed-shape execution requirements.packing_buffer_size is per worker and also affects validation; global/eval batch counts refer to physical packs rather than source conversations.Use the checked-in unit coverage:
Success criteria:
"batch" dataloaderGet started with chainctlchainctl skill install public/nvidia/nemo-mbridge-perf-sequence-packing:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.chainreg.biz/public/github.com/nvidia/skills/nemo-mbridge-perf-sequence-packing:latest
Apache-2.0
BENCHMARK.md
HARDENING.md
SKILL.md
card.yaml
evals/evals.json
skill-card.md
skill.oms.sig