diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 0e05dca3086..ac2857cc226 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -46,6 +46,8 @@ jobs: test: runs-on: ${{ matrix.os }} timeout-minutes: 60 + env: + TORCH_HOME: ${{ github.workspace }}/.torch # cache root for hub/checkpoints strategy: fail-fast: false matrix: @@ -110,15 +112,6 @@ jobs: requests \ pandas \ unittest-parallel \ - torchvision \ - transformers \ - opencv-python \ - torch \ - librosa \ - h5py \ - gensim \ - opt-einsum \ - nltk - name: Build Python Package run: | @@ -150,9 +143,29 @@ jobs: cd src/main/python ./tests/federated/runFedTest.sh + - name: Cache Torch Hub + if: ${{ matrix.test_mode == 'scuro' }} + id: torch-cache + uses: actions/cache@v4 + with: + path: .torch + key: ${{ runner.os }}-torch-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-torch- + - name: Run Scuro Python Tests if: ${{ matrix.test_mode == 'scuro' }} run: | + pip install \ + torchvision \ + transformers \ + opencv-python \ + torch \ + librosa \ + h5py \ + gensim \ + opt-einsum \ + nltk cd src/main/python python -m unittest discover -s tests/scuro -p 'test_*.py' diff --git a/src/main/python/systemds/utils/helpers.py b/src/main/python/systemds/utils/helpers.py index 887b3140ebd..8fa6e81069a 100644 --- a/src/main/python/systemds/utils/helpers.py +++ b/src/main/python/systemds/utils/helpers.py @@ -23,7 +23,6 @@ from importlib.util import find_spec from itertools import chain from typing import Dict, Iterable -import torch from systemds.utils.consts import MODULE_NAME