Skip to content

Commit 03a8992

Browse files
committed
move synchronize
1 parent f75ba8d commit 03a8992

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ucm/integration/vllm/ucm_connector.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,9 @@ def wait_for_save(self) -> None:
559559
# TODO support PP
560560
if (self.is_mla or self.is_dsa) and self.global_rank != 0:
561561
return
562-
if self.metrics_config:
562+
if self.metrics_config or current_platform.device_type == "npu":
563+
# When use vllm_ascend, we should add synchronize here, otherwise accuracy problem will raise
564+
# This has already been fixed in the latest main branch of vllm_ascend, so synchronize will no longer be needed in future versions.
563565
self.synchronize()
564566

565567
metadata = self._get_connector_metadata()
@@ -571,9 +573,6 @@ def wait_for_save(self) -> None:
571573
num_saved_block = 0
572574
num_saved_request = 0
573575
save_start_time = time.perf_counter() * 1000
574-
# This has already been fixed in the latest main branch of vllm_ascend, so synchronize will no longer be needed in future versions.
575-
if current_platform.device_type == "npu":
576-
self.synchronize()
577576
for request_id, request in metadata.request_meta.items():
578577
if len(request.dump_block_ids[0]) == 0:
579578
continue

0 commit comments

Comments
 (0)