Skip to content

[bug] Fix lora reloading from disk every step when using AsyncLLM - #41482

Merged
aoshen02 merged 4 commits into
vllm-project:mainfrom
hao-aaron:lora-disk-bug
Oct 22, 2026
Merged

aoshen02 merged 4 commits into
vllm-project:mainfrom
hao-aaron:lora-disk-bug

Conversation

@hao-aaron

@hao-aaron hao-aaron commented May 1, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

When calling load_lora_adapter endpoint with load_inplace:true, lora reloads from disk every generation, leading to massive slowdowns. we set lora_request.load_inplace = False after first load to so we only load it once.

Reproduction:

VLLM_ALLOW_RUNTIME_LORA_UPDATING=1 vllm serve meta-llama/Llama-3.2-3B-Instruct --enable-lora --max-loras 1 --max-lora-rank 64 --gpu-memory-utilization 0.5 --port 8765

# wait for vllm server startup, then in separate terminal
curl -s localhost:8765/v1/load_lora_adapter -H 'Content-Type: application/json' -d '{"lora_name":"l","lora_path":"jeeejeee/llama32-3b-text2sql-spider","load_inplace":true}'
curl -s localhost:8765/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"l","messages":[{"role":"user","content":"hi"}],"max_tokens":256}' 

We observe that without the fix, lora reloads from disk on every request.

(APIServer pid=4022344) INFO:     127.0.0.1:38100 - "POST /v1/chat/completions HTTP/1.1" 200 OK
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 73584.28it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
(APIServer pid=4022344) INFO 05-01 21:07:36 [loggers.py:271] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.5 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 59.3%
Fetching 3 files: 100%|██████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 8612.53it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 20593.96it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 85598.04it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 10941.66it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 17403.75it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 26051.58it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 15887.52it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
Fetching 3 files: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 11661.64it/s]
Download complete: : 0.00B [00:00, ?B/s]                                                   | 0/3 [00:00<?, ?it/s]
(APIServer pid=4022344) INFO:     127.0.0.1:44558 - "POST /v1/chat/completions HTTP/1.1" 200 OK

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

x
Signed-off-by: hao-aaron <ahao@anyscale.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added frontend bug Something isn't working labels May 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the load_lora_adapter method in vllm/entrypoints/openai/models/serving.py to reset the load_inplace attribute of the lora_request object to False before caching it. This change prevents the flag from leaking into subsequent generation requests. I have no feedback to provide as there were no review comments to evaluate.

@sfeng33

sfeng33 commented May 5, 2026

Copy link
Copy Markdown
Member

PTAL @jeejeelee

SumanthRH pushed a commit to NovaSky-AI/SkyRL that referenced this pull request May 6, 2026
Bug fixes found in #1616

While testing out the tinker CI, found a port collision bug.

async def _run_server(self) -> None:
    """Internal method to run the HTTP server."""
    # Release the port reservation right before vLLM rebinds.
    if self._port_reservation is not None:
self._port_reservation.close() # ← step A
        self._port_reservation = None
    ...
    sock_addr = (self._cli_args.host, self._cli_args.port)
    sock = create_server_socket(sock_addr)
There exists a window of time where we free port so vllm can take it,
but other actors can also. Fixed this by allocating a specific,
non-overlapping port range for each actor.

Additionally, changed the disk reloading workaround
#1606 created here to more
closely mirror the upstream change
vllm-project/vllm#41482, adding a new custom
endpoint with the load_inplace override.

---------

Signed-off-by: hao-aaron <ahao@anyscale.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
SumanthRH pushed a commit to NovaSky-AI/SkyRL that referenced this pull request May 13, 2026
This PR introduces a tinker ci, closing
#1553. It uses
tinker_cookbook.recipes.math_rl.train. Currently the `REWARD_MIN_VALUE`
is set to 0, but will be tightened once we have a couple of runs. Added
both colocated and fully async tests.


https://wandb.ai/sky-posttraining-uc-berkeley/gsm8k_tinker_ci?nw=nwuserahao

https://wandb.ai/sky-posttraining-uc-berkeley/gsm8k_tinker_fully_async_ci?nw=nwuserahao


While testing out the tinker CI, found a port collision bug.
```
async def _run_server(self) -> None:
    """Internal method to run the HTTP server."""
    # Release the port reservation right before vLLM rebinds.
    if self._port_reservation is not None:
        self._port_reservation.close()                          # ← step A
        self._port_reservation = None
    ...
    sock_addr = (self._cli_args.host, self._cli_args.port)
    sock = create_server_socket(sock_addr)
```
There exists a window of time where we free port so vllm can take it,
but other actors can also. Fixed this by allocating a specific,
non-overlapping port range for each actor.

Additionally, changed the disk reloading workaround
#1606 created here to more
closely mirror the upstream change
vllm-project/vllm#41482, adding a new custom
endpoint with the load_inplace override.

---------

Signed-off-by: hao-aaron <ahao@anyscale.com>
Signed-off-by: ahao-anyscale <ahao@anyscale.com>
@sladyn98 sladyn98 mentioned this pull request May 13, 2026
5 tasks done
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you!

@github-actions github-actions Bot added the stale Over 90 days of inactivity label Aug 10, 2026
@FurtherAI

Copy link
Copy Markdown
Contributor

I believe this is still an issue.
5.6 sol suggests

self.lora_requests[lora_name] = msgspec.structs.replace(
    lora_request,
    load_inplace=False,
)

as a fix for the openai path, but e.g.

llm.chat(..., lora_request=LoRARequest(..., load_inplace=True))

is not covered by that.
So maybe functionality like this:

await engine_client.add_lora(
    lora_request,
    load_inplace=True,
)

Otherwise maybe cover all the paths that use lora requests and make sure they don't persist load_inplace.

Why was it attached to load_inplace in the first place?

Didn't fact check everything.

@mergify

mergify Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hao-aaron.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 22, 2026
Signed-off-by: aoshen02 <aoshen@inferact.ai>
@mergify mergify Bot removed the needs-rebase label Oct 22, 2026
@aoshen02

Copy link
Copy Markdown
Contributor

/ci run

@aoshen02
aoshen02 enabled auto-merge (squash) October 22, 2026 08:33
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #96607 for commit 5f61df3377e0.

@aoshen02
aoshen02 merged commit ef5bcaa into vllm-project:main Oct 22, 2026
68 checks passed
bantianyue pushed a commit to bantianyue/vllm that referenced this pull request Oct 28, 2026
…lm-project#41482)

Signed-off-by: hao-aaron <ahao@anyscale.com>
Signed-off-by: aoshen02 <aoshen@inferact.ai>
Co-authored-by: aoshen02 <aoshen@inferact.ai>
faresobeid added a commit to PrimeIntellect-ai/prime-rl that referenced this pull request Nov 2, 2026
…itself

vllm-project/vllm#41482 resets load_inplace before caching the adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend ready ONLY add when PR is ready to merge/full CI is needed unstale Recieved activity after being labelled stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants