-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Adding horovod #24472
Merged
Merged
Adding horovod #24472
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
dc8f9f6
add horovod
njzjz c40c929
fix typo
njzjz 076439a
add pyyaml to host
njzjz ecbcb1f
it seems that run requires should be added to host
njzjz 29a9aed
run flatc before pip
njzjz 78901c1
download source from github repository
njzjz 50d6482
fix url
njzjz 389f6e4
disable gloo
njzjz 7795a49
add boost headers
njzjz 22f7e00
add lbfgspp
njzjz c674926
it seems no way to make tf or pt optional
njzjz 7bae1dd
revert c674926d61bcdba57e3474c19a8ddd665b116024; add tf to missing_ds…
njzjz 7571224
put in the correct section
njzjz 5b61c3c
add torch libraries to missing_dso_whitelist
njzjz 1b537fa
move script to build.sh; fix build issues
njzjz 3fa92f1
fix errors
njzjz 64da1fe
set include directory for flatc
njzjz 10fad29
add _pywrap_tensorflow_internal.so
njzjz 78a5adc
add `--keep-prefix` to flatc
njzjz d6e87c2
set make flags
njzjz fded620
set `--include-prefix`
njzjz c9548a4
add comments to missing_dso_whitelist
njzjz 2d09d05
Merge branch 'main' into horovod
njzjz 1525055
Add flatbuffers to build requirements
njzjz 98c1532
fix indents
njzjz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
# See https://github.com/horovod/horovod/issues/3956 | ||
flatc -c -o horovod/common/wire horovod/common/wire/message.fbs | ||
flatc -c -I . --include-prefix ../common/wire -o horovod/tensorflow horovod/tensorflow/custom_call_config.fbs | ||
|
||
if [[ ${cuda_compiler_version} != "None" ]]; then | ||
export HOROVOD_GPU_OPERATIONS=NCCL | ||
export HOROVOD_NCCL_LINK=SHARED | ||
export HOROVOD_CUDA_HOME=/usr/local/cuda | ||
fi | ||
export HOROVOD_WITH_TENSORFLOW=1 | ||
export HOROVOD_WITH_PYTORCH=1 | ||
# mxnet is not available on conda-forge | ||
# https://github.com/conda-forge/staged-recipes/issues/4447 | ||
export HOROVOD_WITHOUT_MXNET=1 | ||
export HOROVOD_WITH_MPI=1 | ||
# gloo is not avaiable on conda-forge | ||
export HOROVOD_WITHOUT_GLOO=1 | ||
if [[ "${target_platform}" == osx-* ]]; then | ||
# https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk | ||
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" | ||
fi | ||
|
||
# default is -j8 | ||
export MAKEFLAGS="-j${CPU_COUNT}" | ||
python -m pip install . -vv |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mpi: | ||
- mpich | ||
- openmpi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{% set name = "horovod" %} | ||
{% set version = "0.28.1" %} | ||
{% set proc_type = "cuda" if cuda_compiler_version != "None" else "cpu" %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
url: https://github.com/horovod/horovod/archive/refs/tags/v{{ version }}.tar.gz | ||
sha256: 88fbcd2815083607a5d27962f323eae5752e3eb96511aaac98258f280cac0f8e | ||
|
||
build: | ||
number: 0 | ||
skip: true # [win] | ||
string: {{ proc_type }}_mpi_{{ mpi }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} | ||
ignore_run_exports_from: | ||
- flatbuffers | ||
- tensorflow | ||
- pytorch | ||
# Horovod supports multiple frameworks, and the package is built against TensorFlow and PyTorch. | ||
# However, usually, the user only uses one of them simultaneously. (by importing either horovod.tensorflow or horovod.torch) | ||
# Thus, TensorFlow and PyTorch are not listed in the `run` section, but in the `run_constrained` section. | ||
# Users can manually install Horovod and only one of them. | ||
# Both TensorFlow and PyTorch libraries are listed in `missing_dso_whitelist`, and a test is added to ensure Horovod libraries can be | ||
# correctly loaded when TensorFlow and PyTorch are installed. | ||
# (horovod.tensorflow loads Horovod TensorFlow library and horovod.torch loads Horovod PyTorch library) | ||
missing_dso_whitelist: | ||
- "*/libtensorflow_framework.so.*" # [linux] | ||
- "*/libtensorflow_cc.so.*" # [linux] | ||
- "*/torch/lib/*.so" # [linux] | ||
- "*/libtensorflow_framework.*.dylib" # [osx] | ||
- "*/libtensorflow_cc.*.dylib" # [osx] | ||
- "*/_pywrap_tensorflow_internal.so" | ||
- "*/torch/lib/*.dylib" # [osx] | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('cxx') }} | ||
- {{ compiler('cuda') }} # [cuda_compiler_version != 'None'] | ||
- cmake >=3.13 | ||
- make # [unix] | ||
- python # [build_platform != target_platform] | ||
- cross-python_{{ target_platform }} # [build_platform != target_platform] | ||
|
||
njzjz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
host: | ||
- python | ||
- pip | ||
- wheel | ||
- setuptools | ||
- pyyaml | ||
- cloudpickle | ||
- packaging | ||
- psutil | ||
- nccl # [cuda_compiler_version != 'None'] | ||
- {{ mpi }} | ||
- mpi4py | ||
- tensorflow | ||
- tensorflow * {{ proc_type }}* | ||
- pytorch | ||
- pytorch * {{ proc_type }}* | ||
# for flatc | ||
- flatbuffers | ||
- libboost-headers | ||
- lbfgspp | ||
|
||
run: | ||
- python | ||
- pyyaml | ||
- cloudpickle | ||
- packaging | ||
- psutil | ||
- nccl # [cuda_compiler_version != 'None'] | ||
- {{ mpi }} | ||
- mpi4py | ||
|
||
run_constrained: | ||
- {{ pin_compatible('tensorflow', max_pin='x.x') }} {{ proc_type }}* | ||
- {{ pin_compatible('pytorch', max_pin='x.x') }} {{ proc_type }}* | ||
|
||
test: | ||
requires: | ||
- pip | ||
- tensorflow | ||
- pytorch | ||
imports: | ||
- horovod | ||
- horovod.tensorflow | ||
- horovod.torch | ||
commands: | ||
- pip check | ||
- horovodrun -h | ||
|
||
about: | ||
home: https://horovod.ai/ | ||
license: Apache-2.0 | ||
license_family: Apache | ||
license_file: LICENSE | ||
summary: 'Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.' | ||
doc_url: https://horovod.readthedocs.io/ | ||
dev_url: https://github.com/horovod/horovod | ||
|
||
extra: | ||
recipe-maintainers: | ||
- njzjz |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment here why they are listed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. Thanks for the review.