Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update guidelines for the number of threads #1291

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Nov 18, 2021

close #1284.

Setting `OMP_NUM_THREADS` to 3 may be faster than 6. It needs to be confirmed.
@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2021

Codecov Report

Merging #1291 (90911b2) into devel (77ce651) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel    #1291      +/-   ##
==========================================
- Coverage   75.97%   75.90%   -0.08%     
==========================================
  Files          91       91              
  Lines        7406     7416      +10     
==========================================
+ Hits         5627     5629       +2     
- Misses       1779     1787       +8     
Impacted Files Coverage Δ
deepmd/env.py 76.04% <100.00%> (+0.50%) ⬆️
deepmd/utils/tabulate.py 85.23% <0.00%> (-2.98%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77ce651...90911b2. Read the comment docs.

@njzjz njzjz marked this pull request as ready for review November 18, 2021 08:54
@njzjz njzjz marked this pull request as draft November 18, 2021 10:04
@njzjz njzjz marked this pull request as ready for review November 19, 2021 06:13
Comment on lines +129 to +136
if "OMP_NUM_THREADS" not in os.environ or \
"TF_INTRA_OP_PARALLELISM_THREADS" not in os.environ or \
"TF_INTER_OP_PARALLELISM_THREADS" not in os.environ:
logging.warning(
"To get the best performance, it is recommended to adjust "
"the number of threads by setting the environment variables "
"OMP_NUM_THREADS, TF_INTRA_OP_PARALLELISM_THREADS, and "
"TF_INTER_OP_PARALLELISM_THREADS.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good suggestion when the user train with GPU?
I think a user only need to adjust them when he/she uses CPU.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1284 is confirmed to be caused by improper configuration of threads.

@wanghan-iapcm wanghan-iapcm merged commit 3b96011 into deepmodeling:devel Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants