Repository navigation
Conversation
96473f8 to
a8913a1
Compare
Use Gym assessment before token rebuilding, preserve verifier grades and row metadata, and pool diagnostic counts across supported training paths. Keep raw dynamic sampling and make loop zeroing optional under the reward-shaping master switch. TODO after NVIDIA-NeMo/Gym#6846 merges: replace temporary Gym pin a8913a1e7e75e1b9cbf82c9bf02c6c494259db52 with the landed squash commit. Dependency alignment and uv.lock belong to the prerequisite branch. Signed-off-by: Renat Zayashnikov <[email protected]>
Use Gym assessment before token rebuilding, preserve verifier grades and row metadata, and pool diagnostic counts across supported training paths. Keep raw dynamic sampling and make loop zeroing optional under the reward-shaping master switch. TODO after NVIDIA-NeMo/Gym#6846 merges: replace temporary Gym pin a8913a1e7e75e1b9cbf82c9bf02c6c494259db52 with the landed squash commit. Dependency alignment and uv.lock belong to the prerequisite branch. Signed-off-by: Renat Zayashnikov <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
I reviewed all 17 changed files with separate detector, lifecycle and reporting reviews. No BLOCKER or RISK found. One non-blocking NOTE concerns unhandled late worker exceptions after assessment timeout or cancellation.
Validation used 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:d35258613354b88333a5bbd9894b49aa20345c50, the admitted default-branch tip's CI image, with Python 3.13.14. No successful head-image build was visible.
- Targeted reporting, pooling, reverification and CLI tests: 370 passed after installing missing optional
wandboutside the checkouts. The initial run had 3 failures and 6 skips; those resolved. - Focused lifecycle/collection/GDPVal tests: 9 passed. Detector tests: 5 passed, 4 deselected.
- Purpose-built probes exercised repetition boundaries, resource limits, real process recovery, cancellation, saved labels and weighted diagnostic counts. A base-versus-head probe kept existing quality and token metrics unchanged. The late-exception probe reproduced the NOTE below for both timeout and cancellation.
I relied on the head's successful Lint check for lint. No core/server CI test jobs were visible on this head. I did not run the full suite, live model rollouts, GPU tests or the companion RL integration.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
|
||
| future.add_done_callback(release) | ||
| submitted = True | ||
| return await asyncio.shield(asyncio.wrap_future(future)) |
There was a problem hiding this comment.
NOTE: Consume late exceptions after the assessment caller stops waiting.
At this shielded await, timeout or caller cancellation leaves the wrapped asyncio future running, but nothing retrieves its eventual exception. I exercised the real assessor with a delayed worker future using python /workspace/review-probes/leader/late_future_cases.py. Both paths invoked the loop's exception handler with Future exception was never retrieved and ValueError('late worker failure'). Capacity recovered and the next assessment returned False, so this is diagnostic noise rather than a scoring or backpressure failure.
Could you keep a named wrapped future and consume its terminal exception in a done callback, including when its waiter has gone away? Preserve shielding and the existing worker-completion capacity release; cancelling the caller must not cancel submitted work or free its slot early.
Acceptance: test timeout and explicit cancellation followed by a late worker exception, allow callback/reference cleanup, and assert that the event-loop exception handler is not invoked. Keep the capacity-reservation checks and verify that the next assessment succeeds.
ffrujeri
left a comment
There was a problem hiding this comment.
Thanks, one shared label for training and evaluation is a good direction, and the check is bounded and opt-in. Two questions inline before approval: how the check scales on the rollout completion path, and whether the new _ng_no_persist marker changes runs that do not enable it. CI is waiting on a maintainer's /ok to test.
| if owned_token_source is not None: | ||
| output_files.push_async_callback(owned_token_source.close) | ||
| output_files.enter_context(store) | ||
| looping_assessor = LoopingAssessor() if config.assess_looping else None |
There was a problem hiding this comment.
Gym runs thousands of rollouts at once, and each one awaits this check before it completes. With one worker, the checks run one at a time, and a check can use up to 4M steps of pure Python. At high concurrency, many checks wait past the 30 s timeout and return None, so looping/coverage drops and each rollout is held up to 30 s. Could the worker count follow the available CPUs (or a config field), and could a test or a smoke run show coverage at a realistic concurrency?
There was a problem hiding this comment.
I agree, good catch about the need to increase the num of cpu workers and make it truly parallell!
added looping_workers and moved the checks into the per-rollout tasks so the pool can actually run them in parallel
There was a problem hiding this comment.
In terms of evidence I did have some production runs with looping zeroing on, although it was an older code w/o CPU pools and just with asyncio.to_thread spread across 16 Gym replicas
Coverage was close to 100% (99.98%), in terms of time was 12 ms per response
There was a problem hiding this comment.
But will try to run a newer smoke test to prove on the current code!
There was a problem hiding this comment.
For large runs also important that uses sets num Gym replicas >> 1 (e.g. 16), as we saw in large runs other things could also be problematic in low num Gym replicas
| # This metrics-only copy honors the explicit denominator policy. The original | ||
| # answer, failure diagnostics, and training mask remain untouched in the sidecar. | ||
| scored["mask_sample"] = False | ||
| scored[NG_NO_PERSIST_KEY] = True |
There was a problem hiding this comment.
These metric-input copies now carry _ng_no_persist, also when assess_looping is off. Other readers skip rows with that key, for example nemo_gym/artifacts/exporters/mlflow.py (_is_exportable). Does any of them read these copies, so a run with count_failure_classes_as_zero reports differently? If the marker is only for looping_metrics, could it be a key that only that function reads?
There was a problem hiding this comment.
changed this to _ng_looping_excluded so only the looping counter reads it.
|
/review 001df4f |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
This is a follow-up to review 6121132798, not a fresh broad review. The admitted head is identical to that review's commit, so there are no post-review changes or eligible new findings. I verified the prior review and its inline NOTE with a delegated reviewer.
Prior NOTE, unchanged: late worker exceptions remain unconsumed. At the shielded await, a worker failure after caller timeout or cancellation still produces Future exception was never retrieved. This remains low-impact diagnostic noise in the exercised paths: cancellation propagated, capacity stayed reserved until worker completion, and the next assessment returned False.
The existing suggestion in comment 4745950906 still applies: keep a named wrapped future and retrieve its terminal exception through a done callback. Preserve shielding and worker-completion capacity release. Acceptance should cover timeout and explicit cancellation followed by a late exception, verify no unhandled-exception callback after reference cleanup, and confirm the next assessment succeeds. I found no basis to escalate this NOTE to RISK or BLOCKER.
Validation used 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:d35258613354b88333a5bbd9894b49aa20345c50, the admitted default-branch CI image, with Python 3.13.14. No successful head-image build was visible. Two CPU probe scripts exercised the real assessor with fake worker futures and reproduced both interruption paths. An initial probe assertion retained a mock reference too long; the corrected probe passed. I relied on the head's successful Lint check; no core/server CI test jobs were visible. I reused the unchanged baseline validation rather than rerunning its suites. No live model, GPU, or companion RL integration runs were performed.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
/ok to test 001df4f |
|
CI ran at |
Thanks for the warning, fixed the test! |
Add a bounded shared text assessor with process execution, persist row labels before enrichment, and report pooled evaluation rates and coverage. Signed-off-by: Renat Zayashnikov <[email protected]>
Name repeat-derived metrics explicitly, reserve looping metrics for pooled counts, and explain both aggregation rules in comparison notes. Extend the existing regression to prevent repeat ratios from overwriting the combined rate. Signed-off-by: Renat Zayashnikov <[email protected]>
Discard a broken executor only when it is still the assessor current pool, allowing the next assessment to recreate it. Retain the existing unknown outcome and future-based capacity handling. Extend the spawned-worker regression with an actual child exit and verify that a replacement pool resumes assessment. Signed-off-by: Renat Zayashnikov <[email protected]>
Overlay shared looping counts after custom aggregation, using the original completed rows. Extend existing regressions to protect saved annotations, unknown labels and worker capacity after deadline expiry. Signed-off-by: Renat Zayashnikov <[email protected]>
Signed-off-by: Renat Zayashnikov <[email protected]>
Use the shared environment-server-aware identity resolver for coverage and retain the full-input label map while quality scores are filtered. Extend existing profile regressions for episode rows, shared agents and fully masked runs. Signed-off-by: Renat Zayashnikov <[email protected]>
Signed-off-by: Renat Zayashnikov <[email protected]>
Signed-off-by: Renat Zayashnikov <[email protected]>
Signed-off-by: Renat Zayashnikov <[email protected]>
Signed-off-by: Renat Zayashnikov <[email protected]>
95161b7 to
d87c295
Compare
|
/review d87c295 |
|
/ok to test d87c295 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
The prior NOTE is fixed. I found no new findings above the prior low-impact ceiling in this follow-up to review 6137889672. The earlier reviewed revision is unavailable for comparison, so I could not verify an exact post-review diff.
The exception-consumption callback handles late worker failures after timeout and cancellation. Fake-future and real-process probes produced zero unhandled-exception callbacks, kept capacity reserved until worker completion, and allowed the next assessment to succeed.
I reviewed the changes with three delegated reviewers. CPU probes also confirmed overlapping assessment without holding the HTTP admission slot, saved-label preservation, reverification filtering, and count-weighted pooled metrics. A base-versus-head probe kept existing quality, token, group and repeat metrics unchanged. The real profiling CLI kept run labels distinct across masked and missing outputs.
Validation used gym:d35258613354b88333a5bbd9894b49aa20345c50, the default branch’s CI image, with Python 3.13.14. An initial GDPVal probe loaded the image’s source copy; the corrected probe exercised this PR’s source and passed. No production-scale load, live-model, GPU or companion RL integration run was performed.
I relied on CI for the existing suites. Lint check, Unit tests / Test, and Unit tests / Server suite passed for the merge of this head into the supplied base. The four core shards report 26,188 passed and 207 skipped. The optional harness-conformance check is red for OpenClaw, OpenCode and mini-SWE. OpenClaw and OpenCode show matching timeouts on base; mini-SWE reports missing or schema-invalid scenario evidence, which I have not attributed to this change.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
Signed-off-by: Renat Zayashnikov <[email protected]>
|
/ok to test cee4bcb |
What does this PR do?
Training and evaluation need the same severe text-loop label. Add one shared text detector and use it during Gym rollout collection.
LoopingAssessor.assess()accepts a response mapping orNoneand returnsbool | None: detected, checked without finding a loop, or unavailable. Saved rows carry onlyis_looping.looping/rateamong checked completed outputs andlooping/coverageamong all completed outputs. Masked completed outputs count; failed or imputed zeros do not. Combined reports sum counts before deriving fractions.Enable with
++assess_looping=true; it is off by default.LoopingLimitsholds the shared resource bounds. GDPVal multistage collection rejects this option before preprocessing or dispatch until its driver supports assessment.Companion NRL integration: training metrics and optional reward safeguard. No separate issue: this opt-in feature and the companion PR track the work.
Validation
1,617 CPU tests passed on Python 3.13.14 across the complete collection, reverification, looping, comparison, profiling, aggregation, evaluation CLI and GDPVal multistage test modules. Full local pre-commit passed; the private guardword catalog was unavailable and its hook explicitly skipped.
The same looping, ordinary and unreadable inputs also produced matching true/false/null labels through the real Gym assessor and NRL result-processing path in both tested Forest modes. Scores remained unchanged. The regression tests cover actual verifier request filtering, saved aggregate diagnostics and bounded worker-crash cleanup.
Rollouts
N/A for model rollouts: this changes post-response assessment and reporting, with no model generation, environment interaction or verifier-rule changes. No live model evaluation or GPU training run was performed.
Compatibility and benchmark impact
Off by default. Assessment adds
is_loopingand diagnostic metrics without changing verifier grades or quality scores. Unknown labels reduce coverage. The detector checks assistant and visible reasoning text for severe repetition; it does not add a tool-cycle detector. Profiling uses full-input environment-server identities so masked runs retain the correct diagnostic labels.Follow-up validation: all 9 detector tests passed after extending the existing fixtures for summary-only reasoning and the executor shutdown request. Pre-commit checks passed for the changed test file.
Checklist
pre-commit run --all-files).git commit -s).