Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
e6226e82
Unverified
Commit
e6226e82
authored
Apr 20, 2023
by
Hongyi ZHANG
Committed by
GitHub
Apr 20, 2023
Browse files
[LOG] check whether cpu_affinity is avaible on the platform (#5572)
Co-authored-by:
Mufei Li
<
mufeili1996@gmail.com
>
parent
de292c7a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
python/dgl/dataloading/dataloader.py
python/dgl/dataloading/dataloader.py
+5
-1
No files found.
python/dgl/dataloading/dataloader.py
View file @
e6226e82
...
@@ -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 "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment