Enable CPU device on SGLang (#2806)

This commit is contained in:
Chunyuan WU
2025-01-16 21:22:53 -08:00
committed by GitHub
parent a8ccacc8b8
commit 63051738a9
13 changed files with 376 additions and 9 deletions
@@ -82,6 +82,8 @@ class TpModelWorkerClient:
self.forward_thread.start()
self.parent_process = psutil.Process().parent()
self.scheduler_stream = torch.get_device_module(self.device).current_stream()
if self.device == "cpu":
self.scheduler_stream.synchronize = lambda: None # No-op for CPU
def get_worker_info(self):
return self.worker.get_worker_info()