[XPU] Delay BF16 check to worker init for spawn compatibility (#22979)

Signed-off-by: chzhang <chaojun.zhang@intel.com>
This commit is contained in:
Chaojun Zhang
2025-08-25 13:09:26 -07:00
committed by GitHub
parent 9188ae7cb5
commit 8a044754bd
6 changed files with 60 additions and 47 deletions
+1
View File
@@ -145,6 +145,7 @@ class XPUWorker(Worker):
):
self.device = torch.device(f"xpu:{self.local_rank}")
current_platform.set_device(self.device)
current_platform.check_if_supports_dtype(self.model_config.dtype)
torch.xpu.empty_cache()
self.init_gpu_memory = torch.xpu.get_device_properties(
self.local_rank).total_memory