Skip to content

Commit feff486

Browse files
committed
Remove horovod (#16150)
1 parent 5770149 commit feff486

File tree

17 files changed

+3
-962
lines changed

17 files changed

+3
-962
lines changed

.github/workflows/ci-tests-pytorch.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,6 @@ jobs:
8282
pip --version
8383
pip install -q -r .actions/requirements.txt
8484
85-
- name: Setup macOS
86-
if: runner.os == 'macOS'
87-
run: |
88-
brew install openmpi libuv # Horovod on macOS requires OpenMPI, Gloo not currently supported
89-
90-
- name: Setup Windows
91-
if: runner.os == 'windows'
92-
run: |
93-
python .actions/assistant.py requirements_prune_pkgs "--packages=[horovod]"
94-
9585
- name: Set min. dependencies
9686
if: ${{ matrix.requires == 'oldest' }}
9787
run: |
@@ -142,23 +132,6 @@ jobs:
142132
# pip install -r requirements/pytorch/strategies.txt --find-links ${TORCH_URL}
143133
pip list
144134
145-
- name: Reinstall Horovod if necessary
146-
if: runner.os != 'windows'
147-
env:
148-
HOROVOD_BUILD_ARCH_FLAGS: "-mfma"
149-
HOROVOD_WITHOUT_MXNET: 1
150-
HOROVOD_WITHOUT_TENSORFLOW: 1
151-
run: |
152-
HOROVOD_BUILT=$(python -c "import horovod.torch; horovod.torch.nccl_built(); print('SUCCESS')" || true)
153-
if [[ $HOROVOD_BUILT != "SUCCESS" ]]; then
154-
pip uninstall -y horovod
155-
grep "horovod" requirements/pytorch/strategies.txt > requirements/pytorch/horovod.txt
156-
pip install --no-cache-dir -r requirements/pytorch/horovod.txt
157-
fi
158-
horovodrun --check-build
159-
python -c "import horovod.torch"
160-
pip list
161-
162135
- name: Cache datasets
163136
uses: actions/cache@v3
164137
with:

dockers/base-cuda/Dockerfile

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ ENV \
2828
TZ=Europe/Prague \
2929
PATH="$PATH:/root/.local/bin" \
3030
CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" \
31-
TORCH_CUDA_ARCH_LIST="3.7;5.0;6.0;7.0;7.5;8.0" \
3231
MKL_THREADING_LAYER=GNU \
3332
# MAKEFLAGS="-j$(nproc)"
3433
MAKEFLAGS="-j2"
@@ -100,24 +99,6 @@ RUN \
10099
pip install -r requirements/pytorch/base.txt --no-cache-dir --find-links https://download.pytorch.org/whl/cu${CUDA_VERSION_MM}/torch_stable.html && \
101100
rm assistant.py
102101

103-
ENV \
104-
HOROVOD_CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR \
105-
HOROVOD_GPU_OPERATIONS=NCCL \
106-
HOROVOD_WITH_PYTORCH=1 \
107-
HOROVOD_WITHOUT_TENSORFLOW=1 \
108-
HOROVOD_WITHOUT_MXNET=1 \
109-
HOROVOD_WITH_GLOO=1 \
110-
HOROVOD_WITH_MPI=1
111-
112-
RUN \
113-
# CUDA 10.2 doesn't support ampere architecture (8.0).
114-
if [[ "$CUDA_VERSION" < "11.0" ]]; then export TORCH_CUDA_ARCH_LIST=${TORCH_CUDA_ARCH_LIST//";8.0"/}; echo $TORCH_CUDA_ARCH_LIST; fi && \
115-
HOROVOD_BUILD_CUDA_CC_LIST=${TORCH_CUDA_ARCH_LIST//";"/","} && \
116-
export HOROVOD_BUILD_CUDA_CC_LIST=${HOROVOD_BUILD_CUDA_CC_LIST//"."/""} && \
117-
echo $HOROVOD_BUILD_CUDA_CC_LIST && \
118-
cmake --version && \
119-
pip install --no-cache-dir horovod && \
120-
horovodrun --check-build
121102

122103
RUN \
123104
CUDA_VERSION_MAJOR=$(python -c "import torch; print(torch.version.cuda.split('.')[0])") && \
@@ -156,7 +137,6 @@ RUN \
156137
# install rest of strategies
157138
# remove colossalai from requirements since they are installed separately
158139
python -c "fname = 'requirements/pytorch/strategies.txt' ; lines = [line for line in open(fname).readlines() if 'colossalai' not in line] ; open(fname, 'w').writelines(lines)" ; \
159-
python -c "fname = 'requirements/pytorch/strategies.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)" ; \
160140
cat requirements/pytorch/strategies.txt && \
161141
pip install -r requirements/pytorch/devel.txt -r requirements/pytorch/strategies.txt --no-cache-dir --find-links https://download.pytorch.org/whl/cu${CUDA_VERSION_MM}/torch_stable.html
162142

dockers/base-ipu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ COPY environment.yml environment.yml
6060
RUN conda init bash && \
6161
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'python>=[\d\.]+', 'python=${PYTHON_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
6262
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'- pytorch[>=]+[\d\.]+', '- pytorch=${PYTORCH_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
63-
python -c "fname = 'environment.yml' ; req = open(fname).readlines() ; open(fname, 'w').writelines([ln for ln in req if not any(n in ln for n in ['pytorch>', 'horovod'])])" && \
63+
python -c "fname = 'environment.yml' ; req = open(fname).readlines() ; open(fname, 'w').writelines([ln for ln in req if not any(n in ln for n in ['pytorch>'])])" && \
6464
cat environment.yml && \
6565
conda env create -f environment.yml && \
6666
conda clean -ya && \

dockers/base-xla/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RUN conda create -y --name $CONDA_ENV && \
6161
conda init bash && \
6262
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'python>=[\d\.]+', 'python=${PYTHON_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
6363
# drop unnecessary packages
64-
python -c "fname = 'environment.yml' ; req = open(fname).readlines() ; open(fname, 'w').writelines([ln for ln in req if not any(n in ln for n in ['pytorch>', 'horovod'])])" && \
64+
python -c "fname = 'environment.yml' ; req = open(fname).readlines() ; open(fname, 'w').writelines([ln for ln in req if not any(n in ln for n in ['pytorch>'])])" && \
6565
cat environment.yml && \
6666
conda env update --file environment.yml && \
6767
conda clean -ya && \

requirements/pytorch/check-avail-strategies.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
import bagua # noqa: F401
33
import deepspeed # noqa: F401
44
import fairscale # noqa: F401
5-
import horovod.torch
6-
7-
# returns an error code
8-
assert horovod.torch.nccl_built()

requirements/pytorch/strategies.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44
# colossalai>=0.1.10 # TODO: uncomment when there's a stable version released
55
fairscale>=0.4.5, <0.4.13
66
deepspeed>=0.6.0, <=0.7.0
7-
# no need to install with [pytorch] as pytorch is already installed
8-
horovod>=0.21.2, !=0.24.0, <=0.26.1
97
hivemind==1.1.2; sys_platform == 'linux'

src/pytorch_lightning/core/optimizer.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,7 @@ def __init__(self, optimizer: Optimizer):
4040
# copy most of the `Optimizer` methods into this instance. `__del__` is skipped in case the optimizer has
4141
# implemented custom logic which we would not want to call on destruction of the `LightningOptimizer`
4242
self.__dict__ = {k: v for k, v in optimizer.__dict__.items() if k not in ("step", "__del__")}
43-
44-
# For Horovod
45-
if hasattr(optimizer, "skip_synchronize"):
46-
self.__class__ = type(
47-
"Lightning" + optimizer.__class__.__name__, (self.__class__, optimizer.__class__.__bases__[0]), {}
48-
)
49-
self.skip_synchronize = optimizer.skip_synchronize
50-
self.synchronize = optimizer.synchronize
51-
else:
52-
self.__class__ = type("Lightning" + optimizer.__class__.__name__, (self.__class__, optimizer.__class__), {})
43+
self.__class__ = type("Lightning" + optimizer.__class__.__name__, (self.__class__, optimizer.__class__), {})
5344

5445
self._optimizer = optimizer
5546
self._strategy: Optional[pl.strategies.Strategy] = None

src/pytorch_lightning/strategies/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from pytorch_lightning.strategies.fully_sharded import DDPFullyShardedStrategy # noqa: F401
2222
from pytorch_lightning.strategies.fully_sharded_native import DDPFullyShardedNativeStrategy # noqa: F401
2323
from pytorch_lightning.strategies.hivemind import HivemindStrategy # noqa: F401
24-
from pytorch_lightning.strategies.horovod import HorovodStrategy # noqa: F401
2524
from pytorch_lightning.strategies.hpu_parallel import HPUParallelStrategy # noqa: F401
2625
from pytorch_lightning.strategies.ipu import IPUStrategy # noqa: F401
2726
from pytorch_lightning.strategies.parallel import ParallelStrategy # noqa: F401

src/pytorch_lightning/strategies/horovod.py

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)