compile-only test for IR3 actually works (#13619)

This commit is contained in:
Christopher Milan
2025-12-08 12:07:49 -08:00
committed by GitHub
parent a17077d1d9
commit a4c3d48aa9
3 changed files with 4 additions and 2 deletions

View File

@@ -1000,4 +1000,5 @@ jobs:
shell: bash shell: bash
run: | run: |
python -c "from tinygrad import Device; assert Device.DEFAULT == 'NULL'" python -c "from tinygrad import Device; assert Device.DEFAULT == 'NULL'"
DEBUG=4 python3 test/test_ops.py TestOps.test_add
python -m pytest -n=auto test/test_ops.py --durations=20 python -m pytest -n=auto test/test_ops.py --durations=20

View File

@@ -187,6 +187,7 @@ CPU_COUNT = ContextVar("CPU_COUNT", max(1, len(os.sched_getaffinity(0)) if hasat
# Compilers # Compilers
CPU_LLVM, CPU_LVP, AMD_LLVM = ContextVar("CPU_LLVM", 0), ContextVar("CPU_LVP", 0), ContextVar("AMD_LLVM", 0) CPU_LLVM, CPU_LVP, AMD_LLVM = ContextVar("CPU_LLVM", 0), ContextVar("CPU_LVP", 0), ContextVar("AMD_LLVM", 0)
NV_PTX, CUDA_PTX, NV_NAK, QCOM_IR3 = ContextVar("NV_PTX", 0), ContextVar("CUDA_PTX", 0), ContextVar("NV_NAK", 0), ContextVar("QCOM_IR3", 0) NV_PTX, CUDA_PTX, NV_NAK, QCOM_IR3 = ContextVar("NV_PTX", 0), ContextVar("CUDA_PTX", 0), ContextVar("NV_NAK", 0), ContextVar("QCOM_IR3", 0)
NULL_IR3 = ContextVar("NULL_IR3", 0)
AMD_CC, CPU_CC, NV_CC, CUDA_CC = ContextVar("AMD_CC", ""), ContextVar("CPU_CC", ""), ContextVar("NV_CC", ""), ContextVar("CUDA_CC", "") AMD_CC, CPU_CC, NV_CC, CUDA_CC = ContextVar("AMD_CC", ""), ContextVar("CPU_CC", ""), ContextVar("NV_CC", ""), ContextVar("CUDA_CC", "")
QCOM_CC = ContextVar("QCOM_CC", "") QCOM_CC = ContextVar("QCOM_CC", "")
# VIZ implies PROFILE, but you can run PROFILE without VIZ # VIZ implies PROFILE, but you can run PROFILE without VIZ

View File

@@ -4,7 +4,7 @@ from tinygrad.engine.jit import MultiGraphRunner
from tinygrad.renderer.cstyle import Renderer, CStyleLanguage from tinygrad.renderer.cstyle import Renderer, CStyleLanguage
from tinygrad.renderer.llvmir import AMDLLVMRenderer from tinygrad.renderer.llvmir import AMDLLVMRenderer
from tinygrad.uop.ops import Ops from tinygrad.uop.ops import Ops
from tinygrad.helpers import cpu_profile, EMULATE from tinygrad.helpers import cpu_profile, EMULATE, NULL_IR3
from tinygrad.renderer.nir import IR3Renderer from tinygrad.renderer.nir import IR3Renderer
from tinygrad.runtime.support.compiler_mesa import IR3Compiler from tinygrad.runtime.support.compiler_mesa import IR3Compiler
@@ -40,5 +40,5 @@ class NullDevice(Compiled):
case "": renderer = NullRenderer case "": renderer = NullRenderer
case _: raise RuntimeError(f"can't EMULATE device: {EMULATE.value}") case _: raise RuntimeError(f"can't EMULATE device: {EMULATE.value}")
compilers = CompilerSet([CompilerPair(renderer, Compiler), compilers = CompilerSet([CompilerPair(renderer, Compiler),
CompilerPair(functools.partial(IR3Renderer, self), functools.partial(IR3Compiler, 0x6030001))]) # adreno 630 CompilerPair(functools.partial(IR3Renderer, self), functools.partial(IR3Compiler, 0x6030001), NULL_IR3)]) # adreno 630
super().__init__(device, NullAllocator(self), compilers, functools.partial(NullProgram, device), NullGraph) super().__init__(device, NullAllocator(self), compilers, functools.partial(NullProgram, device), NullGraph)