@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / fbc3a1907a
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

[Bug] Migrate Reset cache for both v2 and v1 model runner (#42759)

Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

Wentao Ye committed Jun 12, 2026 at 09:38 UTC fbc3a1907aeb6beff59461e535045f17ac14306e
2 files changed +3 -2
vllm/v1/worker/gpu/model_runner.py
-2
@@ -367,8 +367,6 @@ class GPUModelRunner(LoRAModelRunnerMixin):
367 from vllm.v1.worker.gpu_model_runner import GPUModelRunner as GPUModelRunnerV1
368
369 GPUModelRunnerV1.reload_weights(self, *args, **kwargs) # type: ignore[arg-type]
370 - self.reset_encoder_cache()
371 - self.reset_mm_cache()
370
371 def apply_sparse_weight_patches(self, *args, **kwargs) -> None:
372 # TODO: Use full version instead of import when fully migrated to v2
vllm/v1/worker/gpu_model_runner.py
+3
@@ -5391,6 +5391,9 @@ class GPUModelRunner(
5391 weights_not_loaded,
5392 )
5393
5394 + self.reset_encoder_cache()
5395 + self.reset_mm_cache()
5396 +
5397 def _get_prompt_logprobs_dict(
5398 self,
5399 hidden_states: torch.Tensor,