Skip to content

[DYNAMO] chore: remove dead unload_lora_adapter#2396

Draft
AmeenP wants to merge 1 commit intomainfrom
chore/remove-dead-unload-lora-adapter
Draft

[DYNAMO] chore: remove dead unload_lora_adapter#2396
AmeenP wants to merge 1 commit intomainfrom
chore/remove-dead-unload-lora-adapter

Conversation

@AmeenP
Copy link
Copy Markdown
Contributor

@AmeenP AmeenP commented May 2, 2026

Summary

unload_lora_adapter in src/prime_rl/utils/client.py has been dead code since November 2025. Removing it.

History

  • Support broadcasting just lora weights and drop support for merged weights #1320 (2aa47ae6b, 2025-11-21) introduced unload_lora_adapter along with a call to it at the end of orchestrate() in orchestrator.py. The PR also shipped with a # TODO: first one can fail, subsequent ones should succeed comment and a commented-out raise_for_status() — i.e. the author already knew the call was unreliable.
  • 220b50a38 ("dont unload for now"), same day, same author, removed the call site and the import. The function has had zero callers ever since.
$ git log --all --oneline -S'unload_lora_adapter(' -- src/
2aa47ae6b Support broadcasting just lora weights ...   # adds function + caller
220b50a38 dont unload for now                          # removes caller, leaves function
$ rg 'unload_lora' src/ tests/ examples/
src/prime_rl/utils/client.py:412 ...   # only the function itself

Why delete, not fix

The function has two issues that surface only when reactivated:

  1. Silent-failure pattern. The raise_for_status() is commented out. Per AGENTS.md: "Minimal try/except: let errors propagate — silent failures hide bugs."
  2. Path bug against Dynamo. Line 418 is /v1/unload_lora_adapter (with /v1/ prefix). Line 403 — its sibling load_lora_adapter — is bare /load_lora_adapter. Against vLLM, both paths work because vLLM aliases them. Against a Dynamo frontend with admin_base_url = http://.../v1/rl, httpx joins the path onto the base, producing http://.../v1/rl/v1/unload_lora_adapter, which doesn't exist. The 404 is invisible because raise_for_status() is commented out.

Fixing in place would mean making dead code "correct" without any way to validate the fix end-to-end. When end-of-training adapter unload is actually needed, the right move is to re-add it with a real call site and a real integration check, not to maintain a half-working stub in the meantime.

Scope

13 lines removed in one file. No callers, no imports, no tests reference it. Verified.

`unload_lora_adapter` has had no callers since 220b50a ("dont unload
for now"), which removed the only call site (in orchestrator.py) the
same day the function was introduced in #1320. The author intentionally
deferred end-of-training adapter unload because the call was unreliable
-- the dangling function carried a `# TODO: first one can fail,
subsequent ones should succeed` and a commented-out `raise_for_status`
that papered over the symptom.

Two issues with carrying it as dead code:

  1. Silent-failure pattern is exactly what AGENTS.md says not to do.
  2. The path string `/v1/unload_lora_adapter` is asymmetric with the
     bare `/load_lora_adapter` 14 lines above. Against vLLM both work
     (alias routing); against a Dynamo `/v1/rl/*` admin frontend, the
     `/v1/` prefix produces `/v1/rl/v1/unload_lora_adapter` which 404s.

Deleting rather than fixing -- when end-of-training unload is needed,
re-add it correctly with a working integration and a real verification.
@AmeenP AmeenP changed the title chore: remove dead unload_lora_adapter [DYNAMO] chore: remove dead unload_lora_adapter May 2, 2026
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.

1 participant