"git@developer.sourcefind.cn:OpenDAS/dlib.git" did not exist on "074d4b6e1563d9b5df9914ecba017d9ca4904d73"
Unverified Commit e6226e82 authored by Hongyi ZHANG's avatar Hongyi ZHANG Committed by GitHub
Browse files

[LOG] check whether cpu_affinity is avaible on the platform (#5572)


Co-authored-by: default avatarMufei Li <mufeili1996@gmail.com>
parent de292c7a
...@@ -1034,7 +1034,11 @@ class DataLoader(torch.utils.data.DataLoader): ...@@ -1034,7 +1034,11 @@ class DataLoader(torch.utils.data.DataLoader):
) )
def __iter__(self): def __iter__(self):
if self.device.type == "cpu" and not self.cpu_affinity_enabled: if (
self.device.type == "cpu"
and hasattr(psutil.Process, "cpu_affinity")
and not self.cpu_affinity_enabled
):
link = "https://docs.dgl.ai/tutorials/cpu/cpu_best_practises.html" link = "https://docs.dgl.ai/tutorials/cpu/cpu_best_practises.html"
dgl_warning( dgl_warning(
f"Dataloader CPU affinity opt is not enabled, consider switching it on " f"Dataloader CPU affinity opt is not enabled, consider switching it on "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment