viz: remove hardcoded strings in cfg tests (#14462) #533
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Autogen | |
| env: | |
| # increment this when downloads substantially change to avoid the internet | |
| CACHE_VERSION: '13' | |
| CAPTURE_PROCESS_REPLAY: 1 | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PYTHONPATH: ${{ github.workspace }} | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| paths: | |
| - 'tinygrad/runtime/autogen/**/*' | |
| - 'tinygrad/runtime/support/autogen.py' | |
| - '.github/workflows/autogen.yml' | |
| workflow_dispatch: | |
| paths: | |
| - 'tinygrad/runtime/autogen/**/*' | |
| - 'tinygrad/runtime/support/autogen.py' | |
| - '.github/workflows/autogen.yml' | |
| jobs: | |
| autogen: | |
| name: In-tree Autogen | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-tinygrad | |
| with: | |
| opencl: 'true' | |
| amd: 'true' | |
| cuda: 'true' | |
| llvm: 'true' | |
| webgpu: 'true' | |
| mesa: 'true' | |
| pydeps: 'pyyaml mako' | |
| - name: Install autogen support packages | |
| run: sudo apt-get install -y --no-install-recommends libclang-20-dev llvm-20-dev hip-dev libusb-1.0-0-dev libdrm-dev | |
| - name: Regenerate autogen files | |
| run: | | |
| find tinygrad/runtime/autogen -type f -name "*.py" -not -name "__init__.py" -not -name "comgr_3.py" -not -name "metal.py" -not -name "iokit.py" -not -name "corefoundation.py" -not -name "libclang.py" -delete | |
| python3 -c "from tinygrad.runtime.autogen import opencl" | |
| python3 -c "from tinygrad.runtime.autogen import cuda, nvrtc, nvjitlink, nv_570, nv_580, nv" | |
| python3 -c "from tinygrad.runtime.autogen import comgr, hsa, hip, amd_gpu, sqtt, rocprof, amdgpu_kd, amdgpu_drm" | |
| python3 -c "from tinygrad.runtime.autogen.am import am, pm4_soc15, pm4_nv, sdma_4_0_0, sdma_5_0_0, sdma_6_0_0, smu_v13_0_0, smu_v13_0_6, smu_v14_0_2" | |
| python3 -c "from tinygrad.runtime.autogen import libc, kfd, io_uring, ib, pci, vfio" | |
| python3 -c "from tinygrad.runtime.autogen import llvm" | |
| python3 -c "from tinygrad.runtime.autogen import webgpu" | |
| python3 -c "from tinygrad.runtime.autogen import kgsl, qcom_dsp" | |
| python3 -c "from tinygrad.runtime.autogen import libusb" | |
| python3 -c "from tinygrad.runtime.autogen import mesa" | |
| python3 -c "from tinygrad.runtime.autogen import avcodec" | |
| REGEN=1 python3 -c "from tinygrad.runtime.autogen import libclang" | |
| - name: Check for differences | |
| run: | | |
| if ! git diff --quiet; then | |
| git diff > autogen-ubuntu.patch | |
| echo "Autogen files out of date. Apply patch from: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts" | |
| exit 1 | |
| fi | |
| - name: Upload patch artifact | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: autogen-ubuntu-patch | |
| path: autogen-ubuntu.patch | |
| autogen-mac: | |
| name: In-tree Autogen (macos) | |
| runs-on: macos-14 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-tinygrad | |
| with: | |
| llvm: 'true' | |
| - name: Regenerate autogen files | |
| run: | | |
| rm tinygrad/runtime/autogen/metal.py tinygrad/runtime/autogen/iokit.py tinygrad/runtime/autogen/corefoundation.py | |
| python3 -c "from tinygrad.runtime.autogen import metal, iokit, corefoundation" | |
| - name: Check for differences | |
| run: | | |
| if ! git diff --quiet; then | |
| git diff > autogen-macos.patch | |
| echo "Autogen files out of date. Apply patch from: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts" | |
| exit 1 | |
| fi | |
| - name: Upload patch artifact | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: autogen-macos-patch | |
| path: autogen-macos.patch | |
| autogen-comgr-3: | |
| name: In-tree Autogen (comgr 3) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-tinygrad | |
| - name: Install autogen support packages | |
| run: | | |
| wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null | |
| sudo tee /etc/apt/sources.list.d/rocm.list <<EOF | |
| deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.4 $(lsb_release -cs) main | |
| EOF | |
| echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 | |
| sudo apt -qq update || true | |
| sudo apt-get install -y --no-install-recommends libclang-20-dev comgr | |
| - name: Regenerate autogen files | |
| run: | | |
| rm tinygrad/runtime/autogen/comgr_3.py | |
| python3 -c "from tinygrad.runtime.autogen import comgr_3" | |
| - name: Check for differences | |
| run: | | |
| if ! git diff --quiet; then | |
| git diff > autogen-comgr3.patch | |
| echo "Autogen files out of date. Apply patch from: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts" | |
| exit 1 | |
| fi | |
| - name: Upload patch artifact | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: autogen-comgr3-patch | |
| path: autogen-comgr3.patch |