diff --git a/test/unit/test_viz.py b/test/unit/test_viz.py index e51f85b1fa..2facf85bef 100644 --- a/test/unit/test_viz.py +++ b/test/unit/test_viz.py @@ -5,7 +5,7 @@ from typing import Generator from tinygrad.uop.ops import UOp, UPat, Ops, PatternMatcher, TrackedPatternMatcher, graph_rewrite, track_rewrites, TRACK_MATCH_STATS, profile_matches from tinygrad.uop.symbolic import sym from tinygrad.dtype import dtypes -from tinygrad.helpers import PROFILE, colored, ansistrip, flatten, TracingKey, ProfileRangeEvent, ProfileEvent, Context, cpu_events, profile_marker +from tinygrad.helpers import PROFILE, colored, ansistrip, flatten, TracingKey, ProfileRangeEvent, ProfileEvent, Context, cpu_events, profile_marker, VIZ from tinygrad.device import Buffer @track_rewrites(name=True) @@ -33,11 +33,14 @@ class BaseTestViz(unittest.TestCase): cpu_events.clear() self.tms = TRACK_MATCH_STATS.value self.profile = PROFILE.value + self.viz = VIZ.value TRACK_MATCH_STATS.value = 2 PROFILE.value = 1 + VIZ.value = 1 def tearDown(self): TRACK_MATCH_STATS.value = self.tms PROFILE.value = self.profile + VIZ.value = self.viz class TestViz(BaseTestViz): def test_simple(self): diff --git a/tinygrad/helpers.py b/tinygrad/helpers.py index 614e319a0b..87c67dd47b 100644 --- a/tinygrad/helpers.py +++ b/tinygrad/helpers.py @@ -179,6 +179,7 @@ ALLOW_DEVICE_USAGE, MAX_BUFFER_SIZE = ContextVar("ALLOW_DEVICE_USAGE", 1), Conte EMULATE = ContextVar("EMULATE", "") CPU_COUNT = ContextVar("CPU_COUNT", max(1, len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else (os.cpu_count() or 1))) CPU_LLVM, CPU_LVP, AMD_LLVM = ContextVar("CPU_LLVM", 0), ContextVar("CPU_LVP", 0), ContextVar("AMD_LLVM", 0) +# VIZ implies PROFILE, but you can run PROFILE without VIZ VIZ = ContextVar("VIZ", 0) PROFILE = ContextVar("PROFILE", VIZ.value) SPEC = ContextVar("SPEC", 1)