-
Notifications
You must be signed in to change notification settings - Fork 515
add Qwen3-VL support for DFlash training #1975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5eebb59
301c7c1
b5aa42f
c35d490
19c23eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,6 +141,9 @@ def make_speculative_data_module( | |
| train_len=train_len, | ||
| local_image_path=data_args.vlm_img_dir, | ||
| return_labels=True, | ||
| answer_only_loss=answer_only_loss, | ||
| shift_labels=shift_labels, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [AI review] The PR description says Note this is broader than the |
||
| chat_template=chat_template, | ||
| ) | ||
|
|
||
| else: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[CRITICAL Algorithm]
VisionLanguageDataCollatordoes not acceptshift_labels, so this call raisesTypeError: __init__() got an unexpected keyword argument 'shift_labels'at runtime — crashing the exact VLM online path this PR adds.VisionLanguageDataCollator.__init__(modelopt/torch/utils/plugins/transformers_dataset.py:321) is declared as(self, processor, train_len, chat_template, add_generation_prompt, answer_only_loss, local_image_path, return_labels)— it has neither ashift_labelsparameter nor**kwargs, and it never forwardsshift_labelstosuper().__init__. The text-only branch above (LanguageDataCollator, line 135) is fine because that class does declareshift_labels, but the VLM subclass does not.This isn't caught by
test_vlm_data_module_passes_dflash_label_modebecause that test replacesVisionLanguageDataCollatorwith aMagicMock, which accepts any kwargs — so the real signature mismatch is masked.Impact: DFlash for Qwen3-VL requires
shift_labels=False, and passing it is the only way to get the unshifted-label behavior DFlash needs — the crash blocks the feature entirely for any real run.Fix: add
shift_labelstoVisionLanguageDataCollator.__init__and forward it tosuper().__init__(...)(the parent already stores and uses it). For example, intransformers_dataset.py:Consider having the test construct the real collator (or assert against its actual signature) so this class of mismatch is caught.