name: wai-quantum CPU vector units # The fabric's CPU vector-unit members: the gate's fixed-point arithmetic in # the processor's own vector extension, certified bit-exact against the CPU # reference's pinned corpus digests. # # - avx2 on silicon: the x86-64 processor of whichever `linux` runner takes # the leg. jetson-hub's has avx2 alone; framework-128gb-linux's has avx512 # too, and there the leg declares both, as the kernel reports them, and # checks the avx2 member as on any other; # - avx2 and avx512 on silicon together: framework-128gb's processor, which has # both, one member each; # - sve and rvv under a user-mode emulator the job fetches and runs itself # (Debian's static QEMU, pinned), never the host's binfmt handler, at # several vector lengths each: the scalable kernels set their length per # pass, and every leg checks the length the member read from the unit is the # one the emulator was given, so a leg cannot pass at the wrong length; # - the macOS runner, whose processor has no vector extension these kernels # use outside streaming mode, finding no member. # # Silicon for sve and rvv: a processor with them runs the same tests with no # emulator declared. concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }} cancel-in-progress: true on: pull_request: paths: - 'wai/wai-quantum/**' - 'rust-toolchain.toml' - '.github/workflows/wai-quantum-vector.yml' schedule: - cron: '53 6 * * *' jobs: # Does this pull request's own diff touch the paths below? This forge matches a # workflow's `paths:` against the push, so a merge of main into a branch fires the # workflow whatever the pull request changes; every job here waits on this answer. # A push to main, a schedule, or anything the script cannot determine answers # `true` (scripts/pr-touches-paths.py). relevant: name: does this change touch it runs-on: gate outputs: run: ${{ steps.gate.outputs.run }} steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - id: gate run: | set -euo pipefail r=$(python3 scripts/pr-touches-paths.py .github/workflows/wai-quantum-vector.yml \ "${{ github.event.pull_request.base.sha }}" \ "${{ github.event.pull_request.head.sha }}") echo "this change touches wai-quantum-vector: $r" echo "run=$r" >> "$GITHUB_OUTPUT" vector: name: member · vector unit, ${{ matrix.name }} needs: relevant if: needs.relevant.outputs.run == 'true' runs-on: linux timeout-minutes: 120 strategy: fail-fast: false max-parallel: 1 matrix: include: - name: avx2 (x86_64 silicon) target: x86_64-unknown-linux-gnu image: ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:7f8308a8734d9fcd2ebbe9a3e4bdea74af293f0799d80c3cc341e340cda49a4c key: cpu-vector-avx2 bits: 256 emulator: '' qemu: '' qemu_cpu: '' - name: sve 128-bit (aarch64, emulated) target: aarch64-unknown-linux-gnu image: ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:7f8308a8734d9fcd2ebbe9a3e4bdea74af293f0799d80c3cc341e340cda49a4c key: cpu-vector-sve bits: 128 emulator: qemu-user 10.0.13 (Debian's static build, run by the job) qemu: aarch64 qemu_cpu: max,sve-default-vector-length=16 - name: sve 512-bit (aarch64, emulated) target: aarch64-unknown-linux-gnu image: ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:7f8308a8734d9fcd2ebbe9a3e4bdea74af293f0799d80c3cc341e340cda49a4c key: cpu-vector-sve bits: 512 emulator: qemu-user 10.0.13 (Debian's static build, run by the job) qemu: aarch64 qemu_cpu: max,sve-default-vector-length=64 - name: sve 2048-bit (aarch64, emulated) target: aarch64-unknown-linux-gnu image: ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:7f8308a8734d9fcd2ebbe9a3e4bdea74af293f0799d80c3cc341e340cda49a4c key: cpu-vector-sve bits: 2048 emulator: qemu-user 10.0.13 (Debian's static build, run by the job) qemu: aarch64 qemu_cpu: max,sve-default-vector-length=256 - name: rvv 128-bit (riscv64, emulated) target: riscv64gc-unknown-linux-gnu image: ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu@sha256:67ee97dd4719390d299edfcf39f226360ccfb1539e08b078ec187d4848415794 key: cpu-vector-rvv bits: 128 emulator: qemu-user 10.0.13 (Debian's static build, run by the job) qemu: riscv64 qemu_cpu: rv64,v=true,vlen=128,elen=64 - name: rvv 1024-bit (riscv64, emulated) target: riscv64gc-unknown-linux-gnu image: ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu@sha256:67ee97dd4719390d299edfcf39f226360ccfb1539e08b078ec187d4848415794 key: cpu-vector-rvv bits: 1024 emulator: qemu-user 10.0.13 (Debian's static build, run by the job) qemu: riscv64 qemu_cpu: rv64,v=true,vlen=1024,elen=64 container: image: ${{ matrix.image }} options: --memory=6g --memory-swap=6g env: WAI_QUANTUM_VECTOR_EXPECT: ${{ matrix.key }} WAI_QUANTUM_VECTOR_EMULATOR: ${{ matrix.emulator }} # The emulator every foreign test binary runs under: Debian's static QEMU, # SHA-256 pinned, fetched by the job and named as cargo's runner. Not the # image's own (5.1 for aarch64, 6.1 for riscv64), and not the host's binfmt # handler, which some `linux` runners lack and others run at another # version. (Not QEMU_*: qemu-user reads every QEMU_