Skip to content

do not apply automatic batch size on CPUs#2148

Merged
wanghan-iapcm merged 4 commits into
deepmodeling:develfrom
njzjz:control_batch_Size
Dec 3, 2022
Merged

do not apply automatic batch size on CPUs#2148
wanghan-iapcm merged 4 commits into
deepmodeling:develfrom
njzjz:control_batch_Size

Conversation

@njzjz

@njzjz njzjz commented Dec 2, 2022

Copy link
Copy Markdown
Member

On CPUs, the batch size will not be increased anymore.

This PR also introduces an environment variable DP_INFER_BATCH_SIZE. It can be used to override the initial batch size.

To clarify: higher batch size also has better performance on CPUs.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@github-actions github-actions Bot added the Python label Dec 2, 2022
@codecov-commenter

codecov-commenter commented Dec 2, 2022

Copy link
Copy Markdown

Codecov Report

Base: 75.89% // Head: 74.12% // Decreases project coverage by -1.76% ⚠️

Coverage data is based on head (b9fa819) compared to base (bec0174).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #2148      +/-   ##
==========================================
- Coverage   75.89%   74.12%   -1.77%     
==========================================
  Files         182      201      +19     
  Lines       16974    19771    +2797     
  Branches      950     1416     +466     
==========================================
+ Hits        12883    14656    +1773     
- Misses       3406     4175     +769     
- Partials      685      940     +255     
Impacted Files Coverage Δ
deepmd/utils/batch_size.py 96.72% <100.00%> (+0.72%) ⬆️
source/op/gelu_multi_device.cc 51.08% <0.00%> (-3.57%) ⬇️
source/op/tabulate_multi_device.cc 70.54% <0.00%> (-3.29%) ⬇️
source/op/prod_force_grad_multi_device.cc 93.84% <0.00%> (-2.98%) ⬇️
source/op/prod_virial_grad_multi_device.cc 94.52% <0.00%> (-2.67%) ⬇️
source/op/prod_env_mat_multi_device_nvnmd.cc 88.11% <0.00%> (-1.79%) ⬇️
source/op/unaggregated_grad.cc 80.71% <0.00%> (-1.48%) ⬇️
source/lib/include/ComputeDescriptor.h 76.65% <0.00%> (-0.45%) ⬇️
source/op/optimizer/parallel.cc 1.26% <0.00%> (-0.02%) ⬇️
source/lmp/pppm_dplr.cpp 0.00% <0.00%> (ø)
... and 32 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@wanghan-iapcm wanghan-iapcm merged commit 3dffab8 into deepmodeling:devel Dec 3, 2022
mingzhong15 pushed a commit to mingzhong15/deepmd-kit that referenced this pull request Jan 15, 2023
On CPUs, the batch size will not be increased anymore.

This PR also introduces an environment variable `DP_INFER_BATCH_SIZE`.
It can be used to override the initial batch size.

To clarify: higher batch size also has better performance on CPUs.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants