Skip to content

refactor: move nemo_gym imports to Gym 0.8 module paths - #5382

Open
four1er wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
four1er:fix/nemo-gym-import-paths-5254
Open

four1er wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
four1er:fix/nemo-gym-import-paths-5254

Conversation

@four1er

@four1er four1er commented Nov 23, 2026

Copy link
Copy Markdown
  • I, the PR author, have personally reviewed every line of this PR.

What and why

Gym 0.8 reorganized the nemo_gym package. The old import paths still work through deprecation aliases in nemo_gym/_moved_paths.py, but they are removed in Gym 0.10. This PR moves every use of the 11 moved modules to the new paths (245 occurrences in 64 files under nemo_rl/ and tests/), so RL is ready before the Gym 0.10 bump.

Beyond plain imports, it also moves the dynamic references that would break the same way: pytest.importorskip("nemo_gym.…") strings, importlib.import_module("nemo_gym.…"), sys.modules fakes in tests, the "nemo_gym.token_id_capture.lineage:FileLineageStore" entry-point string, and three from nemo_gym import <moved module> sites. Every new path was checked against the pinned Gym rev's _moved_paths.py and its file tree. Names split out of modules that stay (MOVED_NAMES) are a separate pass, as the issue says.

Issues

Fixes #5254

Convergence / perf / functionality proof

N/A: mechanical import rename, no behaviour change. Verified: no old paths remain in nemo_rl/ or tests/; all 64 changed files compile; all 11 new modules exist at the pinned Gym rev. No GPU end-to-end validation (no GPU here); the affected tests need the Gym extra and will run in CI.

Needs upstream changes

None — Gym 0.8 already ships the new paths.

PR commands and CI
  • CI label, exactly one:
    • CI:Lfast: the default for most PRs. Runs a fast test subset.
    • CI:L1: dependency or container changes (pyproject.toml, uv.lock, Dockerfile) or broad core changes. Builds a new image and runs unit and functional tests.
    • CI:docs: docs-only changes. Runs doc tests only.
  • /ok to test <full-commit-sha>: start CI for that commit. Post again after each push.
  • /review: automated review comments. Add mode=strict for a stricter review, reset=true for a fresh full review.
  • /resolve-conflict: Autobot merges main into this PR and resolves the conflicts. PRs from forks must allow edits by maintainers.
  • Locally: /review-pr-team <pr-number> for a team review before you ask for human review.
  • Contributor guidelines

@copy-pr-bot

copy-pr-bot Bot commented Nov 23, 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.

@four1er

four1er commented Nov 23, 2026

Copy link
Copy Markdown
Author

/ok to test 2380e5c

@github-actions github-actions Bot added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 23, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move NeMo RL's nemo_gym imports to Gym's new module paths before Gym 0.10

2 participants