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

merge from devel #77

Merged
merged 12 commits into from
Feb 10, 2022
Merged

merge from devel #77

merged 12 commits into from
Feb 10, 2022

Conversation

njzjz
Copy link
Owner

@njzjz njzjz commented Feb 10, 2022

njzjz and others added 12 commits January 15, 2022 13:32
`tf.no_op` has a strange pefermance issue... We need to use another tensor as placeholder.

(cherry picked from commit f3b7189)
* remove the dependency on `inputs` from `inputs_zero`

When profiling on multiple CPU threads, I notice that `inputs_zero` always runs after descriptor is computed. However, Some threads have nothing to do during ProdEnvMatA.

(cherry picked from commit e704b4a)

* fix UT

* revert changes to the interface of the EnerFitting

(cherry picked from commit 4f95d01)

* Revert "fix UT"

This reverts commit c43ac3a.

* fix typo

(cherry picked from commit a4c32c7)

* initialize input_dict

* init input_dict
TF supports a remapper optimizer which remaps subgraphs onto more efficient implementations by replacing commonly occuring subgraphs with optimized fused monolithic kernels. However, its support is limited: (1) MatMul + BiasAdd (not Add) + Activation; (2) Float32 (but not float64); (3) Activation is Tanh; (4) MKL is built and used.
This commit replaces Add by BiasAdd in the NN. The speed of a single op can be improved by about 20% when TF is using MKL and precision is set to float32. One can find `_MklNativeFusedMatMul` op in the profiler.

See also:
- https://www.tensorflow.org/guide/graph_optimization
- https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/grappler/optimizers/remapper.cc

(cherry picked from commit 8f2dc44)
* dynamically load op library in C++ interface

C++ interface will dynamically load OP libraries, just like
Python interface, so it no longer needs linking.

* version cannot be NULL...

* set LD_LIBRARY_PATH

* install runUnitTest

* remove CMAKE_LINK_WHAT_YOU_USE

It is not necessary anymore.

* also remove CMAKE_LINK_WHAT_YOU_USE in api_cc/tests

* change the type of op library to MODULE

* add the absolute path of library directory to cc rpath

* Revert "add the absolute path of library directory to cc rpath"

This reverts commit fabdac9.

* add `-Wl,--disable-new-dtags`

* Revert "add `-Wl,--disable-new-dtags`"

This reverts commit ecccb57.

* dlopen from dp lib but not TF
The following migrators were applied:

- Migrate to `build.tools` configuration.

This uses the new base Docker image based on Ubuntu 20.04 introduced in October 2021
and picks an appropriate Python version for your project
(read [our blog post](https://blog.readthedocs.com/new-build-specification/)
for details).
Notice that now you can specify the Node.js, Rust, and Go versions as well.

*Note:* Some system dependencies are not preinstalled anymore,
so this might require manually adding them to `build.apt_packages`
(see [our
documentation](https://docs.readthedocs.io/en/stable/config-file/v2.html#build-apt-packages>)).

- Migrate to Mamba as a drop-in replacement for Conda.

Your project requested using Mamba instead of Conda for performance reasons.
Now this is included in your configuration
and you can change it without our intervention.

Co-authored-by: Han Wang <amcadmus@gmail.com>
* Add image link of ROCm version.

* Update easy-install.md

Co-authored-by: Han Wang <amcadmus@gmail.com>
* add doc and examples for deep potential long-range

* add "* *" to pair style. use warning section of RTD for warning message

* rst syntax does not work in md. changed

Co-authored-by: Han Wang <wang_han@iapcm.ac.cn>
`std` and `avg` are stored as variables. `saver.restore` will restore and override it. So `data_stat` before `saver.restore` is useless.
Note that currently `init_from_frz_model` does not restore these variables.

I also add a message before `data_stat`. It sometimes takes long time.
* bump the testing Python version to 3.10

Test whether deepmd-kit is compatible with the latest Python. TF 2.8 was just released with Python 3.10 support.

* add cp310 to wheel building

* the version is not a float...
@pep8speaks
Copy link

Hello @njzjz! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 364:80: E501 line too long (83 > 79 characters)

Line 335:26: E203 whitespace before ':'
Line 409:80: E501 line too long (109 > 79 characters)
Line 411:80: E501 line too long (81 > 79 characters)

Line 197:80: E501 line too long (83 > 79 characters)
Line 209:36: W291 trailing whitespace

Line 120:1: W293 blank line contains whitespace
Line 276:56: E251 unexpected spaces around keyword / parameter equals
Line 276:58: E251 unexpected spaces around keyword / parameter equals
Line 276:80: E501 line too long (114 > 79 characters)
Line 276:85: E251 unexpected spaces around keyword / parameter equals
Line 276:87: E251 unexpected spaces around keyword / parameter equals
Line 276:109: E251 unexpected spaces around keyword / parameter equals
Line 276:111: E251 unexpected spaces around keyword / parameter equals

Line 286:80: E501 line too long (120 > 79 characters)
Line 287:80: E501 line too long (84 > 79 characters)

Line 199:48: W291 trailing whitespace
Line 209:80: E501 line too long (103 > 79 characters)

@njzjz njzjz merged commit 30f8e7c into njzjz:optimize-ops Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants