Skip to content

[vla] fix: Add batch drop-last configuration - #133

Merged
nullnonenilNULL merged 1 commit into
baidu-baige:masterfrom
XueSongTap:master
Jul 29, 2026
Merged

[vla] fix: Add batch drop-last configuration#133
nullnonenilNULL merged 1 commit into
baidu-baige:masterfrom
XueSongTap:master

Conversation

@XueSongTap

Copy link
Copy Markdown
Collaborator

Summary

This PR makes batch_drop_last easier to configure for VLA training.

The option controls whether the final incomplete batch is dropped and is applied consistently to both the sampler and the DataLoader.

Configuration

Default behavior

When no option is specified, the final incomplete batch is preserved:

Enable drop-last

Add the following flag to the training command:

--batch-drop-last

When enabled, the final batch is dropped if it contains fewer samples than the configured batch size.

Explicitly disable drop-last

The behavior can also be explicitly disabled with:

--no-batch-drop-last

Behavior

Configuration batch_drop_last Behavior
Option omitted False Preserve the final incomplete batch
--batch-drop-last True Drop the final incomplete batch
--no-batch-drop-last False Preserve the final incomplete batch

This configuration is applied to:

  • The distributed sampler
  • The DataLoader

For distributed training, enable --batch-drop-last when every rank should process the same number of full-sized batches.

Example Updates

The PI0.5 DDP, ZeRO-1, and FSDP fine-tuning examples now explicitly enable:

--batch-drop-last

@nullnonenilNULL nullnonenilNULL changed the title [vla] Add batch drop-last configuration [vla] fix: Add batch drop-last configuration Jul 29, 2026
@nullnonenilNULL
nullnonenilNULL merged commit c2ed396 into baidu-baige:master Jul 29, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants