diff --git a/docs/diagrams/cube_view.svg b/docs/diagrams/cube_view.svg
index befc33c..522b909 100644
--- a/docs/diagrams/cube_view.svg
+++ b/docs/diagrams/cube_view.svg
@@ -126,7 +126,6 @@
r0c0
-
PE0
@@ -139,7 +138,6 @@
256GB/s
r0c1
-
PE1
@@ -149,19 +147,15 @@
256GB/s
r0c2
-
r0c3
-
r0c4
-
UCIe-N.c2
r0c5
-
UCIe-E.c0
@@ -170,29 +164,23 @@
r1c0
-
UCIe-W.c1
r1c1
-
r1c2
-
r1c3
-
r1c4
-
PE2
256GB/s
r1c5
-
PE3
@@ -202,37 +190,28 @@
256GB/s
r2c0
-
M_CPU
r2c1
-
r2c4
-
r2c5
-
r3c0
-
SRAM
r3c1
-
r3c4
-
r3c5
-
r4c0
-
PE4
@@ -242,29 +221,23 @@
256GB/s
r4c1
-
PE5
256GB/s
r4c2
-
r4c3
-
r4c4
-
r4c5
-
UCIe-E.c2
r5c0
-
UCIe-W.c3
@@ -273,19 +246,15 @@
r5c1
-
UCIe-S.c1
r5c2
-
r5c3
-
r5c4
-
PE6
@@ -295,7 +264,6 @@
256GB/s
r5c5
-
PE7
@@ -306,6 +274,38 @@
UCIe-S.c3
256GB/s
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
PE Router
diff --git a/src/kernbench/topology/visualizer.py b/src/kernbench/topology/visualizer.py
index e3f4105..39965e6 100644
--- a/src/kernbench/topology/visualizer.py
+++ b/src/kernbench/topology/visualizer.py
@@ -563,16 +563,7 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
f'{rkey}'
)
- # ── Router → HBM_CTRL line (all routers connect to HBM) ──
- hbm_edge_y = hbm_y if py < hbm_y else hbm_y + hbm_h
- r_edge_y = py + r_size if py < hbm_y else py - r_size
- # Only draw if not inside HBM zone
- if abs(r_edge_y - hbm_edge_y) > 10:
- parts.append(
- f' '
- )
+ # ── Router → HBM_CTRL line (deferred, drawn after component blocks) ──
# ── Attached component blocks ──
# Collect components to draw, positioned outward from router
@@ -672,14 +663,36 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
# ── PE router → HBM BW annotation ──
if pe_items:
+ pe_hbm_edge = hbm_y if py < hbm_y else hbm_y + hbm_h
+ pe_r_edge = py + r_size if py < hbm_y else py - r_size
bw_x = px + 14
- bw_y = (r_edge_y + hbm_edge_y) / 2
+ bw_y = (pe_r_edge + pe_hbm_edge) / 2
parts.append(
f' '
f'{agg_bw:.0f}GB/s'
)
+ # ── Router → HBM_CTRL lines (drawn last, on top of everything) ──
+ for rkey, rval in routers.items():
+ if rval is None:
+ continue
+ rx, ry = rval["pos_mm"]
+ px, py = mm2px(rx, ry)
+ hbm_edge_y = hbm_y if py < hbm_y else hbm_y + hbm_h
+ r_edge_y = py + r_size if py < hbm_y else py - r_size
+ if abs(r_edge_y - hbm_edge_y) > 10:
+ has_pe = any(a.endswith(".dma") for a in rval.get("attach", []))
+ # PE routers: thicker, more visible
+ sw = "1.5" if has_pe else "0.7"
+ op = "0.6" if has_pe else "0.2"
+ parts.append(
+ f' '
+ )
+
# ── Legend ──
ly = h_px - 35
legend_items = [