From 52267e7b16c3d52e8287e740f6be2b27ab7bc7c5 Mon Sep 17 00:00:00 2001 From: vfdev Date: Wed, 2 Oct 2024 14:53:13 +0200 Subject: [PATCH] Fixed horovod build --- .github/workflows/hvd-tests.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index e67635b5f95..9a6d909d3cd 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -56,9 +56,6 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - name: Install dependencies shell: bash -l {0} @@ -67,7 +64,20 @@ jobs: #install other dependencies pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu pip install -r requirements-dev.txt - pip install git+https://github.com/horovod/horovod.git + + # Install Horovod from source and apply a patch to build with recent pytorch + # We can't use pip install as build-env can't find pytorch and + # `--no-build-isolation` does not work with horovod setup.py + git clone --recursive https://github.com/horovod/horovod.git /tmp/horovod + cd /tmp/horovod + sed -i "s/CMAKE_CXX_STANDARD 14/CMAKE_CXX_STANDARD 17/g" CMakeLists.txt + sed -i "s/CMAKE_CXX_STANDARD 14/CMAKE_CXX_STANDARD 17/g" horovod/torch/CMakeLists.txt + HOROVOD_WITH_PYTORCH=1 python setup.py install + cd - + # test the installation: + python -c "import horovod.torch as hvd; hvd.mpi_ops.Sum" + + # Install ignite python setup.py install # Download MNIST: https://github.com/pytorch/ignite/issues/1737