Skip to content

chore: remove legacy dead code - #3769

Merged
faresobeid merged 1 commit into
mainfrom
chore/remove-dead-code
Oct 4, 2026
Merged

faresobeid merged 1 commit into
mainfrom
chore/remove-dead-code

Conversation

@faresobeid

@faresobeid faresobeid commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Removes legacy leftovers that were last touched 2025-11 to 2026-02 or were orphaned by features that are already gone. Behavior does not change.

  • orchestrator/patches.py: deletes the OpenAI chat-type monkeypatches, which were written for verifiers 0.1.8. The orchestrator and eval processes no longer parse ChatCompletion or message objects in-process. Rollouts run in separate env-server processes, which never applied the patch, and prefill_logprobs reads the raw httpx.Response.
  • FileSystemWeightUpdateWorker.init_broadcaster: deletes this no-op stub. /init_broadcaster is only called by the NCCL and NIXL transports, whose workers define their own method. The stub took no arguments, so the route could never have dispatched to it anyway.
  • prime_rl.utils.utils pathing re-export: deletes the shim (its TODO asked for this) and points the remaining imports at prime_rl.utils.pathing. The shim's file-wide noqa: F401 was hiding three unused imports in utils.py; they are removed too.
  • tests/unit/inference/test_serving_chat_with_tokens.py: deletes this empty file.
  • ConcurrencyController.record_episode: now takes only tokens. env_name, kind and duration are left over from the removed per-env cost model and were ignored. The dispatcher's on_episode_complete callback type now matches, and the ConcurrencyConfig docstring no longer mentions "learned per-env episode costs".
  • @deprecate_kwarg("past_key_value", ...): removed from the llama, glm4_moe and glm_moe_dsa decoder layers. These layers never accepted past_key_value(s), and transformers is pinned to 5.6.2. The signatures still accept everything their callers pass.

Breaking changes

  • from prime_rl.utils.utils import get_ckpt_dir (and the other pathing helpers) no longer works. Import them from prime_rl.utils.pathing.
  • ConcurrencyController.record_episode(tokens) and the Dispatcher(on_episode_complete=...) callback now take one argument.
  • prime_rl.orchestrator.patches no longer exists.

Validation

  • ruff check . and ruff format --check .
  • pytest tests/unit/orchestrator tests/unit/eval tests/unit/inference tests/unit/train/models tests/unit/utils tests/unit/test_configs.py -m "not gpu": 417 passed, 154 deselected
  • Import check of every modified module.
  • GPU and integration tests were not run: this machine has no GPU.

Note

Low Risk
Mostly deletions and import-path changes with documented API breaks; adaptive concurrency still uses token counts for growth gating.

Overview
This PR deletes unused orchestration and compatibility shims and tightens a few callback signatures. Runtime behavior for supported entrypoints is intended to stay the same.

Removed OpenAI monkey-patches — orchestrator/patches.py and startup calls in the orchestrator and eval runner are gone. Rollouts no longer parse ChatCompletion in those processes.

Concurrency hooks — ConcurrencyController.record_episode and the dispatcher on_episode_complete callback now only receive token count; leftover per-env cost-model args were unused. ConcurrencyConfig docs now describe KV-pressure sizing only.

Misc cleanup — Drops FileSystemWeightUpdateWorker.init_broadcaster, the prime_rl.utils.utils re-export of pathing helpers (call sites import prime_rl.utils.pathing directly), @deprecate_kwarg on custom decoder layers, and an empty inference unit test file.

Breaking for downstream imports — prime_rl.orchestrator.patches is removed; pathing helpers must be imported from prime_rl.utils.pathing; record_episode / on_episode_complete take a single int argument.

Reviewed by Cursor Bugbot for commit 079daae. Bugbot is set up for automated code reviews on this repo. Configure here.

@faresobeid
faresobeid merged commit 1eeea3a into main Oct 4, 2026
23 of 24 checks passed
@faresobeid
faresobeid deleted the chore/remove-dead-code branch October 4, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants