Skip to content

Conversation

@parthchadha
Copy link
Contributor

@parthchadha parthchadha commented Jan 21, 2026

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Issues

closes #1761

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

Summary by CodeRabbit

Release Notes

New Features

  • Added optional logging capability for validation data during training, enabling JSONL export of validation metrics
  • Logger parameter is optional and backward compatible—validation works with or without logging enabled
  • Improved visibility into model performance throughout the training process

Tests

  • Added unit tests covering validation logging scenarios, including logger-enabled paths and configurations without a logger

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Parth Chadha <pchadha@nvidia.com>
Signed-off-by: Parth Chadha <pchadha@nvidia.com>
@parthchadha parthchadha requested review from a team as code owners January 21, 2026 21:40
@parthchadha parthchadha changed the title #1761: log validation data fix: log validation data Jan 21, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

The changes add optional logger parameter propagation through GRPO validation functions. When a logger is provided to validate(), it writes validation data to JSONL files named val_data_step{step}.jsonl. The grpo_train and async_grpo_train functions now pass their logger instances to validate() calls, with new unit tests covering both logger-enabled and logger-free execution paths.

Changes

Cohort / File(s) Summary
Core algorithm updates
nemo_rl/algorithms/grpo.py
Updated validate() function signature to accept optional logger parameter. Modified grpo_train() and async_grpo_train() to pass logger=logger when calling validate(). Added conditional JSONL logging of validation data when logger is provided.
Unit test coverage
tests/unit/algorithms/test_grpo.py
Added three new test cases for validate() function: test_validate_logs_data_when_logger_provided (verifies JSONL file creation with correct data keys), test_validate_works_without_logger (validates execution without logger), and test_validate_returns_empty_when_no_dataloader (validates empty metrics handling). Tests use mocks for environment, rollout, and configuration objects.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Test Results For Major Changes ⚠️ Warning PR introduces major feature (validation data logging) but provides no documentation of testing, test results, or verification in the description. Update PR description to document: (1) summary of three unit tests and their verification scope, (2) confirmation that existing GRPO validation behavior remains unchanged, (3) test suite results confirming no regressions introduced.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: log validation data' directly and clearly summarizes the main change—adding logging functionality to validation data.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@terrykong terrykong added the CI:L1 Run doctests, unit tests, and functional tests label Jan 21, 2026
@terrykong terrykong enabled auto-merge (squash) January 21, 2026 21:46
@parthchadha parthchadha added the CI:L0 Run doctests and unit tests label Jan 21, 2026
@parthchadha parthchadha added CI:L0 Run doctests and unit tests and removed CI:L0 Run doctests and unit tests CI:L1 Run doctests, unit tests, and functional tests labels Jan 22, 2026
@yuki-97 yuki-97 added CI:L0 Run doctests and unit tests and removed CI:L0 Run doctests and unit tests labels Jan 22, 2026
@terrykong terrykong merged commit 6a66739 into main Jan 22, 2026
40 of 41 checks passed
@terrykong terrykong deleted the pchadha/add-valid-data-dump branch January 22, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L0 Run doctests and unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add valid data dump in log

4 participants