[Misc] Replace cuda hard code with current_platform (#16983)

Signed-off-by: shen-shanshan <467638484@qq.com>
This commit is contained in:
Shanshan Shen
2025-05-23 04:38:50 +00:00
committed by GitHub
parent 4be2255c81
commit 9c1baa5bc6
3 changed files with 11 additions and 7 deletions
+4 -1
View File
@@ -120,7 +120,10 @@ def set_forward_context(attn_metadata: Any,
# we use synchronous scheduling right now,
# adding a sync point here should not affect
# scheduling of the next batch
torch.cuda.synchronize()
from vllm.platforms import current_platform
synchronize = current_platform.synchronize
if synchronize is not None:
synchronize()
now = time.perf_counter()
# time measurement is in milliseconds
batchsize_forward_time[batchsize].append(