mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-25 06:48:22 -05:00
bring viz to core (#6970)
* move viz to core * pathfix * move test_viz to core * cleanup test_viz diff * use contextvars
This commit is contained in:
@@ -4,7 +4,7 @@ import itertools
|
||||
from tinygrad import Tensor, dtypes
|
||||
from tinygrad.helpers import Context, getenv
|
||||
from tinygrad.engine.realize import lower_schedule
|
||||
from viz.serve import GraphRewriteMetadata, get_metadata, _uop_to_json
|
||||
from tinygrad.viz.serve import GraphRewriteMetadata, get_metadata, _uop_to_json
|
||||
from tinygrad.ops import TRACK_MATCH_STATS, TrackedPatternMatcher, UPat, UOps, UOp, graph_rewrite, contexts, track_rewrites
|
||||
|
||||
def group_rewrites(kernels:List[GraphRewriteMetadata]): return {k:list(v) for k,v in itertools.groupby(kernels, lambda x:x.loc)}
|
||||
|
||||
@@ -638,7 +638,7 @@ if TRACK_MATCH_STATS:
|
||||
pickle.dump(contexts, f)
|
||||
if getenv("VIZ"):
|
||||
os.environ["VIZ"] = "0"
|
||||
os.execv(sys.executable, [sys.executable] + [os.path.join(os.path.dirname(__file__), "..", "viz", "serve.py")])
|
||||
os.execv(sys.executable, [sys.executable] + [os.path.join(os.path.dirname(__file__), ".", "viz", "serve.py")])
|
||||
if getenv("PRINT_MATCH_STATS", 1):
|
||||
ret = [0,0,0.0,0.0]
|
||||
for k,v in sorted(list(match_stats.items()), key=lambda x: x[1][2]):
|
||||
|
||||
|
Before Width: | Height: | Size: 750 B After Width: | Height: | Size: 750 B |
Reference in New Issue
Block a user