Repository navigation
chore: remove legacy dead code - #3769
Merged
Merged
Conversation
faresobeid
marked this pull request as ready for review
October 3, 2026 01:15
This was referenced Oct 3, 2026
mikasenghaas
approved these changes
Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 parseChatCompletionor message objects in-process. Rollouts run in separate env-server processes, which never applied the patch, andprefill_logprobsreads the rawhttpx.Response.FileSystemWeightUpdateWorker.init_broadcaster: deletes this no-op stub./init_broadcasteris 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.utilspathing re-export: deletes the shim (its TODO asked for this) and points the remaining imports atprime_rl.utils.pathing. The shim's file-widenoqa: F401was hiding three unused imports inutils.py; they are removed too.tests/unit/inference/test_serving_chat_with_tokens.py: deletes this empty file.ConcurrencyController.record_episode: now takes onlytokens.env_name,kindanddurationare left over from the removed per-env cost model and were ignored. The dispatcher'son_episode_completecallback type now matches, and theConcurrencyConfigdocstring 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 acceptedpast_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 fromprime_rl.utils.pathing.ConcurrencyController.record_episode(tokens)and theDispatcher(on_episode_complete=...)callback now take one argument.prime_rl.orchestrator.patchesno longer exists.Validation
ruff check .andruff 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 deselectedNote
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.pyand startup calls in the orchestrator and eval runner are gone. Rollouts no longer parseChatCompletionin those processes.Concurrency hooks —
ConcurrencyController.record_episodeand the dispatcheron_episode_completecallback now only receive token count; leftover per-env cost-model args were unused.ConcurrencyConfigdocs now describe KV-pressure sizing only.Misc cleanup — Drops
FileSystemWeightUpdateWorker.init_broadcaster, theprime_rl.utils.utilsre-export of pathing helpers (call sites importprime_rl.utils.pathingdirectly),@deprecate_kwargon custom decoder layers, and an empty inference unit test file.Breaking for downstream imports —
prime_rl.orchestrator.patchesis removed; pathing helpers must be imported fromprime_rl.utils.pathing;record_episode/on_episode_completetake a singleintargument.Reviewed by Cursor Bugbot for commit 079daae. Bugbot is set up for automated code reviews on this repo. Configure here.