Skip to content

refactor(artifacts): move run artifacts and exporters into nemo_gym/artifacts - #5212

Merged
ananthsub merged 1 commit into
mainfrom
ananthsub/layout-artifacts
Oct 30, 2026
Merged

ananthsub merged 1 commit into
mainfrom
ananthsub/layout-artifacts

Conversation

@ananthsub

@ananthsub ananthsub commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Moves what a run writes and exports into a new nemo_gym/artifacts/ package: run artifacts, the resolved config, the exporter registry, and the exporters. Two small splits go with it, so the exporters stop importing the rollout collector they sit below.

Where this PR sits

The stack lands bottom-up; each PR's base is the branch of the PR before it, so each diff shows only that PR's change.

flowchart LR
  compat["#5167<br/>Old import paths<br/>keep working"]
  linter["#5168<br/>import-linter<br/>layer contract"]
  prep["#5169<br/>Remove path and<br/>name couplings"]
  config["#5189<br/>Move config/"]
  utils["#5195<br/>Move utils/"]
  core["#5203<br/>Move core/"]
  client["#5206<br/>Move client/,<br/>start telemetry/"]
  trajectory["#5209<br/>Move trajectory/"]
  verification["#5210<br/>Move verification/"]
  metrics["#5211<br/>Move metrics/"]
  artifacts["#5212<br/>Move artifacts/"]
  srmods["#5214<br/>Move server_runtime/<br/>modules"]
  su["#5215<br/>Split server_utils"]
  model["#5224<br/>Move models/<br/>modules"]
  modelbase["#5225<br/>Split model<br/>call capture"]
  agents["#5228<br/>Move agents/"]
  data["#5229<br/>Move data/"]
  harbor["#5230<br/>Split the<br/>Harbor task CLI"]
  rollouts["#5231<br/>Move rollouts/"]
  rsplit["#5232<br/>Split the<br/>rollout collector"]
  testing["#5233<br/>Dissolve testing/"]
  orch["#5234<br/>Move orchestration/<br/>modules"]
  sup["#5235<br/>Split the<br/>server supervisor"]
  eval["#5244<br/>Move eval/"]
  env["#5298<br/>Move environment/<br/>registries"]
  cli["#5300<br/>Retire the<br/>cli_setup_command shim"]
  docs["#5385<br/>Describe the<br/>package layout"]
  owners["next<br/>CODEOWNERS:<br/>per-package groups"]
  remove["0.10.0<br/>Remove the<br/>old paths"]
  compat --> linter
  linter --> prep
  prep --> config
  config --> utils
  utils --> core
  core --> client
  client --> trajectory
  trajectory --> verification
  verification --> metrics
  metrics --> artifacts
  artifacts --> srmods
  srmods --> su
  su --> model
  model --> modelbase
  modelbase --> agents
  agents --> data
  data --> harbor
  harbor --> rollouts
  rollouts --> rsplit
  rsplit --> testing
  testing --> orch
  orch --> sup
  sup --> eval
  eval --> env
  env --> cli
  cli --> docs
  docs --> owners
  owners --> remove
  classDef this fill:#fde68a,stroke:#b45309,stroke-width:2px,color:#1f2937
  classDef later fill:#f3f4f6,stroke:#9ca3af,color:#4b5563,stroke-dasharray: 4 3
  class artifacts this
  class owners,remove later
Loading

Where the package sits

flowchart TD
  cli["cli/"]
  eval["eval/"]
  environment["environment/"]
  testing["testing/"]
  orchestration["orchestration/"]
  rollouts["rollouts/"]
  data["data/"]
  agents["agents/"]
  model["models/"]
  server_runtime["server_runtime/"]
  artifacts["artifacts/"]
  metrics["metrics/"]
  verification["verification/"]
  trajectory["trajectory/"]
  sandbox["sandbox/"]
  client["client/"]
  telemetry["telemetry/"]
  core["core/"]
  utils["utils/"]
  config["config/"]
  cli --> eval
  cli --> environment
  cli --> orchestration
  eval --> rollouts
  environment --> data
  testing --> rollouts
  orchestration --> data
  rollouts --> data
  rollouts --> agents
  rollouts --> model
  data --> server_runtime
  data --> artifacts
  agents --> server_runtime
  model --> server_runtime
  server_runtime --> metrics
  server_runtime --> verification
  server_runtime --> trajectory
  artifacts --> trajectory
  artifacts --> utils
  metrics --> utils
  verification --> sandbox
  trajectory --> core
  sandbox --> client
  client --> telemetry
  client --> utils
  telemetry --> core
  core --> config
  utils --> config
  classDef this fill:#fde68a,stroke:#b45309,stroke-width:2px,color:#1f2937
  classDef done fill:#d1fae5,stroke:#047857,color:#1f2937
  classDef todo fill:#f3f4f6,stroke:#9ca3af,color:#4b5563
  class artifacts this
  class config,utils,core,telemetry,client,trajectory,verification,metrics done
  class cli,eval,environment,testing,orchestration,rollouts,data,agents,model,server_runtime,sandbox todo
Loading

An arrow means "imports"; each package imports only packages below it. Yellow: created by this PR. Green: created by an earlier PR in the stack. Grey: still to come.

What moves

flowchart LR
  RC["rollout_collection.py:<br/>row keys and the export view of a row"] --> RR["artifacts/rollout_rows.py"]
  HT["health/types.py:<br/>quality summary and verdict file names"] --> RF["artifacts/run_files.py"]
  BS["batch_status.py:<br/>AGGREGATION_ERROR_KEY"] --> RF
  EX["exporters/"] --> EX2["artifacts/exporters/"]
  RA["run_artifacts.py, resolved_config.py"] --> RA2["artifacts/"]
  RE["run_exporter_registry.py"] --> RE2["artifacts/exporter_registry.py"]
  EX2 -.->|"read"| RR
  EX2 -.->|"read"| RF
  classDef this fill:#fde68a,stroke:#b45309,stroke-width:2px,color:#1f2937
  class RR,RF,EX2,RA2,RE2 this
Loading
Old path New path
nemo_gym/exporters/ nemo_gym/artifacts/exporters/
nemo_gym/run_artifacts.py nemo_gym/artifacts/run_artifacts.py
nemo_gym/resolved_config.py nemo_gym/artifacts/resolved_config.py
nemo_gym/run_exporter_registry.py nemo_gym/artifacts/exporter_registry.py
rollout_collection: NG_FAILURE_CLASS_KEY, NG_NO_PERSIST_KEY, NG_DISPATCH_DRAINED_KEY, _MODEL_CALL_PAYLOAD_KEYS, _strip_capture_payloads, _rollout_for_export nemo_gym/artifacts/rollout_rows.py
health.types: QUALITY_SUMMARY_FILENAME, ROLLOUT_VERDICTS_FILENAME, QUALITY_SUMMARY_SOURCES_KEY nemo_gym/artifacts/run_files.py
batch_status: AGGREGATION_ERROR_KEY nemo_gym/artifacts/run_files.py

How to review

One commit. Its changes:

  1. Renames, with no content changes.
  2. Everything else:
    • The split names are cut out unchanged. rollout_collection.py and batch_status.py import back the ones they use.
    • The moves are recorded in nemo_gym/_moved_paths.py: the four modules (exporters as a package, so nemo_gym.exporters.wandb and the others resolve too) and the split names.
    • rollout_collection.py already had a module __getattr__ for its deprecated CLI entry points. It now also serves the moved row names. health/types.py gains the same __getattr__ as the other split modules.
    • In-repo references are rewritten by scripts/migrate_imports.py.
    • The contract's artifacts layer becomes the nemo_gym.artifacts package, and four exceptions go away: the exporters no longer import rollout_collection or batch_status, and the Harbor run summary no longer imports health.types. 13 remain.
    • fern/docs.yml redirects the old library reference pages, including each exporter module.
  3. Tests: the exporter, run artifact, and resolved config tests move into tests/unit_tests/artifacts/. Tests that drive the rollout collector stay and move with rollouts/.

History of split files

The repository squash-merges, so this PR lands as one commit. Whole-module moves still show as renames. A split file does not: its old path stays with less in it, so the new file starts its own history. git blame -C -C <new file> follows the moved lines back to the old file, and git log --follow does not.

Validation

  • pytest -n 16 tests/unit_tests, also with -W error for every moved path and name in this PR. The only failures are environment-specific and unrelated to the move: this machine's hostname resolves to 127.0.1.1, which the sandbox host check refuses (the Harbor run summary tests and the benchmark listing test), and two Docker PTY tests.
  • lint-imports.
  • pre-commit run on the changed files.
  • Server and agent tests run in CI.

Rollout evidence: N/A. The code moves unchanged; the rollout and export file formats do not change.

Compatibility

  • Old paths work until 0.10.0, with one warning each, and give the same objects. Exporter class paths in configs, such as nemo_gym.exporters.wandb, keep resolving.
  • The deprecated collect_rollouts and aggregate_rollouts names on nemo_gym.rollout_collection keep their existing warning.
  • Patches of these names on nemo_gym.rollout_collection no longer reach the exporters, omitted_rollouts, or rollout_health: _rollout_for_export, _strip_capture_payloads, _MODEL_CALL_PAYLOAD_KEYS, NG_FAILURE_CLASS_KEY, NG_NO_PERSIST_KEY, and NG_DISPATCH_DRAINED_KEY; nor does a patch of AGGREGATION_ERROR_KEY on nemo_gym.batch_status. Patch nemo_gym.artifacts.rollout_rows or nemo_gym.artifacts.run_files instead.
  • Logger names follow the module path: the exporters now log under nemo_gym.artifacts.exporters.*. A logging config set on nemo_gym still covers them.
  • Open branches: run python scripts/migrate_imports.py <paths>.

Issue

Part of #5166.

@ananthsub
ananthsub added this pull request to stack #5170 October 28, 2026 18:57
@copy-pr-bot

copy-pr-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ananthsub ananthsub changed the title ananthsub/layout artifacts refactor(artifacts): move run artifacts and exporters into nemo_gym/artifacts Oct 28, 2026
@ananthsub ananthsub added the feature New capabilities, enhancements, or enablement work label Oct 28, 2026
@ananthsub
ananthsub requested a review from yaoyu-33 October 28, 2026 18:58
@ananthsub ananthsub added area:core Shared APIs, servers, telemetry, health, and registries needs-review PR is ready for code review and waiting on a reviewer labels Oct 28, 2026
@ananthsub
ananthsub marked this pull request as ready for review October 28, 2026 18:58
@ananthsub
ananthsub requested a review from a team as a code owner October 28, 2026 18:58
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 28, 2026 18:59
@ananthsub
ananthsub force-pushed the ananthsub/layout-artifacts branch from 37a0195 to c932a07 Compare October 28, 2026 19:01
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

@ananthsub
ananthsub force-pushed the ananthsub/layout-artifacts branch from 72e8f91 to 297cc6e Compare October 28, 2026 21:56
@ananthsub
ananthsub force-pushed the ananthsub/layout-artifacts branch from 297cc6e to 18cd273 Compare October 28, 2026 22:26
@ananthsub
ananthsub force-pushed the ananthsub/layout-artifacts branch from 18cd273 to 2676245 Compare October 28, 2026 23:10
@ananthsub
ananthsub force-pushed the ananthsub/layout-artifacts branch from 2676245 to 2017460 Compare October 29, 2026 00:55

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP. Nothing blocking. There are two small inline notes and two items below.

This PR moves the exporters, run artifacts, resolved config and exporter registry into nemo_gym/artifacts/. It also cuts the row keys and run-file names that the exporters read out of rollout_collection, health.types and batch_status, into artifacts/rollout_rows.py and artifacts/run_files.py. That removes four import-linter exceptions; lint-imports is KEPT with 13 ignored imports.

What we checked:

  • Renames and splits. Every renamed file and every split definition matches the base apart from import paths (AST comparison). The row keys, quality_summary.json, rollout_verdicts.jsonl and aggregation_error are unchanged.
  • Old paths. Each old module path, nemo_gym.exporters.<backend> included, and each moved name gives the same object as its new path, and import_surface.json lists all of them.
  • Exporter loading. The registry's module:class strings resolve. Importing nemo_gym, nemo_gym.artifacts or rollout_collection still loads neither wandb nor mlflow.
  • Exporter workers. They are found with Path(__file__).with_name(...) and launched by file path. No Slurm script or run file records a module path.
  • Redirects. The fern/docs.yml redirects cover all 11 rendered pages in both forms. The PR preview builds navigation from main, so they can only be exercised after publish.
  • Servers and agents. They import from the nemo_gym.artifacts public API and install nemo-gym editable. Nothing they ship into a sandbox uses a moved path.
  • CI. No failure comes from this PR.
    • The Harbor failures are Docker Hub HTTP 429s.
    • telemetry/test_propagation.py and openai_model TestRefusedProviderConnection already fail from #5206 up.
    • kilocode is the non-blocking conformance job.

Two small items without an inline thread:

  • [PROCESS] #5166 asks each split PR to list the names whose patches stop taking effect. Could the Compatibility section add one line for this split?
    • Patches of these names on nemo_gym.rollout_collection no longer reach the exporters (BaseExporter._read_rollouts, _aggregation_failure, MLflow _landed), omitted_rollouts or rollout_health: _rollout_for_export, _strip_capture_payloads, _MODEL_CALL_PAYLOAD_KEYS, NG_FAILURE_CLASS_KEY, NG_NO_PERSIST_KEY and NG_DISPATCH_DRAINED_KEY. The same holds for AGGREGATION_ERROR_KEY on nemo_gym.batch_status.
    • The line could tell readers to patch nemo_gym.artifacts.rollout_rows or nemo_gym.artifacts.run_files instead. No in-repo test patches them.
  • scripts/ci/core_unit_tests.sh:24 still cites tests/unit_tests/test_exporters.py, which now lives at tests/unit_tests/artifacts/test_exporters.py.
Notes for other PRs in the stack (not for this PR)
  • #5167: nemo_gym/__init__.py:247 routes nemo_gym.<moved module> attribute access through _moved_names.
    • So import nemo_gym; nemo_gym.run_artifacts warns from __init__.py rather than from the caller.
    • This PR adds four more modules that reach that path; the inline fix here does not cover it.
  • #5206: two tests patch a name on a module that no longer looks it up, which is why those tests fail from #5206 up.
    • tests/unit_tests/telemetry/test_propagation.py:280 patches nemo_gym.utils.server_process.get_nemo_gym_fastapi_num_workers.
    • responses_api_models/openai_model/tests/test_app.py:1253 patches server_utils.get_global_aiohttp_client.
    • The client now binds both names in nemo_gym/client/http_client.py.

Not verified locally: the MLflow and W&B exporters against their real SDKs (CI installs both extras), GPU paths, or real sandboxes.

Comment thread nemo_gym/rollout_collection.py Resolved
Comment thread nemo_gym/artifacts/exporters/mlflow.py Resolved
yaoyu-33
yaoyu-33 previously approved these changes Oct 30, 2026
…rtifacts

resolved_config.py, run_artifacts.py and the exporters package move as
they are, and run_exporter_registry.py becomes
artifacts/exporter_registry.py.

Move the private rollout row keys and the export view of a row out of
rollout_collection.py into artifacts/rollout_rows.py, and the quality
summary, rollout verdict and aggregation error names out of
health/types.py and batch_status.py into artifacts/run_files.py. The
exporters read these, so they no longer import the rollout collector.

Record the four module moves in MOVED_MODULES (exporters as a package)
and the split names in MOVED_NAMES. rollout_collection keeps its
deprecated CLI entry points and now also serves the moved row names.
Rewrite in-repo references with scripts/migrate_imports.py, make the
contract's artifacts layer the nemo_gym.artifacts package, drop the four
exceptions the split resolves, and redirect the old library reference
pages in fern/docs.yml.

Regenerate the public API of each layout package that exists here from
what non-test code outside nemo_gym imports, and point code outside
nemo_gym, tests included, at nemo_gym.<package>.

Signed-off-by: Ananth Subramaniam <[email protected]>

This branch was previously deployed

1 inactive deployment
public — 3dcf2fa6 Deployed Oct 30, 2026 by copy-pr-bot[bot] via release / finalize / notify #8787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Shared APIs, servers, telemetry, health, and registries feature New capabilities, enhancements, or enablement work ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants