From 056fcd77589ac5b3feb4e53e18754fab81d6d929 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Sun, 5 Apr 2026 13:14:16 +0300 Subject: [PATCH] viz: web work from rdna4 gemm (#15607) * add rdna4 barrier * fix realtime --- tinygrad/viz/js/index.js | 2 +- tinygrad/viz/serve.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index 62de6cff9c..4ca5f10105 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -264,7 +264,7 @@ function timeAtCycle(clk) { let cur = data.instSt, ns = 0, freq = null; // walk through all frequency changes and accumulate time in nanoseconds for (const [s, v] of data.tracks.get("Shader Clock").valueMap) { - if (freq != null && cur < s) { + if (freq != null && freq > 0 && cur < s) { const et = Math.min(clk, s); ns += (et - cur) * 1e9 / freq; cur = et; diff --git a/tinygrad/viz/serve.py b/tinygrad/viz/serve.py index d2c8d94338..ca7146afd7 100755 --- a/tinygrad/viz/serve.py +++ b/tinygrad/viz/serve.py @@ -388,7 +388,7 @@ def sqtt_timeline(data:bytes, lib:bytes, target:str) -> Generator[ProfileEvent, # barrier on this wave extends to fill the time it was waiting if wave is not None: if (barrier:=curr_barrier.pop(wave, None)) is not None: barrier.en = Decimal(p._time) - if name == "BARRIER": curr_barrier[wave] = e + if name in {"BARRIER", "BARRIER_SIGNAL"}: curr_barrier[wave] = e NS_PER_TICK = 10 # 100MHz prev_pair:tuple[int, int]|None = None # (shader, realtime) yield ProfilePointEvent("", "JSON", "waveColors", list(wave_colors.items()), ts=Decimal(0))