fix(vlm): support packed THD Step3.7 pipeline training - #3572
fix(vlm): support packed THD Step3.7 pipeline training#3572new-TonyWang wants to merge 1 commit into
Conversation
|
Thank you @new-TonyWang , could you please resolve the merge conflicts? Thank you! |
jgerh
left a comment
There was a problem hiding this comment.
Completed tech pubs review of docs/STEP3P7_TEXT_THD_PACKING.md. Provided a few copyedits and formatting updates to better align with our style guide.
| @@ -0,0 +1,63 @@ | |||
| # Step-3.7 text SFT with THD packed sequences | |||
There was a problem hiding this comment.
Note: The file naming convention for Markdown files is lowercase with hyphens (kebab-case). Please rename STEP3P7_TEXT_THD_PACKING.md to step3p7-text-thd-packing.md, and update any cross-references or index.md entries that point to it.
| # Step-3.7 text SFT with THD packed sequences | |
| # Step-3.7 Text SFT with THD Packed Sequences |
| @@ -0,0 +1,63 @@ | |||
| # Step-3.7 text SFT with THD packed sequences | |||
|
|
|||
| AutoModel's VLM packing pipeline can now consume tokenizer-aware datasets such | |||
There was a problem hiding this comment.
| AutoModel's VLM packing pipeline can now consume tokenizer-aware datasets such | |
| NeMo AutoModel's VLM packing pipeline can now consume tokenizer-aware datasets such |
| AutoModel's VLM packing pipeline can now consume tokenizer-aware datasets such | ||
| as `ChatDataset` without re-tokenizing them through the multimodal processor. | ||
|
|
||
| ## Data flow |
There was a problem hiding this comment.
| ## Data flow | |
| ## Data Flow |
| concatenation and gives each document its own attention-mask ID and | ||
| zero-based position IDs. | ||
| 5. `packed_sequence_thd_vlm_collater` emits `qkv_format: thd`, `seq_lens`, and | ||
| `seq_lens_padded`; Transformer Engine derives `cu_seqlens` from these values. |
There was a problem hiding this comment.
| `seq_lens_padded`; Transformer Engine derives `cu_seqlens` from these values. | |
| `seq_lens_padded`. Transformer Engine derives `cu_seqlens` from these values. |
|
|
||
| ## Config | ||
|
|
||
| Smoke config: |
There was a problem hiding this comment.
| Smoke config: | |
| Use the following smoke config: |
| examples/vlm_finetune/stepfun/step3p7_single_node_8xh200_text_sft_offload_8k_thd_packed_bs32_smoke.yaml | ||
| ``` | ||
|
|
||
| Full-data config: |
There was a problem hiding this comment.
| Full-data config: | |
| Use the following full-data config: |
| examples/vlm_finetune/stepfun/step3p7_single_node_8xh200_text_sft_offload_8k_thd_packed_bs32_train.yaml | ||
| ``` | ||
|
|
||
| Key settings: |
There was a problem hiding this comment.
| Key settings: | |
| The key settings are: |
|
|
||
| `local_batch_size` counts packs, not original conversations. | ||
|
|
||
| ## Validation evidence |
There was a problem hiding this comment.
| ## Validation evidence | |
| ## Validation Evidence |
| had shape `(4, 8192)`, and a multi-document pack emitted sequence lengths | ||
| `[7377, 312, 191, 136]`. | ||
|
|
||
| GPU forward/backward/optimizer validation must be performed only after the |
There was a problem hiding this comment.
| GPU forward/backward/optimizer validation must be performed only after the | |
| Perform GPU forward, backward, and optimizer validation only after the |
|
Thank for the PR @new-TonyWang . Looks like there are a lot of things happening in this PR. Would you mind splitting it into several manageable pieces? e.g. I see thd+pp support with step37, cpu offload, dion related, dataset related etc. Thank you so much appreciate it! |
|
@jgerh @HuiyingLi Thank you all, bro! This PR isn鈥檛 finished yet. I鈥檒l resolve the merge conflicts, run more compatibility tests, and improve the documentation. |
Summary
Validation
Notes
The end-to-end validation used
mu=0for the stateless Muon path. This PR does not claim equivalent memory behavior for momentum Muon configurations.