From f7aed180e41c59f1320025645d3f0811c8cd3bda Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Sat, 4 Apr 2026 16:40:53 +0300 Subject: [PATCH] viz/cli: add Other row in profiler (#15600) --- .../llama8b/implementations/tinybox_8xMI350X/profile.sh | 2 +- extra/viz/{README => README.md} | 2 +- extra/viz/cli.py | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) rename extra/viz/{README => README.md} (95%) diff --git a/examples/mlperf/training_submission_v6.0/tinycorp/benchmarks/llama8b/implementations/tinybox_8xMI350X/profile.sh b/examples/mlperf/training_submission_v6.0/tinycorp/benchmarks/llama8b/implementations/tinybox_8xMI350X/profile.sh index a8531e5355..cfddfa2601 100755 --- a/examples/mlperf/training_submission_v6.0/tinycorp/benchmarks/llama8b/implementations/tinybox_8xMI350X/profile.sh +++ b/examples/mlperf/training_submission_v6.0/tinycorp/benchmarks/llama8b/implementations/tinybox_8xMI350X/profile.sh @@ -2,4 +2,4 @@ export BENCHMARK=5 export EVAL_BS=0 VIZ=${VIZ:--1} examples/mlperf/training_submission_v6.0/tinycorp/benchmarks/llama8b/implementations/tinybox_8xMI350X/dev_run.sh -extra/viz/cli.py --profile -s "${DEV:-AMD}" | head -23 +extra/viz/cli.py --profile -s "${DEV:-AMD}" diff --git a/extra/viz/README b/extra/viz/README.md similarity index 95% rename from extra/viz/README rename to extra/viz/README.md index 1041da76d6..8f42c46f5c 100644 --- a/extra/viz/README +++ b/extra/viz/README.md @@ -13,7 +13,7 @@ Flags: VIZ=-1 to only save the trace to a file, VIZ=1 also launches a web server Use `extra/viz/cli.py --profile` to list all sources. -List top slowest kernels on a source: `--profile -s "AMD" | head 10` +List top slowest kernels on a source: `--profile -s "AMD"` List samples of a kernel on a source: `--profile -s "AMD" -i E_3 | head 4` ## Inspect codegen and PatternMatcher diff --git a/extra/viz/cli.py b/extra/viz/cli.py index 1fe9260f37..2fa1459372 100755 --- a/extra/viz/cli.py +++ b/extra/viz/cli.py @@ -117,7 +117,12 @@ def main(args) -> None: if agg and total > 0: from tabulate import tabulate items = sorted(agg.items(), key=lambda kv:kv[1][0], reverse=True) - table = [[format_colored(name), time_to_str(t, w=9), c, f"{(t/total*100.0):.2f}%"] for name,(t,c) in items] + rows = 20 + table = [[format_colored(name), time_to_str(t, w=9), c, f"{(t/total*100.0):.2f}%"] for name,(t,c) in items[:rows]] + if items[rows:]: + other_t = sum(t for _,(t,_) in items[rows:]) + other_c = sum(c for _,(_,c) in items[rows:]) + table.append(["Other", time_to_str(other_t, w=9), other_c, f"{(other_t/total*100.0):.2f}%"]) print(tabulate(table, headers=["name", "total", "count", "pct"], tablefmt="github")) return None