Repository navigation
perf(cispo): support single-forward training - #4670
Conversation
Signed-off-by: Filippos Christianos <[email protected]>
0b0c50b to
a67cc3e
Compare
terrykong
left a comment
There was a problem hiding this comment.
Thanks for this. Reusing the existing knobs (force_on_policy_ratio + TIS) instead of adding a new config key keeps the config small. The new loss test runs on CPU (its CISPO siblings need CUDA), so it actually runs in CPU CI. The new SingleController test case fails if the validator change is reverted, so it tests the right thing. The math checks out: for one update per rollout, single-forward CISPO gives the same loss and gradient as two-forward CISPO with the same TIS bounds. This holds numerically on CPU, including with torch.compile.
Once the loss-function branches go back to the base code, what this PR really changes is: allow CISPO + force_on_policy_ratio (guarded by the IS + TIS assert), allow it with the SingleController ready_first sampler, and add docs.
Perf numbers (not blocking). The title says perf(...). Please add one before/after step-time line on any one-update CISPO config: total step time and logprob-inference time, mean over at least 10 steps after warm-up, with GPU SKU and node count.
No action needed. The ready_first force_on_policy_ratio=false guard from #3582 (#3582) looks stricter than needed when SingleController runs one optimizer step per RL step. The CISPO carve-out in this PR is fine as is; widening it to other losses is out of scope here.
Visual explainer: https://terrykong.github.io/gh-pages-poc/terryk/pr-4670-single-forward-cispo.html
Generated by Claude Code
Signed-off-by: Filippos Christianos <[email protected]>
|
Thank you @terrykong -- I addressed the comments. Also, I added some numbers in the main PR description; for my workload I am seeing ~15-20% faster step time (excluding waiting for trajectories). |
|
/ok to test dd5a038 |
|
|
|
@semitable yea, it appears to be a flaky test/infra issue there was a babysitting agent that would've restarted the flaky test so we don't have to wait for everything, just need to wait for the next "tick" of its check since you merged in main we'll need to kick off another run, but for future ref if you suspect flaky, then you can click on the test and click this: rerun failed jobs, to only rerun the flaky |
|
/ok to test 10927f6 |
…failures-and-redispatch main gained #4481, #4771, #4458, #4770, #4640, #4765, #4525 and #4670 since the previous merge. #4640 (rubric-mean and fixed-baseline GenRM scoring) rewrote the metric assertions in tests/unit/experience/test_rollouts.py that this branch also edits for nemo_gym_infra_redispatches: the resolution keeps main's per-key assertions and adds the redispatch count beside them, and the expected rollout_metrics dict carries both sides' new keys. test_rollouts.py, test_rollout_manager.py and test_nemo_gym.py pass locally on the merged tree. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: alexandery <[email protected]>
…andery/gym-health-check-during-collection Carries the stack root's merge of main (8338530: #4481, #4771, #4458, #4770, #4640, #4765, #4525 and #4670) forward so this head stays current with main. No conflicts; test_rollouts.py, test_rollout_manager.py and test_nemo_gym.py pass locally on the merged tree. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: alexandery <[email protected]>
…xandery/gym-rollout-metrics-hook Carries the stack's merge of main (8338530: #4481, #4771, #4458, #4770, #4640, #4765, #4525 and #4670) forward. #4640 (rubric-mean and fixed-baseline GenRM scoring) reports the shared GenRM fields once per group through _nemo_gym_group_metrics and skips them in both per-agent loops, which this branch had replaced with per_agent_result_metrics: the resolution keeps the helper on both paths and adds the same _SHARED_GENRM_METRICS skip inside it, so the manager no longer imports the constant. test_rollouts.py, test_rollout_manager.py and test_nemo_gym.py pass locally on the merged tree. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: alexandery <[email protected]>

What does this PR do?
Allow CISPO to skip the extra policy forward using
force_on_policy_ratio=true, while retaining per-token clipped importance weights.Issues
None.
Usage
For one optimizer update per rollout batch:
Improvements
Tested on an agentic coding workload with a 128K context limit, using 16 GB300 training GPUs and separate rollout workers. Each optimizer update uses 256 trajectories (16 prompts × 16 generations), with sequence packing and approximately 48–61 accumulated microbatches in the baseline.
On this setting, observed non-wait optim step time was 21% lower, or approximately 14% lower when normalized by token count.
Before your PR is "Ready for review"