Skip to content

Add model compression support for se_t type descriptor#1175

Merged
njzjz merged 24 commits intodeepmodeling:develfrom
denghuilu:se-t-compression
Oct 19, 2021
Merged

Add model compression support for se_t type descriptor#1175
njzjz merged 24 commits intodeepmodeling:develfrom
denghuilu:se-t-compression

Conversation

@denghuilu
Copy link
Member

@denghuilu denghuilu commented Sep 28, 2021

With the help of @liangadam , we have added the model compression support for the se_t type descriptor. The main changes are:

  • Reconstruct the DPTabulate class for the support the of se_t type;
  • Change the op name from TabulateFusion to TabulateFusionSeA for se_a type;
  • Add op TabulateFusionSeT for se_t type model compression, and put the corresponding CPU and GPU implementations in tabulate.cc and tabulate.cu;
  • Add enable_model_compression method for se_t.py;
  • Note that the default step of se_t is 10 times larger than se_a.

By using the default water example benchmark system, we found that the lammps output of the se_t compressed model is consistent with the original model. And with the embedding net size setting[25, 50, 100], [4, 8, 16], the compressed model gains speedup by a factor of 20(single V100 GPU) and 12(CPU) correspondingly.

TODO:

  • Add rocm support;
  • Add unit test for 'se_t' model compression;
  • Add doc support for 'se_t' model compression;
  • Fix the bug of accuracy when the last_layer_size of embedding net is equal or less than 8.

@denghuilu denghuilu requested review from amcadmus and njzjz and removed request for njzjz September 28, 2021 08:42
@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2021

Codecov Report

Merging #1175 (016bf73) into devel (4bc3b27) will increase coverage by 0.08%.
The diff coverage is 78.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel    #1175      +/-   ##
==========================================
+ Coverage   75.95%   76.03%   +0.08%     
==========================================
  Files          91       91              
  Lines        7260     7358      +98     
==========================================
+ Hits         5514     5595      +81     
- Misses       1746     1763      +17     
Impacted Files Coverage Δ
deepmd/entrypoints/compress.py 76.36% <ø> (-0.83%) ⬇️
deepmd/entrypoints/main.py 88.77% <ø> (ø)
deepmd/utils/argcheck.py 90.03% <ø> (-0.04%) ⬇️
deepmd/utils/convert.py 15.78% <19.04%> (-1.16%) ⬇️
deepmd/entrypoints/convert.py 22.22% <20.00%> (-6.35%) ⬇️
deepmd/descriptor/se_a.py 95.31% <50.00%> (-0.95%) ⬇️
deepmd/utils/tabulate.py 88.20% <85.07%> (+5.06%) ⬆️
deepmd/descriptor/se_t.py 98.19% <100.00%> (+0.14%) ⬆️
source/op/_tabulate_grad.py 100.00% <100.00%> (ø)

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 4bc3b27...016bf73. Read the comment docs.

@liangadam
Copy link
Contributor

An error ‘incompatible model version’ occurred when using the produced model.pb to run lammps.

terminate called after throwing an instance of 'std::runtime_error'
what(): incompatable model: version 1.1 in graph, but version 1.0 supported

@denghuilu
Copy link
Member Author

An error ‘incompatible model version’ occurred when using the produced model.pb to run lammps.

terminate called after throwing an instance of 'std::runtime_error' what(): incompatable model: version 1.1 in graph, but version 1.0 supported

You should manually compile the deepmd-kit c++ interface from scratch to match the 1.1 model version.

@denghuilu denghuilu marked this pull request as ready for review October 17, 2021 05:51
@denghuilu denghuilu requested a review from njzjz October 17, 2021 08:01
@denghuilu denghuilu requested review from amcadmus and njzjz October 18, 2021 04:48
@njzjz njzjz enabled auto-merge October 18, 2021 20:39
@njzjz njzjz merged commit d9d4432 into deepmodeling:devel Oct 19, 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.

5 participants