feat: Overlong filtering for GRPO - #724
Conversation
b9f88b7 to
0bdd593
Compare
c6b1563 to
bf511aa
Compare
- Add overlong_filtering config option to filter out samples that reach max_total_sequence_length - Add truncated field to rollouts to track which samples were truncated - Update documentation to explain the feature - Add overlong_filtering: false to all GRPO config files Signed-off-by: jubick1337 <mattyson.so@gmail.com>
bf511aa to
5ea6c65
Compare
|
@SahilJain314 thank you for the review! |
Signed-off-by: Matvei Novikov <mattyson.so@gmail.com>
ashors1
left a comment
There was a problem hiding this comment.
Thank you for the PR @jubick1337! This looks good to me. @SahilJain314 any other comments from your side?
âĶmples - Add overlong_filtering flag to GRPOConfig - Set loss_multiplier to 0 for truncated samples when flag is enabled - Set token_loss_mask to 0 for assistant tokens in truncated samples - Add truncated field to batch in both sync and async rollout functions Signed-off-by: jubick1337 <mattyson.so@gmail.com>
- Set overlong_filtering to false by default in all base GRPO configurations - This ensures backward compatibility as the feature is opt-in - Configs that inherit from these bases will also inherit this setting - Users can override by setting overlong_filtering: true when needed Signed-off-by: jubick1337 <mattyson.so@gmail.com>
âĶk special-casing and rely on sample_mask only Signed-off-by: jubick1337 <mattyson.so@gmail.com>
âĶts; include overlong_filtering: false Signed-off-by: jubick1337 <mattyson.so@gmail.com>
âĶ/llm versions (8K includes overlong_filtering: false) Signed-off-by: jubick1337 <mattyson.so@gmail.com>
Signed-off-by: Matvei Novikov <mattyson.so@gmail.com>
- The 'truncated' field is always added by rollout functions (both sync and async) - Simplifies the code by removing unnecessary defensive programming - As discussed in PR review, this field should always be present when using the standard pipeline Signed-off-by: jubick1337 <mattyson.so@gmail.com>
Signed-off-by: jubick1337 <mattyson.so@gmail.com> Signed-off-by: Matvei Novikov <mattyson.so@gmail.com>
|
Hi @jubick1337, the presubmit CI failed because new multimodal recipes were recently added to main: https://github.com/NVIDIA-NeMo/RL/actions/runs/17089287317/job/48467257968#step:3:7379. Would you be able to help resolve this? Then we can merge |
Certainly, Iâll handle this and let you know once itâs ready. |
- Added overlong_filtering: false to 6 standalone GRPO configs that were missing it - Configs that inherit from base configs already have this setting and don't need it added - This ensures all GRPO configs have consistent overlong filtering behavior Signed-off-by: jubick1337 <mattyson.so@gmail.com>
- Added overlong_filtering: false to 3 VLM GRPO configs that were missing it - vlm_grpo_3B.yaml - vlm_grpo-qwen2.5-vl-3b-instruct-clevr-1n2g-dtensor2tp1.v1.yaml - vlm_grpo-smolvlm2-2.2b-instruct-clevr-1n2g-dtensor2tp1.v1.yaml - This completes the addition of overlong_filtering to all GRPO configs Signed-off-by: jubick1337 <mattyson.so@gmail.com>
|
@terrykong I updated vlm configs, should be good now |
Signed-off-by: jubick1337 <mattyson.so@gmail.com> Signed-off-by: Matvei Novikov <mattyson.so@gmail.com>
Signed-off-by: jubick1337 <mattyson.so@gmail.com> Signed-off-by: Matvei Novikov <mattyson.so@gmail.com>
What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information