Upgrade rocm test environment to 7.14 #765
This file contains hidden or 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
| name: "Pre-review Tests" | |
| on: [push, pull_request] | |
| jobs: | |
| static-checks: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # Checkout using commit hash to make "no-commit-to-branch" test pass. | |
| ref: ${{ github.sha }} | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| id: setup-python | |
| with: | |
| python-version: '3.10' | |
| - name: Setup cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache | |
| key: | |
| static-checks-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| restore-keys: | |
| static-checks- | |
| - name: Setup pre-commit | |
| run: | | |
| pip install pre-commit | |
| - name: Check | |
| run: | | |
| pre-commit run -a --show-diff-on-failure | |
| - name: Type Check | |
| run: | | |
| # TODO: Test against various NumPy/SciPy versions. | |
| pip install 'numpy==2.0.*' 'scipy==1.14.*' | |
| pip install 'mypy==1.5.*' 'types-setuptools==57.4.14' 'pytest>=7.2' | |
| sed -i s/error::cupy.exceptions./error::numpy.exceptions./ pyproject.toml # Because no cupy here. See cupy#8346 | |
| pytest -v tests/typing_tests/test_typing.py | |
| build-cuda: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| CUPY_CI: GitHub | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Setup cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache | |
| key: build-cuda-${{ github.sha }} | |
| restore-keys: | | |
| build-cuda-${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} | |
| build-cuda- | |
| - name: Setup ccache | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y ccache | |
| echo "PATH=/usr/lib/ccache:${PATH}" >> "${GITHUB_ENV}" | |
| ccache --show-stats -v | |
| - name: Build | |
| run: | | |
| pip install -U pip wheel setuptools | |
| READTHEDOCS=True pip install -v -e . | |
| ccache --max-size 0.5Gi --cleanup --show-stats | |
| - name: Try to check for `noexcept` functions that may raise errors | |
| # We ignore __dealloc__ or the pycapsule_deleter as it is hard to avoid there. | |
| # Cython does give a warning with all warnings enabled (but those are many). | |
| run: | | |
| result=$(grep -r 'Pyx_WriteUnraisable' --include='*.cpp' . \ | |
| | grep -v -E \ | |
| '(__dealloc__|const char \*name|pycapsule_deleter|cupy\.cuda\.thrust\.cupy_malloc|\._streamCallbackFunc|\._HostFnFunc)' \ | |
| || true) | |
| if [ -n "$result" ]; then | |
| echo "$result" | |
| echo "Found possibly bad functions (see above). If this check fails a function" | |
| echo "could (theoretically) raise an error but is marked as noexcept." | |
| exit 1 | |
| fi | |
| - name: Docs Build | |
| run: | | |
| # Test to detect invalid escape sequences in docstrings (#1619) | |
| python -Werror::DeprecationWarning -m compileall -f -q cupy cupyx examples tests docs | |
| pushd docs | |
| pip install -r requirements.txt | |
| SPHINXOPTS="-W --keep-going -j 4" make html | |
| popd | |
| - name: Import Test | |
| run: | | |
| unset CUPY_CI | |
| python -c 'import cupy, cupyx' | |
| build-rocm: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Build & Test | |
| run: | | |
| # Note: "-complete" Docker image variants exceeds disk size on GitHub hosted runners. | |
| docker run --rm -v "${PWD}:/src" -w /src "rocm/dev-ubuntu-22.04:7.14.0-full" bash .github/workflows/scripts/pretest-rocm-test.sh |