You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e16f918
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -275,17 +267,18 @@ if cu_seqlens.dim() > 1 and cu_seqlens.size(0) != 1:
275
267
## Pitfalls
276
268
277
269
1. Offline packed SFT, runtime in-batch packing, and Energon online packing are different features. Offline and Energon packing use physical MBS1; runtime in-batch packing uses MBS greater than one.
278
-
2. When CP is enabled, packed sequence lengths must respect `2 * context_parallel_size` divisibility.
279
-
3. For finetuning with CP, `calculate_per_token_loss=True` and `ddp.average_in_collective=False` are required.
280
-
4.`pad_cu_seqlens=True` also requires `pad_to_max_length=True`.
281
-
5. Packing support is model-family-specific. `Qwen3-Next`, `GLM-4.5`, and `Qwen3.5-VL` contain explicit opt-outs in different paths.
282
-
6. MTP finetuning is documented as incompatible with packed sequences.
283
-
7. Synthetic padding rows, including negative indices remapped through `samples_mapping`, must retain an all-zero loss mask.
284
-
8.`global_batch_size` must be divisible by and no smaller than data parallel size when offline packing uses MBS1.
285
-
9. Derive `pad_seq_to_mult` from CP/TP/SP for both SFT and PEFT; do not hardcode different values by workload type.
286
-
10.`pad_to_max_length` controls final pack width and is conditional on fixed-shape execution requirements.
287
-
11. Energon `packing_buffer_size` is per worker and also affects validation; global/eval batch counts refer to physical packs rather than source conversations.
2. GPT-SFT in-batch packing requires `dataloader_type="single"` or `"cyclic"`; it does not support `"batch"`.
271
+
3. When CP is enabled, packed sequence lengths must respect `2 * context_parallel_size` divisibility.
272
+
4. For finetuning with CP, `calculate_per_token_loss=True` and `ddp.average_in_collective=False` are required.
273
+
5.`pad_cu_seqlens=True` also requires `pad_to_max_length=True`.
274
+
6. Packing support is model-family-specific. `Qwen3-Next`, `GLM-4.5`, and `Qwen3.5-VL` contain explicit opt-outs in different paths.
275
+
7. MTP finetuning is documented as incompatible with packed sequences.
276
+
8. Synthetic padding rows, including negative indices remapped through `samples_mapping`, must retain an all-zero loss mask.
277
+
9.`global_batch_size` must be divisible by and no smaller than data parallel size when offline packing uses MBS1.
278
+
10. Derive `pad_seq_to_mult` from CP/TP/SP for both SFT and PEFT; do not hardcode different values by workload type.
279
+
11.`pad_to_max_length` controls final pack width and is conditional on fixed-shape execution requirements.
280
+
12. Energon `packing_buffer_size` is per worker and also affects validation; global/eval batch counts refer to physical packs rather than source conversations.
@@ -295,9 +288,8 @@ Use the checked-in unit coverage:
295
288
uv run python -m pytest tests/unit_tests/training/utils/test_packed_seq_utils.py -v && \
296
289
uv run python -m pytest tests/unit_tests/training/test_config.py -k "packed_sequence or enable_in_batch_packing or offline_and_in_batch_packing_are_mutually_exclusive or context_parallel_seq_length_divisibility or context_parallel_finetuning_validations" -v && \
297
290
uv run python -m pytest tests/unit_tests/data/packing/test_in_batch.py -v && \
298
-
uv run python -m pytest tests/unit_tests/data/datasets/test_gpt_sft.py -k "in_batch_packing or batch_dataloader" -v && \
0 commit comments