From 96189a4fd27e1f306488cb219edc0d29e1f8b6dc Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 13 May 2024 06:02:29 -0400 Subject: [PATCH] ci: speed up Python test (#3776) Reduce installation time from 2.5 min to 1.5 min. ## Summary by CodeRabbit - **Refactor** - Enhanced Python environment setup and package installation processes to improve performance and compatibility. - **Chores** - Updated package management commands to ensure the latest versions of necessary libraries are used. --------- Signed-off-by: Jinzhe Zeng --- .github/workflows/test_python.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 91f1311c20..d83a99e2b1 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -23,23 +23,16 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - uses: mpi4py/setup-mpi@v1 - with: - mpi: openmpi - run: python -m pip install -U uv - - run: uv pip install --system -e .[cpu,test,torch] + - run: uv pip install --system --only-binary=horovod -e .[cpu,test,torch] horovod[tensorflow-cpu] mpi4py mpich env: # Please note that uv has some issues with finding # existing TensorFlow package. Currently, it uses # TensorFlow in the build dependency, but if it # changes, setting `TENSORFLOW_ROOT`. - TENSORFLOW_VERSION: ${{ matrix.tf }} + TENSORFLOW_VERSION: ${{ matrix.python == '3.8' && '2.13.1' || '2.16.1' }} DP_BUILD_TESTING: 1 - - run: uv pip install --system --no-build-isolation horovod mpi4py - env: - HOROVOD_WITH_TENSORFLOW: 1 - HOROVOD_WITHOUT_PYTORCH: 1 - HOROVOD_WITHOUT_GLOO: 1 + UV_EXTRA_INDEX_URL: "https://pypi.anaconda.org/njzjz/simple https://pypi.anaconda.org/mpi4py/simple" - run: dp --version - name: Get durations from cache uses: actions/cache@v4