Skip to content

Fix action_loss_per_sample shape for has_real_action - #45

Open
Loki-Lu wants to merge 1 commit into
dreamzero0:mainfrom
Loki-Lu:Loki-Lu-patch-1
Open

Fix action_loss_per_sample shape for has_real_action#45
Loki-Lu wants to merge 1 commit into
dreamzero0:mainfrom
Loki-Lu:Loki-Lu-patch-1

Conversation

@Loki-Lu

@Loki-Lu Loki-Lu commented Mar 24, 2026

Copy link
Copy Markdown

This PR is used to fix: #25

@jeqcho

jeqcho commented Aug 7, 2026

Copy link
Copy Markdown

Independent confirmation: we hit the identical crash fine-tuning DreamZero-AgiBot on bimanual YAM data with per_device_train_batch_size=4 (the yam_training.sh default), and arrived at this exact one-line fix before finding this PR. has_real_action[:, None] right-aligns as (1, B, 1) against the [B, T, D] loss; B=1 happens to broadcast with correct semantics, which is why batch-1 runs never see it — but it also means the released batch-4 YAM script cannot have run as shipped.

We ran with this fix for a full 12k-step LoRA fine-tune at global batch 32 (training stable throughout; released at https://huggingface.co/robocurve/dreamzero-yam-molmoact2, training code at https://github.com/robocurve/dreamzero-yam). Would be great to see this merged — it currently blocks anyone from using batch > 1 on the LeRobot fine-tuning path.

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.

RuntimeError: Broadcasting dimension mismatch in action loss computation when batch_size > 1

2 participants