Skip to content

Allow zero loss_mask for remove_sample'd rollouts#60

Draft
nightlessbaron wants to merge 1 commit into
prodfrom
feat/validator-allow-removed-zero-mask
Draft

Allow zero loss_mask for remove_sample'd rollouts#60
nightlessbaron wants to merge 1 commit into
prodfrom
feat/validator-allow-removed-zero-mask

Conversation

@nightlessbaron

Copy link
Copy Markdown

validate_rollout_for_grpo_training_step rejects any sample with an all-zero loss_mask as a hard error. But rollout sample filters (mask_truncated / mask_token_truncated) legitimately zero a sample's loss_mask via remove_sample to drop it from the gradient while keeping its reward in the group baseline — and the token-mean reducer clamps the denominator, so an all-zero mask is safe.

Downgrade that case to a warning so masking doesn't crash train_actor.

… samples

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nightlessbaron nightlessbaron force-pushed the feat/validator-allow-removed-zero-mask branch from 95526d0 to b98a2bf Compare July 1, 2026 02:56
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.

1 participant