Skip to content

Commit 9337479

Browse files
committed
[V2] Hoist the input event into a local
Signed-off-by: Tianyu Guo <guoty@inferact.ai>
1 parent 230db0d commit 9337479

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

vllm/v1/worker/mm_encoder_model_runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ def input_tensor_semaphore(self) -> Iterator[None]:
5656
done with them and leaving records this step's last write.
5757
"""
5858
idx = self._input_event_idx
59-
self._input_events[idx].synchronize()
59+
input_event = self._input_events[idx]
60+
input_event.synchronize()
6061
try:
6162
yield
6263
finally:
63-
self._input_events[idx].record()
64+
input_event.record()
6465
self._input_event_idx = (idx + 1) % len(self._input_events)
6566

6667
def get_kv_cache_spec(self) -> dict[str, KVCacheSpec]:

0 commit comments

Comments
 (0)