interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / .github / workflows / ampere-x86.yml

132 lines · 7605 bytes Raw Blame History
1# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2# Native x86 execution of checked Omega-to-C units. Only pinned AArch64
3# compiler/converter provenance runs under QEMU; no driver submission or GPU.
4name: Ampere native x86 host
5on:
6 pull_request:
7 push:
8 branches: [main]
9 workflow_dispatch:
10permissions:
11 contents: read
12jobs:
13 provenance-baseline:
14 runs-on: ubuntu-24.04-arm
15 timeout-minutes: 20
16 steps:
17 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
18 with:
19 persist-credentials: false
20 - name: Source-bootstrap exact baseline on AArch64
21 run: |
22 git clone -q https://github.com/aien-dev/omega-bridge "$RUNNER_TEMP/omega-bridge"
23 git -C "$RUNNER_TEMP/omega-bridge" checkout -q "$(grep -v '^#' om/omega-bridge.lock)"
24 (cd "$RUNNER_TEMP/omega-bridge" && sh tools/bootstrap.sh)
25 cp "$RUNNER_TEMP/omega-bridge/build/bootstrap/omc" "$RUNNER_TEMP/baseline-omc"
26 printf '%s %s\n' 191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 "$RUNNER_TEMP/baseline-omc" | sha256sum --check --strict
27 - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
28 with:
29 name: ampere-baseline-${{ github.sha }}
30 path: ${{ runner.temp }}/baseline-omc
31 retention-days: 7
32 native-x86-host:
33 needs: provenance-baseline
34 runs-on: ubuntu-24.04
35 # make test plus the offline nvdisasm corpus compare. host-x86.yml allows
36 # 60 minutes for the suite alone. 40 cancelled this job during nvdisasm
37 # after the encoder oracle had already accepted the kernels. 60 cancelled the #280 union's
38 # serial make test at target 27 of 186 (gpu_serving_alloc_count_test); the suite now runs -j4.
39 # PROVISIONAL until an exact-head run is measured.
40 timeout-minutes: 240
41 steps:
42 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43 with:
44 persist-credentials: false
45 fetch-depth: 0 # Immutable original blobs are required by portable_receipts.
46 - name: Native scalar numeric portability (no bridge or GPU)
47 run: make test-ampere-numeric-host
48 - name: Pinned offline x86 instruction oracle
49 # Vendor manifest: https://developer.download.nvidia.com/compute/cuda/redist/redistrib_13.0.2.json
50 # cuda_nvdisasm.linux-x86_64, version 13.0.85. Verification only.
51 run: |
52 package=cuda_nvdisasm-linux-x86_64-13.0.85-archive
53 archive="$RUNNER_TEMP/$package.tar.xz"
54 curl --fail --location --silent --show-error --proto '=https' --tlsv1.2 \
55 "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvdisasm/linux-x86_64/$package.tar.xz" \
56 --output "$archive"
57 printf '%s %s\n' 0541e0230f724a43d67288ef882c63351d0c302bf567591b7620d40f93c2c93c "$archive" | sha256sum --check --strict
58 tar -xJf "$archive" -C "$RUNNER_TEMP" "$package/bin/nvdisasm"
59 sudo install -D -m755 "$RUNNER_TEMP/$package/bin/nvdisasm" /usr/local/cuda/bin/nvdisasm
60 /usr/local/cuda/bin/nvdisasm --version
61 printf '%s\n' /usr/local/cuda/bin >> "$GITHUB_PATH"
62 git clone -q https://github.com/aien-dev/omega-bridge "$RUNNER_TEMP/omega-bridge"
63 git -C "$RUNNER_TEMP/omega-bridge" checkout -q "$(grep -v '^#' om/omega-bridge.lock)"
64 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
65 with:
66 name: ampere-baseline-${{ github.sha }}
67 path: ${{ runner.temp }}/baseline
68 - name: EMULATED provenance oracle, NATIVE x86 consumers
69 # Bare ARM compiler/converter/checker executions are required by the
70 # unchanged gate. Register only AArch64 ELF, only on this disposable VM.
71 # QEMU is a verification oracle, never linked into shipped artifacts.
72 env:
73 OMEGA_SEED: ${{ runner.temp }}/baseline/baseline-omc
74 run: |
75 package=qemu-user-static_8.2.2+ds-0ubuntu1.19_amd64.deb
76 curl --fail --location --silent --show-error --proto '=https' --tlsv1.2 \
77 "https://archive.ubuntu.com/ubuntu/pool/universe/q/qemu/$package" \
78 --output "$RUNNER_TEMP/$package"
79 printf '%s %s\n' ec80ee896fe8f57f7420f4d4076164cb0fa613df6848568cdf5d1a2dbe2347cb "$RUNNER_TEMP/$package" | sha256sum --check --strict
80 mkdir -p "$RUNNER_TEMP/qemu"
81 dpkg-deb --fsys-tarfile "$RUNNER_TEMP/$package" | tar -x -C "$RUNNER_TEMP/qemu" \
82 ./usr/bin/qemu-aarch64-static ./usr/lib/binfmt.d/qemu-aarch64.conf
83 printf '%s %s\n' 1152646a17920a81c618d62574ee8ae8b63243349957095d40212c2245f20aab "$RUNNER_TEMP/qemu/usr/bin/qemu-aarch64-static" | sha256sum --check --strict
84 interpreter="$RUNNER_TEMP/qemu/aarch64-binfmt-P"
85 ln -s "$RUNNER_TEMP/qemu/usr/bin/qemu-aarch64-static" "$interpreter"
86 "$RUNNER_TEMP/qemu/usr/bin/qemu-aarch64-static" --version
87 line=$(cat "$RUNNER_TEMP/qemu/usr/lib/binfmt.d/qemu-aarch64.conf")
88 packaged_interpreter=/usr/libexec/qemu-binfmt/aarch64-binfmt-P
89 line=${line/"$packaged_interpreter"/"$interpreter"}
90 printf '%s\n' "${line/:qemu-aarch64:/:cudapp-seed-aarch64:}" | sudo tee /proc/sys/fs/binfmt_misc/register
91 handler=/proc/sys/fs/binfmt_misc/cudapp-seed-aarch64
92 cat "$handler"
93 grep -Fx 'enabled' "$handler"
94 grep -Fx "interpreter $interpreter" "$handler"
95 grep -Fx 'flags: POF' "$handler"
96 grep -Fx 'offset 0' "$handler"
97 grep -Fx 'magic 7f454c460201010000000000000000000200b700' "$handler"
98 grep -Fx 'mask ffffffffffffff00fffffffffffffffffeffffff' "$handler"
99 printf '%s %s\n' 191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 "$OMEGA_SEED" | sha256sum --check --strict
100 chmod +x "$OMEGA_SEED"
101 git clone -q https://github.com/aien-dev/omega-mv "$RUNNER_TEMP/omega-mv"
102 git -C "$RUNNER_TEMP/omega-mv" checkout -q e5b32567a7aff3ce594e3254a622a846a6cd190b
103 printf '%s %s\n' 2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f "$RUNNER_TEMP/omega-mv/seed/out/omc" | sha256sum --check --strict
104 (cd "$RUNNER_TEMP/omega-bridge" && sh tools/build.sh)
105 {
106 echo "OMEGA_SEED=$OMEGA_SEED"
107 echo "OMEGA_OMC=$RUNNER_TEMP/omega-mv/seed/out/omc"
108 echo "OMEGA_MV=$RUNNER_TEMP/omega-mv"
109 echo "OMEGA_BRIDGE=$RUNNER_TEMP/omega-bridge"
110 echo "OMEGA_BRIDGE_DIR=$RUNNER_TEMP/omega-bridge"
111 } >> "$GITHUB_ENV"
112 - name: Native host build and tests (no GPU)
113 env:
114 OMEGA_BRIDGE: ${{ runner.temp }}/omega-bridge
115 run: |
116 make -j2 all
117 test "$(uname -m)" = x86_64
118 make build/test_codegen_hosted build/test_codegen_freestanding build/ampere-cubin/f16-host
119 for consumer in build/test_codegen_hosted build/test_codegen_freestanding build/ampere-cubin/f16-host; do
120 LC_ALL=C readelf -h "$consumer" | grep -F 'Advanced Micro Devices X86-64'
121 done
122 make -j4 test
123 make test-native-artifact zero-cuda-gate test-ampere-cubin-disasm
124 make OUT_DIR=build-ampere-oracle CUDAPP_AMPERE_CORPUS=1 test-ampere-encoder-oracle
125 - name: Remove only this run's ARM provenance handler
126 if: always()
127 run: |
128 handler=/proc/sys/fs/binfmt_misc/cudapp-seed-aarch64
129 if test -e "$handler"; then
130 printf '%s\n' -1 | sudo tee "$handler"
131 test ! -e "$handler"
132 fi