fix mypy mockgpu and add tinygrad.renderer.isa to packages (#16265)

This commit is contained in:
Christopher Milan
2026-05-19 13:45:03 -07:00
committed by GitHub
parent 890b731b1e
commit bb2a51f1ea
2 changed files with 3 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ packages = [
'tinygrad.nn',
'tinygrad.renderer',
'tinygrad.renderer.amd',
'tinygrad.renderer.isa',
'tinygrad.runtime',
'tinygrad.runtime.autogen',
'tinygrad.runtime.autogen.am',
@@ -133,7 +134,7 @@ debug = true
[tool.mypy]
warn_unused_configs = true
files = ["tinygrad"]
files = ["tinygrad", "test/mockgpu"]
ignore_missing_imports = true
check_untyped_defs = true
explicit_package_bases = true

View File

@@ -340,7 +340,7 @@ def get_pcode(op) -> str:
pcode = pcode.replace('VCC = 0x0LL', 'VCC.u64[laneId] = 0').replace('VCC = 0x1LL', 'VCC.u64[laneId] = 1')
return pcode
def parse_pcode(pcode: str, srcs: dict[str, UOp | int] | None = None) -> tuple[dict, list[tuple[str, UOp]]]:
def parse_pcode(pcode: str, srcs: dict[str, UOp | int] | None = None) -> tuple[dict, list]:
env: dict = srcs.copy() if srcs else {}
assigns: list[tuple[str, UOp]] = []
raw_lines = [l.strip().rstrip(';') for l in pcode.split('\n') if l.strip() and not l.strip().startswith('//')]