Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions vllm/entrypoints/openai/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ async def build_async_engine_client(

async with build_async_engine_client_from_engine_args(
engine_args, args.disable_frontend_multiprocessing) as engine:

# Don't keep the dummy data in memory
await engine.reset_mm_cache()

yield engine


Expand Down Expand Up @@ -189,6 +185,10 @@ async def build_async_engine_client_from_engine_args(
usage_context=usage_context,
disable_log_requests=engine_args.disable_log_requests,
disable_log_stats=engine_args.disable_log_stats)

# Don't keep the dummy data in memory
await async_llm.reset_mm_cache()
Comment on lines +189 to +190
Copy link
Member Author

@DarkLight1337 DarkLight1337 May 13, 2025

Choose a reason for hiding this comment

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

For some reason, calling reset_mm_cache in V0 causes vllm:iteration_tokens_total_count metric to be offset by one. Since there is no need to sync the caches in V0, I simply removed the reset_mm_cache call from the top level since it's called inside V0 LLMEngine (which is inherited by _AsyncLLMEngine) anyway.


yield async_llm
finally:
if async_llm:
Expand Down
2 changes: 1 addition & 1 deletion vllm/v1/engine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def profile(self, is_start: bool = True):
def reset_mm_cache(self):
# NOTE: Since this is mainly for debugging, we don't attempt to
# re-sync the internal caches (P0 processor, P0 mirror, P1 mirror)
if self.scheduler.get_num_unfinished_requests():
if self.scheduler.has_unfinished_requests():
logger.warning("Resetting the multi-modal cache when requests are "
"in progress may lead to desynced internal caches.")

Expand Down