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