From 98e9e73286fe343a16d7418297e51ef8d7c57494 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Mon, 17 Nov 2025 13:25:51 -0800 Subject: [PATCH] hotfix: amd_uop_matmul getenvs --- extra/gemm/amd_uop_matmul.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/extra/gemm/amd_uop_matmul.py b/extra/gemm/amd_uop_matmul.py index 3d644969bd..845b68c36e 100644 --- a/extra/gemm/amd_uop_matmul.py +++ b/extra/gemm/amd_uop_matmul.py @@ -4,9 +4,9 @@ from tinygrad.engine.realize import ExecItem, get_runner from tinygrad.dtype import AddrSpace from tinygrad.helpers import getenv -N = 4096 +N = getenv("N", 4096) M = K = N -run_count = 5 +run_count = getenv("CNT", 5) # --------------------------- # launch/config constants @@ -155,14 +155,15 @@ def test_matmul(sink:UOp, N=N): ets.append(ei.run(wait=True)) print(f"REAL TFLOPS {N * N * N * 2 / min(ets) * 1e-12:.2f}") - GlobalCounters.reset() - with Context(DEBUG=2): - tc = (a @ b).realize() - with Context(DEBUG=0): - err = (hc - tc).square().mean().item() - print(f"mean squared error {err}") - if err > 1e-06: - raise RuntimeError("matmul is wrong!") + if getenv("VERIFY", 1): + GlobalCounters.reset() + with Context(DEBUG=2): + tc = (a @ b).realize() + with Context(DEBUG=0): + err = (hc - tc).square().mean().item() + print(f"mean squared error {err}") + if err > 1e-06: + raise RuntimeError("matmul is wrong!") if __name__ == "__main__": test_matmul(hand_spec_kernel3(), N=N)