|
| 1 | +name: Test oneMKL interfaces |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +permissions: read-all |
| 10 | + |
| 11 | +env: |
| 12 | + CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels' |
| 13 | + TEST_ENV_NAME: 'test_onemkl_interfaces' |
| 14 | + RERUN_TESTS_ON_FAILURE: 'true' |
| 15 | + RUN_TESTS_MAX_ATTEMPTS: 2 |
| 16 | + BUILD_DEP_PKGS: >- |
| 17 | + mkl-devel-dpcpp |
| 18 | + tbb-devel |
| 19 | + dpctl |
| 20 | + onedpl-devel |
| 21 | + setuptools |
| 22 | + python |
| 23 | + numpy">=2.0" |
| 24 | + cython |
| 25 | + cmake |
| 26 | + ninja |
| 27 | + scikit-build |
| 28 | +
|
| 29 | +jobs: |
| 30 | + test_by_tag: |
| 31 | + name: Run on ['${{ matrix.os }}', python='${{ matrix.python }}'] with oneMKL tag |
| 32 | + |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + python: ['3.12'] |
| 36 | + os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL |
| 37 | + |
| 38 | + permissions: |
| 39 | + # Needed to cancel any previous runs that are not completed for a given workflow |
| 40 | + actions: write |
| 41 | + |
| 42 | + runs-on: ${{ matrix.os }} |
| 43 | + |
| 44 | + defaults: |
| 45 | + run: |
| 46 | + shell: ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }} |
| 47 | + |
| 48 | + continue-on-error: false |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Cancel Previous Runs |
| 52 | + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 |
| 53 | + with: |
| 54 | + access_token: ${{ github.token }} |
| 55 | + |
| 56 | + - name: Checkout DPNP repo |
| 57 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 58 | + with: |
| 59 | + fetch-depth: 0 |
| 60 | + |
| 61 | + - name: Setup miniconda |
| 62 | + uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 |
| 63 | + with: |
| 64 | + miniforge-version: latest |
| 65 | + use-mamba: 'true' |
| 66 | + channels: conda-forge |
| 67 | + conda-remove-defaults: 'true' |
| 68 | + python-version: ${{ matrix.python }} |
| 69 | + activate-environment: ${{ env.TEST_ENV_NAME }} |
| 70 | + |
| 71 | + # Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba |
| 72 | + - name: Disable speed limit check in mamba |
| 73 | + run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV |
| 74 | + |
| 75 | + - name: Install dpnp build dependencies |
| 76 | + run: | |
| 77 | + mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }} |
| 78 | + env: |
| 79 | + DPCPP_PKG: ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }} |
| 80 | + |
| 81 | + - name: Conda info |
| 82 | + run: | |
| 83 | + mamba info |
| 84 | + mamba list |
| 85 | +
|
| 86 | + - name: Build and install DPNP package |
| 87 | + run: | |
| 88 | + python scripts/build_locally.py --onemkl-interfaces --verbose |
| 89 | +
|
| 90 | + - name: Smoke test |
| 91 | + run: | |
| 92 | + python -m dpctl -f |
| 93 | + python -c "import dpnp; print(dpnp.__version__)" |
| 94 | +
|
| 95 | + - name: Install pytest |
| 96 | + run: | |
| 97 | + mamba install pytest ${{ env.CHANNELS }} |
| 98 | +
|
| 99 | + - name: Run tests |
| 100 | + if: env.RERUN_TESTS_ON_FAILURE != 'true' |
| 101 | + run: | |
| 102 | + python -m pytest -ra --pyargs dpnp.tests |
| 103 | + env: |
| 104 | + SYCL_CACHE_PERSISTENT: 1 |
| 105 | + |
| 106 | + - name: ReRun tests on Linux |
| 107 | + if: env.RERUN_TESTS_ON_FAILURE == 'true' |
| 108 | + id: run_tests |
| 109 | + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 |
| 110 | + with: |
| 111 | + timeout_minutes: 10 |
| 112 | + max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }} |
| 113 | + retry_on: any |
| 114 | + command: | |
| 115 | + . $CONDA/etc/profile.d/conda.sh |
| 116 | + . $CONDA/etc/profile.d/mamba.sh |
| 117 | + mamba activate ${{ env.TEST_ENV_NAME }} |
| 118 | +
|
| 119 | + python -m pytest -ra --pyargs dpnp.tests |
| 120 | + env: |
| 121 | + SYCL_CACHE_PERSISTENT: 1 |
| 122 | + |
| 123 | + test_by_branch: |
| 124 | + name: Run on ['${{ matrix.os }}', python='${{ matrix.python }}'] with oneMKL develop branch |
| 125 | + |
| 126 | + strategy: |
| 127 | + matrix: |
| 128 | + python: ['3.12'] |
| 129 | + os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL |
| 130 | + |
| 131 | + permissions: |
| 132 | + # Needed to cancel any previous runs that are not completed for a given workflow |
| 133 | + actions: write |
| 134 | + |
| 135 | + runs-on: ${{ matrix.os }} |
| 136 | + |
| 137 | + defaults: |
| 138 | + run: |
| 139 | + shell: ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }} |
| 140 | + |
| 141 | + continue-on-error: true |
| 142 | + |
| 143 | + env: |
| 144 | + onemkl-source-dir: '${{ github.workspace }}/onemkl/' |
| 145 | + |
| 146 | + steps: |
| 147 | + - name: Cancel Previous Runs |
| 148 | + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 |
| 149 | + with: |
| 150 | + access_token: ${{ github.token }} |
| 151 | + |
| 152 | + - name: Checkout DPNP repo |
| 153 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 154 | + with: |
| 155 | + fetch-depth: 0 |
| 156 | + |
| 157 | + - name: Checkout oneMKL repo |
| 158 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 159 | + with: |
| 160 | + repository: 'oneapi-src/oneMKL' |
| 161 | + ref: 'develop' |
| 162 | + path: ${{ env.onemkl-source-dir }} |
| 163 | + fetch-depth: 0 |
| 164 | + |
| 165 | + - name: oneMKL ls info |
| 166 | + run: | |
| 167 | + ls -la ${{ env.onemkl-source-dir }} |
| 168 | +
|
| 169 | + - name: Setup miniconda |
| 170 | + uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 |
| 171 | + with: |
| 172 | + miniforge-version: latest |
| 173 | + use-mamba: 'true' |
| 174 | + channels: conda-forge |
| 175 | + conda-remove-defaults: 'true' |
| 176 | + python-version: ${{ matrix.python }} |
| 177 | + activate-environment: ${{ env.TEST_ENV_NAME }} |
| 178 | + |
| 179 | + # Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba |
| 180 | + - name: Disable speed limit check in mamba |
| 181 | + run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV |
| 182 | + |
| 183 | + - name: Install dpnp build dependencies |
| 184 | + run: | |
| 185 | + mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }} |
| 186 | + env: |
| 187 | + DPCPP_PKG: ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }} |
| 188 | + |
| 189 | + - name: Conda info |
| 190 | + run: | |
| 191 | + mamba info |
| 192 | + mamba list |
| 193 | +
|
| 194 | + - name: Build and install DPNP package |
| 195 | + run: | |
| 196 | + python scripts/build_locally.py --onemkl-interfaces --onemkl-interfaces-dir=${{ env.onemkl-source-dir }} --verbose |
| 197 | +
|
| 198 | + - name: Smoke test |
| 199 | + run: | |
| 200 | + python -m dpctl -f |
| 201 | + python -c "import dpnp; print(dpnp.__version__)" |
| 202 | +
|
| 203 | + - name: Install pytest |
| 204 | + run: | |
| 205 | + mamba install pytest ${{ env.CHANNELS }} |
| 206 | +
|
| 207 | + - name: Run tests |
| 208 | + if: env.RERUN_TESTS_ON_FAILURE != 'true' |
| 209 | + run: | |
| 210 | + python -m pytest -ra --pyargs dpnp.tests |
| 211 | + env: |
| 212 | + SYCL_CACHE_PERSISTENT: 1 |
| 213 | + |
| 214 | + - name: ReRun tests on Linux |
| 215 | + if: env.RERUN_TESTS_ON_FAILURE == 'true' |
| 216 | + id: run_tests |
| 217 | + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 |
| 218 | + with: |
| 219 | + timeout_minutes: 10 |
| 220 | + max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }} |
| 221 | + retry_on: any |
| 222 | + command: | |
| 223 | + . $CONDA/etc/profile.d/conda.sh |
| 224 | + . $CONDA/etc/profile.d/mamba.sh |
| 225 | + mamba activate ${{ env.TEST_ENV_NAME }} |
| 226 | +
|
| 227 | + python -m pytest -ra --pyargs dpnp.tests |
| 228 | + env: |
| 229 | + SYCL_CACHE_PERSISTENT: 1 |
0 commit comments