Repository navigation
refactor(agent): decouple simple-agent compaction from model serving - #3368
aroshanghias-nvd wants to merge 28 commits into
Conversation
Pass immutable local tensor attachments through worker capture and preserve image descriptors in vLLM extras. Retain stage-before-ack ordering and token-only sink compatibility. Builds on the served-response ancestry fix from NVIDIA-NeMo#3301 and the VLM capture work in NVIDIA-NeMo#3368. Signed-off-by: Pranav Prashant Thombre <pthombre@nvidia.com>
3e8a828 to
21965f1
Compare
21965f1 to
4769525
Compare
|
Please authorize the standard Gym CI for draft PR #3368 at |
cf90856 to
115f2db
Compare
Let training frameworks own capture roots and continuation decisions using request replay evidence and committed coordinates. Preserve completion identity, buffered Responses capture, explicit retry controls, and exact measurement through the ordinary vLLM server. Keep the existing compaction agent and model intact in this infrastructure layer. The native agent migration is a separate stacked change. Validation: 618 core/model cases and 56 retained legacy agent/model cases passed on Mac CPU across the documented runs. Combined-head GPU smoke evidence is recorded separately. Co-authored-by: alexandery <alexandery@nvidia.com> Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
115f2db to
b27e0db
Compare
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Preserve concurrent framework capture alongside upstream rollout timing, outbound telemetry, tool-call attribution, and canonical finish reasons. Keep retry suppression effective with metrics and tracing enabled. Validation: 2,475 affected Gym CPU tests and 184 paired RL compatibility tests passed; two optional custom OpenCode exporter cases skipped. Full pre-commit passed. Fern check passed with the unauthenticated redirect check skipped. Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Move semantic history, policies and the context client into the reusable context_management package. Return ordinary accepted rollout history from simple_agent_with_compaction and use the ordinary vLLM capture server. Preserve shared termination semantics and remove the replaced legacy compaction session/model with its paired ASR configuration entry. Context management stays optional for external harnesses. The combined source tree exactly matches the qualified Gym PR head cf90856; no dependency or lockfile changes. Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
8eec6bf to
d5be5af
Compare
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
|
@yaoyu-33 could you review this PR? In particular, should the compaction logic stay in simple_agent_with_compaction, or would it make sense to extract it into a shared library that other agents can reuse? |
Publishing the final policy decision only after guard admission changes nothing observable today: a guard rejection raises before build_response, the only place the decision is published. NVIDIA-NeMo#3368 deletes this session, and its replacement client checks guards before generation and acknowledges history only after accepting a response, so the invariant belongs there. Restore session.py and its test to main's versions; this also removes the only conflict with NVIDIA-NeMo#3368. Signed-off-by: Jeff Peng <jepeng@nvidia.com>
|
@aroshanghias-nvd, following up on what I said in #3591: here are regression tests for the guard invariant on the new client. A view rejected by a context guard must never be sent to the model or become acknowledged history. #3591 no longer touches the legacy
|
Merge main while preserving rollout dispatch tracing. Validate Responses conversion before intent registration, shield cancellation failure writes, reuse connection-safe replay controls, and root ambiguous source candidates without selecting a parent. Validated with 2,279 Gym CPU cases, four paired Gym/RL selection and reconstruction cases, and pre-commit --all-files. Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
…VIDIA-NeMo#3591) * fix(core): isolate runtime, sandbox and model transport contracts Extract shared support from JeffPengCoder/Gym 360b0df. Include E2B endpoint/transport and vLLM model changes; retain upstream GymAiohttpTransport while preserving the no-config Ray worker fallback. Keep OSWorld tasks, agents and resources out of this PR. Signed-off-by: Jeff Peng <jepeng@nvidia.com> * fix(e2b): align SDK installation guidance with gateway requirements Signed-off-by: Jeff Peng <jepeng@nvidia.com> * fix(cli): keep site-packages off server import paths in wheel installs In a wheel install the built-in servers live in the parent interpreter's site-packages, so dir_path.parent.parent is that site-packages. Passing it as project_root put it first on each server's PYTHONPATH and NEMO_GYM_EXTRA_ROOTS, ahead of the server venv's own pinned dependencies. Apply the source-checkout guard the verifier runner already uses, and test both layouts; the wheel-install case fails without the guard. Signed-off-by: Jeff Peng <jepeng@nvidia.com> * fix(rollout): keep index-derived capture ids and gate dispatch logging Rows without a caller-supplied _ng_rollout_id no longer receive a random rollout-<uuid4>. The capture key stays main's {task}-{rollout}, so a resumed attempt decodes to the same rollout as attempt 0 and existing capture files keep their names. A caller-supplied id is still forwarded unchanged. Rows are no longer mutated, so the per-dispatch deep copy is removed as well. The per-dispatch summary is printed only when request debugging is enabled, like the reverification summary. The summary drops the NeMo-RL purpose and trajectory-identity fields and adds only the core _ng_rollout_id. Signed-off-by: Jeff Peng <jepeng@nvidia.com> * fix(vllm): drop the per-request purpose marker The marker printed on every chat-completion request and ran before sampling overrides and capture/prefix preparation, so it could report temperature and top_p values the engine never received. The opt-in transport log (NEMO_GYM_VLLM_TRANSPORT_LOG) already records the final request body together with the rollout context headers. A test now checks that the log holds the post-override values and that nothing is printed per request. Signed-off-by: Jeff Peng <jepeng@nvidia.com> * chore(agent): drop the legacy compaction session change Publishing the final policy decision only after guard admission changes nothing observable today: a guard rejection raises before build_response, the only place the decision is published. NVIDIA-NeMo#3368 deletes this session, and its replacement client checks guards before generation and acknowledges history only after accepting a response, so the invariant belongs there. Restore session.py and its test to main's versions; this also removes the only conflict with NVIDIA-NeMo#3368. Signed-off-by: Jeff Peng <jepeng@nvidia.com> * chore(core): leave provider and HTTP lifecycle changes to NVIDIA-NeMo#4822 and NVIDIA-NeMo#4823 The sandbox-provider changes (Docker create reconciliation, E2B service endpoints and transport fallback, OpenSandbox endpoint compatibility, the e2b>=2.46.0 range) now live in NVIDIA-NeMo#4822, and the owner-loop close of the shared aiohttp clients with wildcard-host handling lives in NVIDIA-NeMo#4823. Restore those 16 files to this branch's main base so each change is reviewed in exactly one PR. Nothing else in this PR uses them; it keeps the component runtime policy, rollout identity and the vLLM transport-log context. Signed-off-by: Jeff Peng <jepeng@nvidia.com> * fix(core): keep server venvs on the parent Python and fail loudly on pin conflicts - A server's .python-version now selects its interpreter only when it excludes the parent's Python. A request that admits it (such as >=3.13.14,<3.14, 3.13 or cpython@3.13) builds the venv with the parent's exact version, because Ray rejects processes on different patch releases. Variant and pre-release requests (3.13+freethreaded, 3.13.14+debug, 3.13.14rc1) and requests for other implementations are passed to uv unchanged. Like uv, the first non-comment line is the request. - Only the parent's constraints (the Ray pin) are passed as uv overrides, through process substitution like the existing -c flag. head_server_deps such as openai stay ordinary requirements, so a server pin that conflicts with them fails setup instead of being replaced silently. - Drop the environment-identity file: nothing read it, so it could not detect a stale venv, and its tests passed whatever it contained. - Replace the vacuous vllm_model marker-file test with one that checks the real policy, and document per-server .python-version/uv.toml and NEMO_GYM_ALLOWED_COMPONENT_ROOTS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com> --------- Signed-off-by: Jeff Peng <jepeng@nvidia.com> Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com> Co-authored-by: Onur Yilmaz <35306097+oyilmaz-nvidia@users.noreply.github.com> Co-authored-by: yaoyu-33 <yaoyu.094@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Replace removed _retry arguments in context measurement, generation, and resources calls. Exercise the real ServerClient retry stack against aiohttp's accepted arguments, preserving safe connection retries and refusing ambiguous resends. Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
…ements Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
|
/ok to test 4d72925 |
Merge Gym main at 4945282. Retain upstream output-budget classification in both backend routes and source-history worker-acknowledged refusal handling. Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
…20261026 Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
The native compaction agent returns ordinary accepted rollout history and uses shared capture, allowing NeMo-RL to determine training segments. Semantic history, recency policies, guards, and the context client move into the optional
nemo_gym.context_managementpackage, and the agent shares termination semantics withsimple_agent. The dedicated legacy compaction model/session are replaced by the ordinary vLLM model and context client, including removal of the associated ASR model entry.Depends on shared infrastructure #4128, which should merge first. External harnesses that own compaction and NeMo-RL #4124 need the infrastructure layer; they do not need this optional native-agent migration.
Review scope: GitHub requires a base branch in the upstream repository, where this fork cannot create branches. This PR therefore remains based on
mainand its Files changed tab still includes #4128 until that PR merges. Review the agent-only diff for this layer. Once #4128 merges, update/rebase this PR so only the native-agent changes remain againstmain.The original split preserved the entire source tree from head
cf908566. Both layers are now rebased onto Gym main366a9218; the agent commit remains patch-identical bygit range-diff. Fresh upper-layer tests passed 95 cases on Mac, andpre-commit run --all-filespassed on both layers. The rebased lower layer passed 1,761 Mac CPU cases. No dependency or lockfile changes are included. The lower-only infrastructure run independently passed two optimizer steps and exact capture/media audits with the compaction client package absent (W&B, maximum TMPE 1.000021). The GPU evidence predates this latest rebase and has not been rerun. Repository CI remains required before merge.Previously documented combined-stack validation
The evidence below predates this source-preserving split. The new lower-only check is a two-step integration check, not a repeat of these 20-optimizer-step runs.
pre-commit run --all-filespassed.Qualification used paired source in a private aligned runtime (Ray 2.58.0, vLLM 0.29.0), not final CI against a merged dependency. The custom fork used a disclosed temporary collector ordering correction and a bounded tool task; stock OpenCode and SWE-bench are not qualified.
The fork's overlapping title/agent calls encountered transient admission refusals and retried successfully. All 80 final ledgers had zero pending/failed calls. Two Mac CPU ASGI reproductions confirmed that the rejected overlap never starts generation or poisons the ledger. The sequential guard is retained; arbitrary concurrent/branching capture remains unsupported by this qualification. The generic HTTP 500 and ambiguous pending-capture error text remain a diagnostic limitation.
The paired training TMPE investigation remains unresolved and deferred, with maximum OpenCode identity/compaction values of 1.0015546 / 1.0094431. Exact reconstruction does not prove numerical equivalence between generation and learner forward passes; no experimental router-padding changes are included.