Skip to content

feat(eval): enable observability by default for submitted jobs - #3414

Merged
Glorf merged 6 commits into
mainfrom
mbien/observability-default-on
Sep 28, 2026
Merged

Glorf merged 6 commits into
mainfrom
mbien/observability-default-on

Conversation

@Glorf

@Glorf Glorf commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Enable model-call observability by default only for evaluations launched through gym eval submit or Gym's submission API. The existing Slurm helper supplies observability_enabled=true and a capture directory under each benchmark's job directory (model-calls/), while preserving explicit opt-out and custom paths.

The shared default stays false. Direct gym eval run, gym env start, library use, and training remain opt-in. The diff against main is limited to the submission helper, focused updates to its existing tests, and a short documentation update. No separate issue is needed for this scoped configuration-default change.

Validation

  • 603 tests passed:

    python -m pytest \
      tests/unit_tests/test_slurm_script.py \
      tests/unit_tests/test_cli_eval_submit.py \
      tests/unit_tests/test_slurm_executor.py \
      tests/unit_tests/test_base_responses_api_model.py \
      tests/unit_tests/test_base_responses_api_agent.py \
      tests/unit_tests/test_rollout_collection.py \
      tests/unit_tests/test_rollout_correlation.py \
      tests/unit_tests/test_server_utils.py \
      -q --tb=short --durations=5
  • Real CLI subprocess smoke: gym eval submit --dry-run rendered four benchmark commands covering defaults, separate capture directories, a custom path containing spaces, and explicit opt-out. Repeated with ++driver.benchmarks.default_a.run.observability_enabled=false; all assertions passed.

  • python -m pre_commit run --all-files passed.

  • npm run check -- --warnings in fern/ passed with zero errors; the authenticated redirect check was skipped because Fern was not logged in.

  • git diff --check passed.

Rollouts

N/A: this changes submission configuration defaults, with no changes to agent, model-response, or verifier behavior. Validation used local tests and submission dry-runs; no model rollout or cluster job was launched.

Compatibility and benchmark impact

Submitted evaluations now write model-call capture artifacts by default. Set driver.benchmarks.<name>.run.observability_enabled: false to disable capture, or set model_call_capture_dir in the same run block to use a custom absolute path. Existing standalone and training defaults are preserved. Capture does not change model responses or rollout rewards.

Checklist

  • The change is focused, with no unrelated cleanup.
  • Relevant tests pass locally.
  • Documentation is updated.
  • Pre-commit checks pass locally.
  • No new source files were added.
  • Authored changes have DCO sign-off (git commit -s).

@copy-pr-bot

copy-pr-bot Bot commented Sep 15, 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.

@Glorf
Glorf force-pushed the mbien/observability-default-on branch from d2e1aca to 69ed0b0 Compare September 15, 2026 20:52
@Glorf
Glorf marked this pull request as ready for review September 15, 2026 20:53
@Glorf

Glorf commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 004cac8

@Glorf

Glorf commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

@claude

claude Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

SHIP WITH CARE — the change is internally consistent and correctly threaded; the concern is the behavioral/operability shift, not a code defect.

What this does: flips ModelCallCaptureConfig.observability_enabled from False → True and gives model_call_capture_dir a concrete default (RESULTS_DIR / "model_calls"). Every downstream reader of the flag now resolves its default from ModelCallCaptureConfig.model_fields[...] rather than a hardcoded False, so SimpleResponsesAPIAgent._observability_enabled, ServerClient.request, _with_default_capture_dir, and cli/env.py all agree. I verified all four call sites and the key-name constants (observability_enabled, model_call_capture_dir) match the Pydantic field names the code indexes. No circular-import trap: server_utils keeps its lazy in-function import (correct — it is imported by base_responses_api_model), while base_responses_api_agent/cli/env/slurm_script import ModelCallCaptureConfig at top level, and base_responses_api_model does not import back into the agent module. Tests were updated coherently (opt-out via explicit observability_enabled: False).

RISK — operability: capture is now on for every default run. CaptureStore.record does a blocking write + flush + os.fsync under flock per model exchange (off-loop via asyncio.to_thread, so the event loop is safe, and locking is per-rollout so independent rollouts still write concurrently). But this adds per-call disk I/O and unbounded disk growth (captures include token-ids/logprobs — "can be large") to runs that previously wrote nothing. BLAST RADIUS: every gym eval/training run that does not explicitly set observability_enabled: False, including large high-concurrency sweeps, now pays this cost by default. If that is the intended default-on product decision, fine — merge as a deliberate choice; users disable with observability_enabled: False. Just confirm the disk-footprint tradeoff at scale was intended.

NOTE — docs are now stale. The module docstring in base_responses_api_model.py was updated to "enabled by default", but fern/versions/latest/pages/model-server/model-call-capture.mdx still documents observability_enabled | bool | false and calls capture "opt-in" (lines ~8, 191). Not in this diff, so no inline comment, but it should be reconciled so config docs do not diverge from the new default (per the YAML-is-source-of-truth convention).

No BLOCKERs; no async-correctness or public-API breakage found.

gchlebus
gchlebus previously approved these changes Sep 15, 2026
@yaoyu-33 yaoyu-33 added area:core Shared APIs, servers, telemetry, health, and registries complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work ready-to-merge PR is approved, current, and waiting for final CI or merge labels Sep 15, 2026
@Glorf
Glorf requested a review from gchlebus September 16, 2026 07:37
@Glorf
Glorf marked this pull request as draft September 16, 2026 07:39
@Glorf Glorf changed the title Enable observability by default feat(eval): enable observability by default for submitted jobs Sep 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@Glorf
Glorf marked this pull request as ready for review September 28, 2026 12:09
@Glorf

Glorf commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 224bce8

@Glorf

Glorf commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test fcba3a8

@Glorf

Glorf commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

@claude

claude Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

SHIP — LGTM, no reliability concerns.

Reviewed the full diff against CLAUDE.md conventions. This flips model-call capture to default-on for gym eval submit while keeping other entry points opt-in.

Correctness of _with_default_capture_dir holds across all paths:

  • run = {OBSERVABILITY_ENABLED_KEY_NAME: True, **run} sets the default but lets an explicit user value (True or False) win via dict-merge order — verified by the parametrized test_with_default_capture_dir_explicit_value_wins.
  • Capture-on always pairs with an injected model_call_capture_dir, satisfying ModelCallCaptureConfig's invariant that the dir is required when enabled; an explicit dir still wins.
  • Input dict is not mutated (new dicts constructed); test_with_default_capture_dir_does_not_mutate_input confirms.
  • The emitted +observability_enabled=<bool> Hydra token uses the same flatten_run_args +key=value semantics already in use; opt-out (observability_enabled: false) suppresses the dir and emits +observability_enabled=False, matching the docs.

Docs (model-call-capture.mdx) accurately describe the new default and the two opt-out/override knobs. Tests were updated to cover the enabled/disabled matrix.

Note: this is a behavior change (capture now writes model-calls/ under every submitted benchmark's job dir by default) — extra disk usage per submitted eval, but no correctness/scoring impact since capture does not modify responses or rewards.

@Glorf
Glorf requested review from prokotg and wprazuch and removed request for gchlebus September 28, 2026 13:17
@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Sep 28, 2026
@Glorf
Glorf added this pull request to the merge queue Sep 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/36430005918

Merged via the queue into main with commit c0fcf47 Sep 28, 2026
42 checks passed
@Glorf
Glorf deleted the mbien/observability-default-on branch September 28, 2026 13:50

This branch was previously deployed

1 inactive deployment
public — fcba3a84 Deployed Sep 28, 2026 by copy-pr-bot[bot] via release / finalize / notify #3682
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 complexity:medium Single-domain change with interacting parts or a moderate review surface 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.

4 participants