Warn users when release_memory_occupation is called without memory saver enabled (#4566)

This commit is contained in:
fzyzcjy authored and GitHub committed 2025-03-26 00:18:14 -07:00
1 parent 34e07a65f1
commit 26f07294f1
10 files changed
+50 -12

No files matched your search

@@ -287,7 +287,14 @@ class ModelRunner:
def init_torch_distributed(self):
logger.info("Init torch distributed begin.")
torch.get_device_module(self.device).set_device(self.gpu_id)
try:
torch.get_device_module(self.device).set_device(self.gpu_id)
except Exception:
logger.warning(
f"Context: {self.device=} {self.gpu_id=} {os.environ.get('CUDA_VISIBLE_DEVICES')=} {self.tp_rank=} {self.tp_size=}"
)
raise
if self.device == "cuda":
backend = "nccl"
elif self.device == "xpu":