add an option to enable native compilation optimization#2151
Merged
Conversation
After I enable it, I can obseve speedup in some cases. For `examples/water/se_e2_a`, compress training with FP32 networks: ``` CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=8 TF_INTRA_OP_PARALLELISM_THREADS=8 TF_INTER_OP_PARALLELISM_THREADS=2 dp train input.json -f frozen_model_compressed.pb ``` Before enable it, ``` DEEPMD INFO batch 100 training time 1.67 s, testing time 0.03 s DEEPMD INFO batch 200 training time 1.25 s, testing time 0.03 s DEEPMD INFO batch 300 training time 1.23 s, testing time 0.03 s DEEPMD INFO batch 400 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 500 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 600 training time 1.23 s, testing time 0.03 s DEEPMD INFO batch 700 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 800 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 900 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 1000 training time 1.24 s, testing time 0.03 s ``` After enabling it, ``` DEEPMD INFO batch 100 training time 1.60 s, testing time 0.03 s DEEPMD INFO batch 200 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 300 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 400 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 500 training time 1.11 s, testing time 0.03 s DEEPMD INFO batch 600 training time 1.11 s, testing time 0.03 s DEEPMD INFO batch 700 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 800 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 900 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 1000 training time 1.13 s, testing time 0.03 s ``` About 10% improvement. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Codecov ReportBase: 75.89% // Head: 74.13% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## devel #2151 +/- ##
==========================================
- Coverage 75.89% 74.13% -1.77%
==========================================
Files 182 201 +19
Lines 16974 19758 +2784
Branches 950 1414 +464
==========================================
+ Hits 12883 14648 +1765
- Misses 3406 4170 +764
- Partials 685 940 +255
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. |
wanghan-iapcm
approved these changes
Dec 4, 2022
mingzhong15
pushed a commit
to mingzhong15/deepmd-kit
that referenced
this pull request
Jan 15, 2023
…#2151) After I enable it, I can observe speedup in some cases. For `examples/water/se_e2_a`, compress training FP32 networks: ```sh CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=8 TF_INTRA_OP_PARALLELISM_THREADS=8 TF_INTER_OP_PARALLELISM_THREADS=2 dp train input.json -f frozen_model_compressed.pb ``` Before enabling it, ``` DEEPMD INFO batch 100 training time 1.67 s, testing time 0.03 s DEEPMD INFO batch 200 training time 1.25 s, testing time 0.03 s DEEPMD INFO batch 300 training time 1.23 s, testing time 0.03 s DEEPMD INFO batch 400 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 500 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 600 training time 1.23 s, testing time 0.03 s DEEPMD INFO batch 700 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 800 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 900 training time 1.24 s, testing time 0.03 s DEEPMD INFO batch 1000 training time 1.24 s, testing time 0.03 s ``` After enabling it, ``` DEEPMD INFO batch 100 training time 1.60 s, testing time 0.03 s DEEPMD INFO batch 200 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 300 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 400 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 500 training time 1.11 s, testing time 0.03 s DEEPMD INFO batch 600 training time 1.11 s, testing time 0.03 s DEEPMD INFO batch 700 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 800 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 900 training time 1.10 s, testing time 0.03 s DEEPMD INFO batch 1000 training time 1.13 s, testing time 0.03 s ``` About 10% improvement. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After I enable it, I can observe speedup in some cases. For
examples/water/se_e2_a, compress training FP32 networks:Before enabling it,
After enabling it,
About 10% improvement.