|
| 1 | +name: Test Backend |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + backend: |
| 7 | + description: 'Backend to test (xnnpack, coreml, vulkan, qnn)' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + flows: |
| 11 | + description: 'JSON array of flows to test' |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + ref: |
| 15 | + description: 'Git ref to checkout' |
| 16 | + required: false |
| 17 | + type: string |
| 18 | + default: ${{ github.sha }} |
| 19 | + timeout: |
| 20 | + description: 'Job timeout in minutes' |
| 21 | + required: false |
| 22 | + type: number |
| 23 | + default: 120 |
| 24 | + run-linux: |
| 25 | + description: 'Whether to run Linux tests' |
| 26 | + required: false |
| 27 | + type: boolean |
| 28 | + default: false |
| 29 | + run-macos: |
| 30 | + description: 'Whether to run macOS tests' |
| 31 | + required: false |
| 32 | + type: boolean |
| 33 | + default: false |
| 34 | + runner-linux: |
| 35 | + description: 'Runner type for Linux jobs' |
| 36 | + required: false |
| 37 | + type: string |
| 38 | + default: linux.4xlarge.memory |
| 39 | + |
| 40 | +jobs: |
| 41 | + test-backend-linux: |
| 42 | + if: ${{ inputs.run-linux }} |
| 43 | + strategy: |
| 44 | + fail-fast: false |
| 45 | + matrix: |
| 46 | + flow: ${{ fromJSON(inputs.flows) }} |
| 47 | + suite: [models, operators] |
| 48 | + |
| 49 | + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main |
| 50 | + with: |
| 51 | + ref: ${{ inputs.ref }} |
| 52 | + runner: ${{ inputs.runner-linux }} |
| 53 | + docker-image: ci-image:executorch-ubuntu-22.04-clang12 |
| 54 | + submodules: recursive |
| 55 | + timeout: ${{ inputs.timeout }} |
| 56 | + upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }} |
| 57 | + script: | |
| 58 | + set -eux |
| 59 | +
|
| 60 | + source .ci/scripts/test_backend_linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}" |
| 61 | +
|
| 62 | + test-backend-macos: |
| 63 | + if: ${{ inputs.run-macos }} |
| 64 | + strategy: |
| 65 | + fail-fast: false |
| 66 | + matrix: |
| 67 | + flow: ${{ fromJSON(inputs.flows) }} |
| 68 | + suite: [models, operators] |
| 69 | + |
| 70 | + uses: pytorch/test-infra/.github/workflows/macos_job.yml@main |
| 71 | + with: |
| 72 | + ref: ${{ inputs.ref }} |
| 73 | + runner: macos-m1-stable |
| 74 | + python-version: "3.12" |
| 75 | + submodules: recursive |
| 76 | + timeout: ${{ inputs.timeout }} |
| 77 | + upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }} |
| 78 | + script: | |
| 79 | + set -eux |
| 80 | +
|
| 81 | + # This is needed to get the prebuilt PyTorch wheel from S3 |
| 82 | + ${CONDA_RUN} --no-capture-output pip install awscli==1.37.21 |
| 83 | +
|
| 84 | + source .ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}" |
0 commit comments