HybridBackend
Introduction
HybridBackend is a training framework for deep recommenders which bridges the gap between evolving cloud infrastructure and complex training process. See documentation for more information.
Requirements
For Linux/macOS installation:
- Ubuntu 18.04 or later (64-bit)
- Python 3.6 or later
- Pip 19.0 or later
- TensorFlow 1.15 or TensorFlow 1.14
- For GPU support, CUDA SDK 11.3 or later is required
- Docker is the future
For docker-phobes using macOS:
- macOS 11.0 or later (x86 64-bit)
- Python 3.7 or later
- Pip 19.0 or later
- Tebnsorflow 1.15 or TensorFlow 1.14
- Other libraries installed by brew
Install
For TensorFlow 1.15 CPU version:
pip install hybridbackend-cpu
For TensorFlow 1.14 CPU version:
pip install hybridbackend-cpu-legacy
For GPU support:
PAI DLC docker images are prefered to use.
Build from source on Linux/macOS w/ docker
- Fetch source from git and sync submodules.
git submodule sync
git submodule update --init
- Step into developer docker.
# Environment variable `DOCKER_RUN_IMAGE` can be used to replace
# developer docker.
cibuild/run
- Configure.
# Only build CPU releated functions.
export HYBRIDBACKEND_WITH_CUDA=OFF
# For TensorFlow 1.14, zero-copy is not supported.
export HYBRIDBACKEND_WITH_ARROW_ZEROCOPY=OFF
# Use below command to verify C++ ABI of installed TensorFlow.
python -c 'import tensorflow as tf; print(tf.sysconfig.get_compile_flags())'
# Must be consistent with installed TensorFlow.
export HYBRIDBACKEND_USE_CXX11_ABI=0
- Build.
cibuild/run make -j8
Build from source on Linux w/o docker
- Fetch source from git and sync submodules.
git submodule sync
git submodule update --init
- Install TensorFlow and other requirements.
See Dockerfiles.
- Configure.
# Only build CPU releated functions.
export HYBRIDBACKEND_WITH_CUDA=OFF
# For TensorFlow 1.15, zero-copy is supported.
export HYBRIDBACKEND_WITH_ARROW_ZEROCOPY=ON
# Use below command to verify C++ ABI of installed TensorFlow.
python -c 'import tensorflow as tf; print(tf.sysconfig.get_compile_flags())'
# Must be consistent with installed TensorFlow.
export HYBRIDBACKEND_USE_CXX11_ABI=0
- Build.
make -j8
Build from source on macOS w/o docker
- Fetch source from git and sync submodules.
git submodule sync
git submodule update --init
- Install TensorFlow and other requirements.
brew install wget [email protected] [email protected] utf8proc zstd snappy re2 thrift zlib
brew uninstall grpc abseil || true
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
pip3.7 install -i https://mirrors.aliyun.com/pypi/simple/ \
tensorflow==1.14 \
"pybind11[global]"
- Configure.
# Only build CPU releated functions.
export HYBRIDBACKEND_WITH_CUDA=OFF
# For TensorFlow 1.14, zero-copy is not supported.
export HYBRIDBACKEND_WITH_ARROW_ZEROCOPY=OFF
# Use below command to verify C++ ABI of installed TensorFlow.
python -c 'import tensorflow as tf; print(tf.sysconfig.get_compile_flags())'
# Must be consistent with installed TensorFlow.
export HYBRIDBACKEND_USE_CXX11_ABI=0
# Set path of thridparty libraries.
export PYTHON=python3.7
export PYTHON_HOME=/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/Current
export PYTHON_IMPL=python3.7
export PYTHON_IMPL_FLAG=m
export SSL_HOME=/usr/local/opt/[email protected]
export RE2_HOME=/usr/local/opt/re2
export THRIFT_HOME=/usr/local/opt/thrift
export UTF8PROC_HOME=/usr/local/opt/utf8proc
export SNAPPY_HOME=/usr/local/opt/snappy
export ZSTD_HOME=/usr/local/opt/zstd
export ZLIB_HOME=/usr/local/opt/zlib
- Build.
make -j8
Contributing
We appreciate all contributions to improve HybridBackend. Please see Contributing Guide for more details.
Community
If you are intrested in adoption of HybridBackend in your organization, you can add your organization name to our list of adopters by submitting a pull request. We will discuss new feature requirements with you in advance.
Further more, if you would like to share your experiences with others, you are welcome to contact us in DingTalk:
License
HybridBackend is licensed under the Apache 2.0 License.