-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[WIP][Don't merge] Comment out dmlc::SetEnv in pthread_atfork #13438 #13472
Conversation
@mxnet-label-bot add [pr-work-in-progress] @larroy Please add "Fixes #13438" in the PR description to automatically close the issue when the PR is merged |
@samskalicky what do you think of this? I think we should run a few examples to see if the number of threads remains constant when using CPU threaded engine. |
@vandanavk done. Thanks for the suggestion. |
Pedro, it would be great if the fix is as simple as commenting out the SetEnv. But what about the corresponding GetEnv in: |
Yes most likely the fix is too simplistic. Wanted to have a fist test run to see how it looks. |
@mxnet-label-bot add[par-awaiting-testing] |
src/initialize.cc
Outdated
dmlc::SetEnv("MXNET_CPU_WORKER_NTHREADS", 1); | ||
dmlc::SetEnv("OMP_NUM_THREADS", 1); | ||
// dmlc::SetEnv("MXNET_CPU_WORKER_NTHREADS", 1); | ||
// dmlc::SetEnv("OMP_NUM_THREADS", 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting to 1 effectively disabled OMP (assuming OMP looks at the environment variable after startup). What happens if the forked process tries to use OMP? There should be a test for this because I know libgomp doesn't play well with forking sometimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review Chris. Can you elaborate and provide more detail on what do you suggest to do?
@larroy Can you address comments and rebase this PR? Thanks |
@mxnet-label-bot update [pr-awaiting-response] |
@larroy Can this be merged now? Or should we close this PR? |
@larroy Gentle ping. |
I think we need to do more testing to be confident that the solution is solid. I can do it during my next oncall. The change might be trivial but checking for correctness in the multi-threaded scenario and with interactions from other libraries is costly in terms of developer time. |
@larroy Gentle ping. |
Description
Fixes #13438
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments