Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 1 | # Copyright 2024 The IREE Authors |
| 2 | # |
| 3 | # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| 4 | # See https://llvm.org/LICENSE.txt for license information. |
| 5 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | |
| 7 | name: PkgCI Test ONNX |
| 8 | on: |
| 9 | workflow_call: |
| 10 | inputs: |
| 11 | artifact_run_id: |
| 12 | type: string |
| 13 | default: "" |
| 14 | workflow_dispatch: |
| 15 | inputs: |
| 16 | artifact_run_id: |
| 17 | type: string |
| 18 | default: "" |
| 19 | |
| 20 | jobs: |
| 21 | test_onnx_ops: |
Scott Todd | 8e54ed5 | 2024-10-16 17:50:05 -0700 | [diff] [blame] | 22 | name: "test_onnx_ops :: ${{ matrix.name }}" |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 23 | runs-on: ${{ matrix.runs-on }} |
| 24 | strategy: |
| 25 | fail-fast: false |
| 26 | matrix: |
| 27 | include: |
| 28 | # CPU |
| 29 | - name: cpu_llvm_sync |
| 30 | config-file: onnx_ops_cpu_llvm_sync.json |
| 31 | numprocesses: auto |
| 32 | runs-on: ubuntu-20.04 |
| 33 | |
| 34 | # AMD GPU |
| 35 | - name: amdgpu_rocm_rdna3 |
| 36 | numprocesses: 1 |
| 37 | config-file: onnx_ops_gpu_rocm_rdna3.json |
| 38 | runs-on: nodai-amdgpu-w7900-x86-64 |
| 39 | - name: amdgpu_vulkan |
| 40 | numprocesses: 4 |
| 41 | config-file: onnx_ops_gpu_vulkan.json |
| 42 | runs-on: nodai-amdgpu-w7900-x86-64 |
| 43 | |
| 44 | # NVIDIA GPU |
Scott Todd | 5612307 | 2024-09-16 08:22:31 -0700 | [diff] [blame] | 45 | # TODO(#18238): migrate to new runner cluster |
| 46 | # - name: nvidiagpu_cuda |
| 47 | # config-file: onnx_ops_gpu_cuda.json |
| 48 | # numprocesses: 4 |
| 49 | # runs-on: |
| 50 | # - self-hosted # must come first |
| 51 | # - runner-group=${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }} |
| 52 | # - environment=prod |
| 53 | # - gpu # TODO(scotttodd): qualify further with vendor/model |
| 54 | # - os-family=Linux |
| 55 | # - name: nvidiagpu_vulkan |
| 56 | # config-file: onnx_ops_gpu_vulkan.json |
| 57 | # numprocesses: 4 |
| 58 | # runs-on: |
| 59 | # - self-hosted # must come first |
| 60 | # - runner-group=${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }} |
| 61 | # - environment=prod |
| 62 | # - gpu # TODO(scotttodd): qualify further with vendor/model |
| 63 | # - os-family=Linux |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 64 | env: |
| 65 | PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages |
| 66 | CONFIG_FILE_PATH: tests/external/iree-test-suites/onnx_ops/${{ matrix.config-file }} |
| 67 | NUMPROCESSES: ${{ matrix.numprocesses }} |
| 68 | LOG_FILE_PATH: /tmp/test_onnx_ops_${{ matrix.name }}_logs.json |
| 69 | VENV_DIR: ${{ github.workspace }}/venv |
| 70 | steps: |
| 71 | - name: Checking out IREE repository |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 72 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 73 | with: |
| 74 | submodules: false |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 75 | - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0 |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 76 | with: |
| 77 | # Must match the subset of versions built in pkgci_build_packages. |
| 78 | python-version: "3.11" |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 79 | - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 80 | with: |
| 81 | name: linux_x86_64_release_packages |
| 82 | path: ${{ env.PACKAGE_DOWNLOAD_DIR }} |
| 83 | - name: Setup venv |
| 84 | run: | |
| 85 | ./build_tools/pkgci/setup_venv.py ${VENV_DIR} \ |
| 86 | --artifact-path=${PACKAGE_DOWNLOAD_DIR} \ |
| 87 | --fetch-gh-workflow=${{ inputs.artifact_run_id }} |
| 88 | |
| 89 | - name: Checkout test suites repository |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 90 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 91 | with: |
| 92 | repository: iree-org/iree-test-suites |
Scott Todd | 8e54ed5 | 2024-10-16 17:50:05 -0700 | [diff] [blame] | 93 | ref: 3a0ea13cbdc954365d653a48cc99cc63a9ff09b3 |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 94 | path: iree-test-suites |
| 95 | - name: Install ONNX ops test suite requirements |
| 96 | run: | |
| 97 | source ${VENV_DIR}/bin/activate |
| 98 | python -m pip install -r iree-test-suites/onnx_ops/requirements.txt |
| 99 | - name: Run ONNX ops test suite |
| 100 | run: | |
| 101 | source ${VENV_DIR}/bin/activate |
| 102 | pytest iree-test-suites/onnx_ops/ \ |
| 103 | -rpfE \ |
| 104 | --numprocesses ${NUMPROCESSES} \ |
| 105 | --timeout=30 \ |
| 106 | --durations=20 \ |
| 107 | --config-files=${CONFIG_FILE_PATH} \ |
| 108 | --report-log=${LOG_FILE_PATH} |
| 109 | - name: "Updating config file with latest XFAIL lists" |
| 110 | if: failure() |
| 111 | run: | |
| 112 | source ${VENV_DIR}/bin/activate |
| 113 | python iree-test-suites/onnx_ops/update_config_xfails.py \ |
| 114 | --log-file=${LOG_FILE_PATH} \ |
| 115 | --config-file=${CONFIG_FILE_PATH} |
| 116 | cat ${CONFIG_FILE_PATH} |
| 117 | - name: "Uploading new config file" |
| 118 | if: failure() |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 119 | uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 |
Scott Todd | 854a13e | 2024-09-04 09:08:42 -0700 | [diff] [blame] | 120 | with: |
| 121 | name: ${{ matrix.config-file }} |
| 122 | path: ${{ env.CONFIG_FILE_PATH }} |
Scott Todd | 8e54ed5 | 2024-10-16 17:50:05 -0700 | [diff] [blame] | 123 | |
| 124 | test_onnx_models: |
| 125 | name: "test_onnx_models :: ${{ matrix.name }}" |
| 126 | runs-on: ${{ matrix.runs-on }} |
| 127 | strategy: |
| 128 | fail-fast: false |
| 129 | matrix: |
| 130 | include: |
| 131 | # CPU |
| 132 | - name: cpu_llvm_task |
| 133 | runs-on: ubuntu-20.04 |
| 134 | |
| 135 | # TODO(scotttodd): test other backends (parameterize the test suite) |
| 136 | env: |
| 137 | VENV_DIR: ${{ github.workspace }}/venv |
| 138 | steps: |
| 139 | - name: Checking out IREE repository |
| 140 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 141 | with: |
| 142 | submodules: false |
| 143 | - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0 |
| 144 | with: |
| 145 | # Must match the subset of versions built in pkgci_build_packages. |
| 146 | python-version: "3.11" |
| 147 | - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| 148 | with: |
| 149 | name: linux_x86_64_release_packages |
| 150 | path: ${{ env.PACKAGE_DOWNLOAD_DIR }} |
| 151 | - name: Setup venv |
| 152 | run: | |
| 153 | ./build_tools/pkgci/setup_venv.py ${VENV_DIR} \ |
| 154 | --artifact-path=${PACKAGE_DOWNLOAD_DIR} \ |
| 155 | --fetch-gh-workflow=${{ inputs.artifact_run_id }} |
| 156 | |
| 157 | - name: Checkout test suites repository |
| 158 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 159 | with: |
| 160 | repository: iree-org/iree-test-suites |
| 161 | ref: 3a0ea13cbdc954365d653a48cc99cc63a9ff09b3 |
| 162 | path: iree-test-suites |
| 163 | - name: Install ONNX models test suite requirements |
| 164 | run: | |
| 165 | source ${VENV_DIR}/bin/activate |
| 166 | python -m pip install -r iree-test-suites/onnx_models/requirements.txt |
| 167 | - name: Run ONNX models test suite |
| 168 | run: | |
| 169 | source ${VENV_DIR}/bin/activate |
| 170 | pytest iree-test-suites/onnx_models/ \ |
| 171 | -rA \ |
| 172 | --log-cli-level=info \ |
| 173 | --override-ini=xfail_strict=false \ |
| 174 | --timeout=120 \ |
| 175 | --durations=0 |