|
| 1 | +name: Test with pip on Windows |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | + # run workflow on changes to the driver, which handles the libraries logic |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + paths: |
| 11 | + - third_party/intel/backend/driver.py |
| 12 | + push: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + paths: |
| 16 | + - third_party/intel/backend/driver.py |
| 17 | + |
| 18 | + schedule: |
| 19 | + - cron: "3 5 * * *" |
| 20 | + |
| 21 | +permissions: read-all |
| 22 | + |
| 23 | +env: |
| 24 | + NEW_WORKSPACE: C:\gh${{ github.run_id }} |
| 25 | + ZE_PATH: C:\level_zero |
| 26 | + PYTEST_MAX_PROCESSES: 8 |
| 27 | + TRITON_TEST_CMD: bash -x scripts/test-triton.sh --skip-pytorch-install --skip-pip-install --skip-list scripts/skiplist/a770 --reports-dir reports --ignore-errors |
| 28 | + |
| 29 | +jobs: |
| 30 | + build: |
| 31 | + name: Build and test |
| 32 | + runs-on: win-a770 |
| 33 | + steps: |
| 34 | + - name: Enable long paths |
| 35 | + run: | |
| 36 | + git config --system core.longPaths true |
| 37 | +
|
| 38 | + - name: Checkout repository |
| 39 | + uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Setup Python |
| 42 | + uses: actions/setup-python@v5 |
| 43 | + with: |
| 44 | + python-version: '3.9' |
| 45 | + |
| 46 | + # Copy workspace to a temporary location with a shorter name. |
| 47 | + - name: Copy workspace |
| 48 | + run: | |
| 49 | + Copy-Item -Path ${{ github.workspace }} -Destination ${{ env.NEW_WORKSPACE }} -Recurse |
| 50 | +
|
| 51 | + - name: Create venv |
| 52 | + run: |
| 53 | + python -m venv .venv |
| 54 | + |
| 55 | + - name: Install PyTorch (wheels) |
| 56 | + run: | |
| 57 | + .venv\Scripts\activate.ps1 |
| 58 | + # The latest wheel does not work, see https://github.com/intel/intel-xpu-backend-for-triton/issues/3177#issuecomment-2599817729 |
| 59 | + # Use the latest good one |
| 60 | + pip install torch==2.7.0.dev20250110+xpu --index-url https://download.pytorch.org/whl/nightly/xpu |
| 61 | +
|
| 62 | + - name: PyTorch version |
| 63 | + run: | |
| 64 | + .venv\Scripts\activate.ps1 |
| 65 | + python -c 'import torch;print(torch.__version__)' |
| 66 | +
|
| 67 | + - name: Clean up Triton cache |
| 68 | + shell: bash |
| 69 | + run: | |
| 70 | + rm -rf ~/.triton/cache |
| 71 | +
|
| 72 | + # We need ninja >= 1.12.0 to support long names on Windows. At the moment there is no required |
| 73 | + # version in pypi, so instead of installing ninja with pip we use a preinstalled 1.12.1 on the |
| 74 | + # runner. |
| 75 | + - name: Setup Triton |
| 76 | + run: | |
| 77 | + .venv\Scripts\activate.ps1 |
| 78 | + Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 |
| 79 | + cd ${{ env.NEW_WORKSPACE }} |
| 80 | + cd python |
| 81 | + pip install -U wheel pybind11 cython cmake 'setuptools>=65.6.1' |
| 82 | + python setup.py -v bdist_wheel |
| 83 | + pip install (Get-Item ${{ env.NEW_WORKSPACE }}\python\dist\*.whl) |
| 84 | +
|
| 85 | + - name: Triton version |
| 86 | + run: | |
| 87 | + .venv\Scripts\activate.ps1 |
| 88 | + python -c 'import triton; print(triton.__version__)' |
| 89 | +
|
| 90 | + - name: Install test dependencies |
| 91 | + run: | |
| 92 | + .venv\Scripts\activate.ps1 |
| 93 | + pip install -r scripts\requirements-test.txt |
| 94 | +
|
| 95 | + - name: Show installed pip packages |
| 96 | + run: | |
| 97 | + .venv\Scripts\activate.ps1 |
| 98 | + pip list -v |
| 99 | +
|
| 100 | + - name: Run core tests |
| 101 | + run: | |
| 102 | + .venv\Scripts\activate.ps1 |
| 103 | + Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 |
| 104 | + ${{ env.TRITON_TEST_CMD }} --core |
| 105 | +
|
| 106 | + - name: Run interpreter tests |
| 107 | + run: | |
| 108 | + .venv\Scripts\activate.ps1 |
| 109 | + Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 |
| 110 | + ${{ env.TRITON_TEST_CMD }} --interpreter |
| 111 | +
|
| 112 | + - name: Pass rate |
| 113 | + run: | |
| 114 | + .venv\Scripts\activate.ps1 |
| 115 | + pip install defusedxml |
| 116 | + bash -c "\ |
| 117 | + source ./scripts/capture-hw-details.sh; \ |
| 118 | + python scripts/pass_rate.py --reports reports ${{ env.SKIPLIST }}; \ |
| 119 | + python scripts/pass_rate.py --reports reports --json ${{ env.SKIPLIST }} > pass_rate.json; \ |
| 120 | + python scripts/pass_rate.py --reports reports --suite tutorials --json ${{ env.SKIPLIST }} > pass_rate_tutorials.json; \ |
| 121 | + " |
| 122 | +
|
| 123 | + - name: Upload pass rate report |
| 124 | + # upload reports only for the default branch |
| 125 | + if: github.ref_name == 'main' |
| 126 | + uses: actions/upload-artifact@v4 |
| 127 | + with: |
| 128 | + name: pass_rate |
| 129 | + path: pass_rate*.json |
| 130 | + |
| 131 | + - name: Clean up workspace |
| 132 | + if: ${{ always() }} |
| 133 | + run: | |
| 134 | + Remove-Item -LiteralPath ${{ env.NEW_WORKSPACE }} -Force -Recurse -ErrorAction Ignore |
| 135 | +
|
| 136 | + - name: Clean up temporary files |
| 137 | + shell: bash |
| 138 | + run: | |
| 139 | + rm -rf rm -rf /tmp/triton-* /tmp/tmp* |
0 commit comments