You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(jax): add options to use TensorFlow C library to build the JAX backend (#4357)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
- **New Features**
- Updated installation documentation to clarify requirements for
TensorFlow and JAX backends.
- Expanded supported platforms to include Windows x86-64.
- Added instructions for enabling JAX backend during installation from
source.
- **Documentation**
- Enhanced clarity of installation prerequisites and supported
platforms.
- Included a note directing users to the TensorFlow tab for additional
information.
- **Bug Fixes**
- Improved error handling for unsupported backend configurations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
DeePMD-kit provides pre-compiled C library package (`libdeepmd_c.tar.gz`) in each [release](https://github.com/deepmodeling/deepmd-kit/releases). It can be used to build the [LAMMPS plugin](./install-lammps.md) and [GROMACS patch](./install-gromacs.md), as well as many [third-party software packages](../third-party/out-of-deepmd-kit.md), without building TensorFlow and DeePMD-kit on one's own.
Copy file name to clipboardExpand all lines: doc/install/install-from-source.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -316,6 +316,15 @@ You can also download libtorch prebuilt library from the [PyTorch website](https
316
316
317
317
:::
318
318
319
+
:::{tab-item} JAX {{ jax_icon }}
320
+
321
+
The JAX backend only depends on the TensorFlow C API, which is included in both TensorFlow C++ library and [TensorFlow C library](https://www.tensorflow.org/install/lang_c).
322
+
If you want to use the TensorFlow C++ library, just enable the TensorFlow backend (which depends on the TensorFlow C++ library) and nothing else needs to do.
323
+
If you want to use the TensorFlow C library and disable the TensorFlow backend,
324
+
download the TensorFlow C library from [this page](https://www.tensorflow.org/install/lang_c#download_and_extract).
If you want to use the TensorFlow C++ library, just enable the TensorFlow backend and nothing else needs to do.
384
+
If you want to use the TensorFlow C library and disable the TensorFlow backend, set {cmake:variable}`ENABLE_JAX` to `ON` and `CMAKE_PREFIX_PATH` to the root directory of the [TensorFlow C library](https://www.tensorflow.org/install/lang_c).
One may add the following CMake variables to `cmake` using the [`-D <var>=<value>` option](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-D):
@@ -378,6 +398,7 @@ One may add the following CMake variables to `cmake` using the [`-D <var>=<value
378
398
**Type**: `BOOL` (`ON`/`OFF`), Default: `OFF`
379
399
380
400
{{ tensorflow_icon }} {{ jax_icon }} Whether building the TensorFlow backend and the JAX backend.
401
+
Setting this option to `ON` will also set {cmake:variable}`ENABLE_JAX` to `ON`.
381
402
382
403
:::
383
404
@@ -389,6 +410,16 @@ One may add the following CMake variables to `cmake` using the [`-D <var>=<value
389
410
390
411
:::
391
412
413
+
:::{cmake:variable} ENABLE_JAX
414
+
415
+
**Type**: `BOOL` (`ON`/`OFF`), Default: `OFF`
416
+
417
+
{{ jax_icon }} Build the JAX backend.
418
+
If {cmake:variable}`ENABLE_TENSORFLOW` is `ON`, the TensorFlow C++ library is used to build the JAX backend;
419
+
If {cmake:variable}`ENABLE_TENSORFLOW` is `OFF`, the TensorFlow C library is used to build the JAX backend.
0 commit comments