reenable process replay for lvp (#13592)

This commit is contained in:
Christopher Milan
2025-12-05 09:36:35 -08:00
committed by GitHub
parent 0977206b1c
commit dec2f50aee
3 changed files with 9 additions and 8 deletions

View File

@@ -719,7 +719,6 @@ jobs:
- name: Run TRANSCENDENTAL math
run: TRANSCENDENTAL=2 python -m pytest -n=auto test/test_ops.py::TestOps::test_sin test/test_ops.py::TestOps::test_cos test/test_ops.py::TestOps::test_tan test/test_ops.py::TestOps::test_exp test/test_ops.py::TestOps::test_log --durations=20
- name: Run process replay tests
if: matrix.backend != 'lvp' # TODO: LVP is disabled due to renderer errors, bring this back
uses: ./.github/actions/process-replay
amdremote:
@@ -936,7 +935,6 @@ jobs:
- name: Run pytest (${{ matrix.backend }})
run: python3 -m pytest -n=auto test/ --ignore=test/models --ignore=test/unit --durations=20
- name: Run process replay tests
if: matrix.backend != 'lvp' # TODO: LVP is disabled due to renderer errors, bring this back
uses: ./.github/actions/process-replay
- name: Run macOS-specific unit test
if: matrix.backend == 'cpu'

View File

@@ -5,7 +5,7 @@ from tinygrad.renderer import Renderer
from tinygrad.renderer.cstyle import CUDARenderer
from tinygrad.uop.ops import GroupOp, Ops, UOp, PatternMatcher, UPat, range_str
from tinygrad.runtime.autogen import mesa
import base64, ctypes, ctypes.util, struct, functools, inspect
import base64, ctypes, ctypes.util, struct, functools, inspect, contextlib
def g(s:str): return getattr(mesa, s)
def nsrc(d:mesa.nir_def) -> mesa.nir_src: return mesa.nir_src(ssa=ctypes.pointer(d))
@@ -151,6 +151,11 @@ class NIRRenderer(Renderer):
(UPat(Ops.ENDIF, name="x"), lambda ctx,x: (lambda _: mesa.nir_def())(mesa.nir_pop_if(ctx.b, ctx.r[x.src[0]])))
])
def __init__(self): mesa.glsl_type_singleton_init_or_ref()
def __del__(self):
with contextlib.suppress(AttributeError): mesa.glsl_type_singleton_decref()
@property
def nir_options(self): raise NotImplementedError("needs nir_options")
def param(self, b:mesa.nir_builder, dtype:DType, sz:int) -> mesa.nir_def: raise NotImplementedError("needs param")

View File

@@ -1,4 +1,4 @@
import base64, ctypes, pathlib, tempfile, hashlib, contextlib
import base64, ctypes, pathlib, tempfile, hashlib
from tinygrad.device import Compiler
from tinygrad.helpers import cpu_objdump, system
from tinygrad.runtime.autogen import mesa
@@ -15,12 +15,10 @@ class NIRCompiler(Compiler):
def __init__(self, cache_key):
mesa.glsl_type_singleton_init_or_ref()
super().__init__(cache_key)
def __del__(self):
with contextlib.suppress(AttributeError): mesa.glsl_type_singleton_decref()
def __del__(self): mesa.glsl_type_singleton_decref()
class LVPCompiler(CPULLVMCompiler, NIRCompiler):
def __init__(self, cache_key="lvp"):
assert mesa.dll is not None
CPULLVMCompiler.__init__(self)
NIRCompiler.__init__(self, f"compile_{cache_key}")
@@ -67,7 +65,7 @@ class NAKCompiler(NIRCompiler):
super().__init__(f"compile_{cache_key}_{arch}")
def __del__(self):
with contextlib.suppress(AttributeError): mesa.nak_compiler_destroy(self.cc)
mesa.nak_compiler_destroy(self.cc)
super().__del__()
def __reduce__(self): return NAKCompiler, (self.arch, self.warps_per_sm)