From a987a8ed44b67c56fca7f2d30fd926e0ccd1c0aa Mon Sep 17 00:00:00 2001 From: George Hotz <72895+geohot@users.noreply.github.com> Date: Sat, 20 Dec 2025 00:36:38 -0400 Subject: [PATCH] add neg VIZ support to not start server (#13772) --- tinygrad/runtime/ops_amd.py | 5 +++-- tinygrad/uop/ops.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tinygrad/runtime/ops_amd.py b/tinygrad/runtime/ops_amd.py index 87e2060644..218cb9fb17 100644 --- a/tinygrad/runtime/ops_amd.py +++ b/tinygrad/runtime/ops_amd.py @@ -20,8 +20,9 @@ from tinygrad.runtime.support.amd import AMDReg, AMDIP, import_module, import_so from tinygrad.runtime.support.system import System, PCIIfaceBase, PCIAllocationMeta, PCIDevice, USBPCIDevice, MAP_FIXED, MAP_NORESERVE if getenv("IOCTL"): import extra.hip_gpu_driver.hip_ioctl # noqa: F401 # pylint: disable=unused-import -SQTT, SQTT_ITRACE_SE_MASK, SQTT_LIMIT_SE = ContextVar("SQTT", VIZ.value>=2), ContextVar("SQTT_ITRACE_SE_MASK", 0b11), ContextVar("SQTT_LIMIT_SE", 0) -PMC = ContextVar("PMC", VIZ.value>=2) +SQTT = ContextVar("SQTT", abs(VIZ.value)>=2) +SQTT_ITRACE_SE_MASK, SQTT_LIMIT_SE = ContextVar("SQTT_ITRACE_SE_MASK", 0b11), ContextVar("SQTT_LIMIT_SE", 0) +PMC = ContextVar("PMC", abs(VIZ.value)>=2) EVENT_INDEX_PARTIAL_FLUSH = 4 # based on a comment in nvd.h WAIT_REG_MEM_FUNCTION_EQ = 3 # == WAIT_REG_MEM_FUNCTION_NEQ = 4 # != diff --git a/tinygrad/uop/ops.py b/tinygrad/uop/ops.py index b939fc6fa8..5830bde033 100644 --- a/tinygrad/uop/ops.py +++ b/tinygrad/uop/ops.py @@ -1174,7 +1174,7 @@ if TRACK_MATCH_STATS or PROFILE: with open(fn:=temp("rewrites.pkl", append_user=True), "wb") as f: print(f"rewrote {len(tracked_ctxs)} graphs and matched {sum(len(r.matches) for x in tracked_ctxs for r in x)} times, saved to {fn}") pickle.dump(RewriteTrace(tracked_keys, tracked_ctxs, uop_fields), f) - if VIZ: return launch_viz("VIZ", temp("rewrites.pkl", append_user=True)) + if VIZ > 0: return launch_viz("VIZ", temp("rewrites.pkl", append_user=True)) if getenv("PRINT_MATCH_STATS", TRACK_MATCH_STATS.value): ret = [0,0,0.0,0.0] for k,v in sorted(list(match_stats.items()), key=lambda x: x[1][2]+x[1][3]):