Skip to content

Commit e7a9a59

Browse files
committed
[vla] Add batch drop-last switch
1 parent 6c4bb51 commit e7a9a59

4 files changed

Lines changed: 5 additions & 12 deletions

File tree

examples/embodied/pi05/run_pi05_ddp_finetune.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ DATA_ARGS=(
4646
--tokenizer-path $TOKENIZER_PATH
4747
--robot-type libero_franka
4848
--num-workers 16
49+
--batch-drop-last
4950
)
5051

5152
# ── Training params ───────────────────────────────────────────

examples/embodied/pi05/run_pi05_ddp_zero1_finetune.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ DATA_ARGS=(
5252
--tokenizer-path $TOKENIZER_PATH
5353
--robot-type libero_franka
5454
--num-workers 16
55+
--batch-drop-last
5556
)
5657

5758
# ── Training params (aligned with examples/pi05/finetuning/sft_pi05.sh) ──

examples/embodied/pi05/run_pi05_fsdp_finetune.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ DATA_ARGS=(
5151
--tokenizer-path $TOKENIZER_PATH
5252
--robot-type libero_franka
5353
--num-workers 16
54+
--batch-drop-last
5455
)
5556

5657
# -- Training params (aligned with examples/pi05/finetuning/sft_pi05.sh) ------

loongforge/embodied/train/training_args.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@
4949
# ---------------------------------------------------------------------------
5050

5151

52-
def parse_bool(value: str) -> bool:
53-
"""Parse bool from CLI text: true|false|1|0|yes|no."""
54-
if value.strip().lower() in {"true", "t", "1", "yes"}:
55-
return True
56-
if value.strip().lower() in {"false", "f", "0", "no"}:
57-
return False
58-
raise argparse.ArgumentTypeError(f"Expected true/false, got: {value!r}")
59-
60-
6152
def parse_reshard_after_forward(value: str):
6253
"""Parse FSDP2 reshard_after_forward from CLI text: true|false|none|int>1."""
6354
normalized = value.strip().lower()
@@ -667,13 +658,12 @@ class _DataArgs:
667658
},
668659
)
669660
batch_drop_last: bool = field(
670-
default=True,
661+
default=False,
671662
metadata={
672-
"cli_type": parse_bool,
673663
"help": (
674664
"If True, drop the last incomplete batch so every rank sees the same "
675665
"number of full-size batches. Applied to both sampler and DataLoader. "
676-
"Default True preserves training stability."
666+
"Default False preserves all samples."
677667
),
678668
},
679669
)

0 commit comments

Comments
 (0)