From a5d7eb37db64d4f351b0cb1e7cc518652e8dca3d Mon Sep 17 00:00:00 2001 From: Christopher Milan Date: Mon, 2 Feb 2026 20:10:19 -0800 Subject: [PATCH] IR3 works on versions earlier than 3.14 (#14507) --- .github/workflows/test.yml | 2 +- tinygrad/runtime/support/compiler_mesa.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a3015f793..97bad757b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -957,7 +957,7 @@ jobs: key: compile-${{ matrix.backend }} deps: testing_unit mesa: ${{ (matrix.backend == 'ir3' || matrix.backend == 'nak') && 'true' }} - python-version: '3.14' + python-version: '3.12' - name: Set env shell: bash run: printf "NULL=1\nNULL_ALLOW_COPYOUT=1\n${{ matrix.backend == 'ir3' && 'NULL_IR3=1' || matrix.backend == 'nak' && 'NULL_NAK=1' }}" >> $GITHUB_ENV diff --git a/tinygrad/runtime/support/compiler_mesa.py b/tinygrad/runtime/support/compiler_mesa.py index 204867ca74..240976de7a 100644 --- a/tinygrad/runtime/support/compiler_mesa.py +++ b/tinygrad/runtime/support/compiler_mesa.py @@ -1,4 +1,4 @@ -import base64, ctypes, pathlib, tempfile, hashlib, sys +import base64, ctypes, pathlib, tempfile, hashlib from tinygrad.device import Compiler from tinygrad.helpers import cpu_objdump, system, data64 from tinygrad.runtime.autogen import mesa, llvm @@ -90,7 +90,6 @@ def disas_adreno(lib:bytes, gpu_id=630): class IR3Compiler(Compiler): def __init__(self, chip_id, cache_key="ir3"): - assert sys.version_info >= (3,14), "IR3 requires python 3.14's bitfield fixes" self.dev_id = mesa.struct_fd_dev_id(((chip_id >> 24) & 0xFF) * 100 + ((chip_id >> 16) & 0xFF) * 10 + ((chip_id >> 8) & 0xFF), chip_id) self.cc = mesa.ir3_compiler_create(None, self.dev_id, mesa.fd_dev_info(self.dev_id), mesa.struct_ir3_compiler_options(disable_cache=True)).contents