mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
parent
c0f77c2e1c
commit
5eb641395a
2 changed files with 5 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import unittest, pickle
|
||||
from typing import Iterator
|
||||
from pathlib import Path
|
||||
from tinygrad.helpers import DEBUG, getenv, temp, ansistrip
|
||||
from tinygrad.helpers import DEBUG, getenv, temp, ansistrip, Context
|
||||
from tinygrad.renderer.amd.sqtt import print_packets, map_insts
|
||||
from tinygrad.runtime.autogen.amd.rdna3.ins import s_endpgm
|
||||
from tinygrad.viz.serve import sqtt_timeline
|
||||
|
|
@ -120,6 +120,9 @@ class TestSQTTMapBase(unittest.TestCase):
|
|||
for r in lines[2:]:
|
||||
parts = r.split()
|
||||
self.assertTrue(parts[0].isdigit(), f"expected clock timestamp, got {parts[0]}")
|
||||
with Context(DEBUG=2):
|
||||
kernels = run_cli("--profile", "--profile-path", str(pkl_path), "-s", "AMD").split("\n")
|
||||
self.assertEqual(len(kernels), len(self.examples[pkl_path.stem][1]))
|
||||
|
||||
class TestSQTTMapRDNA3(TestSQTTMapBase): target = "gfx1100"
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ def main(args) -> None:
|
|||
|
||||
# ** Profiler printer
|
||||
else:
|
||||
timelines = [(n,l) for n,l in profile["layout"].items() if l.get("event_type") == 0]
|
||||
timelines = [(n,l) for n,l in profile["layout"].items() if isinstance(l, dict) and l.get("event_type") == 0]
|
||||
def produce_top_kernels() -> Iterator[dict]:
|
||||
tagged = ((n,e) for n,l in timelines for e in l["events"]) if args.src == "ALL" else ((args.src,e) for e in unwrap(data)["events"])
|
||||
agg:dict[tuple[str,str], tuple[float, int, int|None]] = {} # map (device, kernel name) to (total time, count and ref)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue