|
| 1 | +name: Pytorch inductor tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + pytorch_ref: |
| 7 | + description: PyTorch ref, keep empty for default |
| 8 | + type: string |
| 9 | + default: "" |
| 10 | + suite: |
| 11 | + description: Space separated lists of test suites, all if empty |
| 12 | + type: string |
| 13 | + default: "" |
| 14 | + runner_label: |
| 15 | + description: Runner label, keep empty for default |
| 16 | + type: string |
| 17 | + default: "" |
| 18 | + python_version: |
| 19 | + description: Python version |
| 20 | + type: string |
| 21 | + default: "3.9" |
| 22 | + pytorch_repo: |
| 23 | + description: PyTorch repo (e.g. user/repo) |
| 24 | + type: string |
| 25 | + default: "pytorch/pytorch" |
| 26 | + |
| 27 | +permissions: read-all |
| 28 | + |
| 29 | +env: |
| 30 | + PYTHON_VERSION: "${{ inputs.python_version }}" |
| 31 | + PYTORCH_REPO: "${{ inputs.pytorch_repo }}" |
| 32 | + |
| 33 | +jobs: |
| 34 | + build: |
| 35 | + name: Test |
| 36 | + runs-on: |
| 37 | + - ${{ inputs.runner_label || 'max1550' }} |
| 38 | + timeout-minutes: 720 |
| 39 | + defaults: |
| 40 | + run: |
| 41 | + shell: bash -noprofile --norc -eo pipefail -c "source /home/runner/intel/oneapi/setvars.sh > /dev/null; source {0}" |
| 42 | + steps: |
| 43 | + - name: Print inputs |
| 44 | + run: | |
| 45 | + cat <<EOF |
| 46 | + ${{ toJSON(inputs) }} |
| 47 | + EOF |
| 48 | +
|
| 49 | + - name: Checkout repository |
| 50 | + uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Load pip cache |
| 53 | + id: pip-cache |
| 54 | + uses: ./.github/actions/load |
| 55 | + with: |
| 56 | + path: $HOME/.cache/pip |
| 57 | + # pip cache per commit id just to minimize network traffic |
| 58 | + key: pip-$PYTHON_VERSION-$GITHUB_SHA |
| 59 | + |
| 60 | + - name: Install Python |
| 61 | + uses: actions/setup-python@v5 |
| 62 | + with: |
| 63 | + python-version: ${{ env.PYTHON_VERSION }} |
| 64 | + |
| 65 | + - name: Setup PyTorch |
| 66 | + uses: ./.github/actions/setup-pytorch |
| 67 | + with: |
| 68 | + repository: ${{ env.PYTORCH_REPO}} |
| 69 | + ref: ${{ inputs.pytorch_ref }} |
| 70 | + |
| 71 | + - name: Setup Triton |
| 72 | + uses: ./.github/actions/setup-triton |
| 73 | + |
| 74 | + - name: Install python test dependencies |
| 75 | + run: | |
| 76 | + pip install pandas scipy tqdm |
| 77 | +
|
| 78 | + - name: Run inductor tests |
| 79 | + run: | |
| 80 | + cd pytorch |
| 81 | + pip install -r .ci/docker/requirements-ci.txt |
| 82 | +
|
| 83 | + export PYTORCH_TESTING_DEVICE_ONLY_FOR="xpu" |
| 84 | +
|
| 85 | + test_cmd="python test/run_test.py --include " |
| 86 | + if [[ -z "${{ github.event.inputs.suite }}" ]]; then |
| 87 | + for test in $(ls test/inductor | grep test); |
| 88 | + do |
| 89 | + test_cmd="${test_cmd} inductor/$test" |
| 90 | + done |
| 91 | + else |
| 92 | + for test in ${{ github.event.inputs.suite }}; |
| 93 | + do |
| 94 | + test_cmd="${test_cmd} $test" |
| 95 | + done |
| 96 | + fi |
| 97 | + eval $test_cmd |
| 98 | +
|
| 99 | + - name: Report environment details |
| 100 | + if: always() |
| 101 | + run: | |
| 102 | + source ./scripts/capture-hw-details.sh --quiet |
| 103 | + TIMESTAMP=$(date '+%Y%m%d%H%M%S') |
| 104 | + mkdir -p pytorch/test/test-reports |
| 105 | + cat <<EOF | tee pytorch/test/test-reports/.env |
| 106 | + TIMESTAMP=$TIMESTAMP |
| 107 | + JOB_NAME=${{ join(matrix.*, '-') }} |
| 108 | + GITHUB_RUN_ID=$GITHUB_RUN_ID |
| 109 | + GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER |
| 110 | + GITHUB_RUN_ATTEMPT=$GITHUB_RUN_ATTEMPT |
| 111 | + PYTHON_VERSION=$PYTHON_VERSION |
| 112 | + PYTORCH_REPO=$PYTORCH_REPO |
| 113 | + PYTORCH_COMMIT_ID=$PYTORCH_COMMIT_ID |
| 114 | + TRITON_REPO=$GITHUB_REPOSITORY |
| 115 | + TRITON_COMMIT_ID=$GITHUB_SHA |
| 116 | + TORCHVISION_COMMIT_ID=$TORCHVISION_COMMIT_ID |
| 117 | + LIBIGC1_VERSION=$LIBIGC1_VERSION |
| 118 | + LEVEL_ZERO_VERSION=$LEVEL_ZERO_VERSION |
| 119 | + GPU_DEVICE=$GPU_DEVICE |
| 120 | + AGAMA_VERSION=$AGAMA_VERSION |
| 121 | + EOF |
| 122 | +
|
| 123 | + - name: Upload test logs |
| 124 | + if: always() |
| 125 | + uses: actions/upload-artifact@v4 |
| 126 | + with: |
| 127 | + name: logs-${{ env.PYTHON_VERSION }} |
| 128 | + path: pytorch/test/test-reports |
| 129 | + include-hidden-files: true |
| 130 | + |
| 131 | + - name: Save pip cache |
| 132 | + if: ${{ steps.pip-cache.outputs.status == 'miss' }} |
| 133 | + uses: ./.github/actions/save |
| 134 | + with: |
| 135 | + path: ${{ steps.pip-cache.outputs.path }} |
| 136 | + dest: ${{ steps.pip-cache.outputs.dest }} |
0 commit comments