Skip to content

fix(test): set _train_data_dump in the TROPD advantage-stage test - #4464

Merged
terrykong merged 1 commit into
mainfrom
yifu/fix-sc-opd-test-train-data-dump
Oct 3, 2026
Merged

terrykong merged 1 commit into
mainfrom
yifu/fix-sc-opd-test-train-data-dump

Conversation

@yfw

@yfw yfw commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do ?

Fixes the L0_Unit_Tests_Other failure on main (run 37111913568, commit fb8396a):

FAILED unit/single_controller/test_single_controller_actor.py::test_opd_advantage_stage_pools_raw_gap_separately_under_tropd
E       AttributeError: 'SingleControllerActor' object has no attribute '_train_data_dump'
../nemo_rl/algorithms/single_controller.py:5460: AttributeError

#4347 made SingleControllerActor._advantage_stage read self._train_data_dump. It also set ctrl._train_data_dump = None in every test that builds the controller with object.__new__ and so skips __init__. The TROPD test from #4357 merged before #4347 but wasn't in #4347's branch, so it never got the attribute. It fails before reaching its OPD assertions; the advantage math isn't wrong.

This PR adds the same ctrl._train_data_dump = None setup line to that test. Production code is unchanged.

Issues

None filed. This is the scheduled main CICD failure above.

Testing

  • Reproduced locally at fb8396a with the same AttributeError at single_controller.py:5460.
  • With the fix, tests/unit/single_controller/ passes: 1076 passed.
  • An AST scan of tests/unit/ found no other test that builds the controller with object.__new__, calls one of the methods that read _train_data_dump (_advantage_stage, _advantage_input_fields, _train_pump), and lacks the attribute.

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. (N/A)

🤖 Generated with Claude Code

#4347 made SingleControllerActor._advantage_stage read
self._train_data_dump and set the attribute in every test that builds the
controller with object.__new__. The TROPD test added by #4357 landed in
between, so it never got the attribute and fails with AttributeError
before its OPD assertions (L0_Unit_Tests_Other on main, run 37111913568).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw yfw added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Oct 3, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yfw

yfw commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ba53f99

@terrykong
terrykong merged commit 5d6a1f0 into main Oct 3, 2026
95 checks passed
@terrykong
terrykong deleted the yifu/fix-sc-opd-test-train-data-dump branch October 3, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants