feat(data): enable native Energon packing for Qwen3-VL - #5285
Conversation
7c7a2e1 to
6990a24
Compare
|
/nvskills-ci |
|
Review — Energon online sequence packing for Qwen3-VL Solid, cohesive change. The native-packing path is well-gated by config validation, the FLOP refactor cleanly preserves per-media attention boundaries, and test coverage is thorough (config gating, task-encoder pack/batch, savable-loader restore + partial-buffer flush, exact-vs-legacy ViT FLOP stats). Observations: Correctness / behavior:
Docs / comments:
Nits (non-blocking):
Suggested test cases:
No perf/recipe launcher configs under scripts/performance/configs/ were touched — no perf tests impacted. |
|
/nvskills-ci |
|
/nvskills-ci |
|
/nvskills-ci |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
6fd3de2 to
0fccbce
Compare
|
/nvskills-ci |
|
/ok to test 0fccbce |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test 71fb704 |
|
/nvskills-ci |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test 11b53ae |
|
/nvskills-ci |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test 85f2ac6 |
|
/nvskills-ci |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/nvskills-ci |
|
/ok to test a33631a |
Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Summary
select_samples_to_packandpack_selected_samplesAPIspacking_buffer_sizecandidates per workercu_seqlens_q/kv, optional padded boundaries, andmax_seqlen_q/kv) with visual tensors, labels, loss masks, and position IDsBackground and behavior
The existing Qwen-VL path could pack only within a collator microbatch. That lifecycle does not use Energon's buffered selection, checkpoint, or restore APIs. This change makes
packing_buffer_sizethe sole selector for native Energon packing on supported Qwen-VL recipes.packing_buffer_sizeis a candidate count per worker, not bytes or packed tokens. Each source sample is processed once before selection, then Energon chooses compatible samples from the buffer and emits one physical MBS1 pack containing multiple independent conversations. THD boundaries prevent cross-conversation attention; terminal labels and aligned gaps are masked so loss does not cross conversations.This is online packing. Users prepare the normal Energon WebDataset once; no offline packed-data rewrite is required.
The legacy
enable_in_batch_packinganddefer_in_batch_packing_to_stepfields remain because generic HF, Nemotron Omni, dataset conversion, and the legacy Qwen step still use them. Native packing leaves those flags at their defaults and rejects conflicting owners.Supported scope and guardrails
vlm_stepaverage_in_collective=False)Configuration fails early for unsupported task encoders/models, legacy packing conflicts, MBS greater than 1, MTP, language or vision CUDA graphs, DistTrain, and pipeline parallelism. With EP greater than one, native packing emits fixed-width physical rows so other dispatchers are not rejected by this validation layer; only standard eager
alltoallhas the EP8 runtime evidence below. Requested MoE EP communication overlap or delayed weight-gradient compute is disabled with a warning before communication-overlap setup. Current MCore excludes fixed-width padding from z-loss, auxiliary-loss, and expert-bias statistics but may still dispatch it, so expert-capacity/token-dropping configurations remain unvalidated. Consecutive overlength native samples use Energon bounded failure tolerance instead of spinning indefinitely.Tutorial
The expanded Energon tutorial covers:
The Qwen3-VL example and packed-sequence documentation link to the same workflow.
Validation
Final review and targeted tests
uv run pre-commit run --all-files: all hooks passed15185140(packing/native/text 30, packed model legacy-SP-CP-mask 6, transformer propagation/checkpoint 3, native config 13, overlap/delay fallback 3)origin/mainremainsEOS real-model EP8 functional validation
bfa6d894d1ca11c3437938feb266bd51bd72b15aand MCore6513e3e23d6b5eda6a1c934990b15e804237732bwith Qwen3.6-35B-A3B revision995ad96eacd98c81ed38be0c5b274b04031597b0, 256 experts, TP1/PP1/CP1/EP8, standard eageralltoall, EP overlap and delayed wgrad disabledc7a02cb487da0eca729e133194b0f842cb578c08through an Energon cacheCW interactive training validation
PackingDataset: 876 physical tokens from four source sequences; checkpoint/restore produced identical next-pack keys and tensorsThe fixed-width follow-up changes affect the EP execution path: physical tail padding is masked from MoE loss/statistics, while current MCore may still dispatch padded positions. The existing W&B runs validate standard eager
alltoall, overlap disabled; they do not validate allgather, flex, capacity dropping, or performance. No dependency or CI workflow changes are included.Known reporting caveat
progress.txtTokensandtime/tokensstill represent configured token capacity (consumed_train_samples * model.seq_length), not exact partial-pack occupancy or useful unpadded tokens. Making that cumulative counter resume-correct requires a separate backward-compatibleTrainStatecheckpoint migration.