Skip to content

Commit 2a274c5

Browse files
committed
docs
1 parent 1f5fed7 commit 2a274c5

22 files changed

Lines changed: 207 additions & 30 deletions

MANUAL.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Manual
2+
3+
This viewer shows paired hardware and logical layouts and lets you inspect how cells map between them.
4+
5+
## Selection
6+
7+
- `Left click + drag`: create a new selection.
8+
- `Shift + left click + drag`: add cells to the current selection.
9+
- `Ctrl + left click + drag`: remove cells from the current selection.
10+
- `Click` on empty space: clear the current selection.
11+
12+
Selections are paired across hardware and logical layouts. Selecting cells in one view highlights the mapped cells in the other.
13+
14+
Videos:
15+
16+
- [Left click + drag](./docs/manual-vids/0-lclick-drag.mp4)
17+
- [Shift + left click + drag](./docs/manual-vids/1-shift-lclick-drag.mp4)
18+
- [Ctrl + left click + drag](./docs/manual-vids/2-ctrl-lclick-drag.mp4)
19+
- [Click empty space to deselect](./docs/manual-vids/3-lclick-out-bounds.mp4)
20+
21+
## Inspector
22+
23+
The `Inspector` widget shows information for the cell under the cursor:
24+
25+
- hovered tensor
26+
- hardware coordinate
27+
- logical coordinate
28+
- hardware coordinate in binary
29+
- logical coordinate in binary
30+
- tensor shape
31+
- rank
32+
33+
For linear-layout tabs, `Hardware Coord` is the `T/W/R` coordinate and `Logical Coord` is the `A/B/...` coordinate.
34+
35+
Video:
36+
37+
- [Inspector](./docs/manual-vids/4-inspector.mp4)
38+
39+
## Show Matrix
40+
41+
`Show Matrix` displays the current rendered layout matrix.
42+
43+
- It is tab-specific.
44+
- It updates when the layout is rendered.
45+
- Row and column labels are color-coded to match the dimension-line colors.
46+
47+
Video:
48+
49+
- [Show Matrix](./docs/manual-vids/5-show-matrix.mp4)
50+
51+
## Tabs
52+
53+
- Click a tab to switch layouts.
54+
- `Add New Tab` duplicates the current tab as a new editable tab.
55+
- Click the `x` on a tab to close it.
56+
- Each tab stores its own layout, slicing state, HSL settings, and cell-text settings.
57+
58+
Video:
59+
60+
- [Tabs](./docs/manual-vids/6-tabs.mp4)
61+
62+
## Slicing
63+
64+
Use the `Tensor View` widget to change the active tensor view and slice hidden axes.
65+
66+
- Edit the `View String` to permute or hide axes.
67+
- Use the slice sliders to move through hidden-axis indices.
68+
69+
For paired linear-layout tabs, slicing one tensor filters the corresponding visible cells in the other tensor as well.
70+
71+
Video:
72+
73+
- [Slicing](./docs/manual-vids/7-slicing.mp4)
74+
75+
## HSL Coloring
76+
77+
Use the `HSL Mapping` widget to control the cell colors.
78+
79+
- Drag the `H`, `S`, and `L` chips to swap which axis drives each channel.
80+
- Edit the start/end numeric fields for each channel range.
81+
- Click `Recolor Layout` to apply the updated coloring.
82+
83+
The mapping is per tab.
84+
85+
Video:
86+
87+
- [HSL coloring](./docs/manual-vids/8-hsl-coloring.mp4)
88+
89+
## Cell Text
90+
91+
Use the `Cell Text` widget to overlay hardware ids on cells.
92+
93+
- `Warp Id`
94+
- `Thread Id`
95+
- `Register Id`
96+
97+
Text appears on both the hardware and logical layouts. Logical cells show the mapped hardware ids for the corresponding element.
98+
99+
Video:
100+
101+
- [Cell text](./docs/manual-vids/9-cell-text.mp4)
102+
103+
## Display Toggles
104+
105+
From the `Display` menu:
106+
107+
- `Toggle Block Gaps`: show or hide spacing between higher-level layout blocks.
108+
- `Toggle Dimension Lines`: show or hide tensor outlines, dimension guides, and axis labels.
109+
110+
These can also be changed from the sidebar widgets where available.
111+
112+
Video:
113+
114+
- [Display toggles](./docs/manual-vids/10-display-toggles.mp4)
115+
116+
## Save
117+
118+
Use `File -> Save as SVG` to export the current 2D view.
119+
120+
- Shortcut: `Ctrl+S`
121+
- The SVG includes tensor names, dimension lines, axis labels, cell colors, and supported overlays visible in the current 2D view.
122+
123+
Video:
124+
125+
- [Save as SVG](./docs/manual-vids/11-save.mp4)
126+
127+
## Notes
128+
129+
- GitHub Pages serves the static frontend only.
130+
- The local Python demo can additionally serve `/api/session.json` and tensor payload files.

README.md

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# linear-layout-viz
22

3-
Minimal wrapper repo for experiments that build on the local [`tensor-viz`](./tensor-viz) project.
3+
![Cover](./assets/cover.png)
4+
5+
A visualizer for Triton linear layouts.
6+
- Website: https://deep-learning-profiling-tools.github.io/linear-layout-viz/
7+
- There might be problems with sidebar spacing with Firefox (I use Librewolf so that's why I'm not sure if it's a Firefox or Librewolf problem). Should work fine on Chromium.
8+
- Paper: https://arxiv.org/pdf/2505.23819
9+
10+
See [MANUAL.md](./MANUAL.md) for the viewer interaction guide.
11+
See [docs/sample-svgs/](./docs/sample-svgs/README.md) for example exported SVGs.
412

513
## Structure
614

@@ -18,12 +26,6 @@ pip install -e .
1826
npm run build
1927
```
2028

21-
## GitHub Pages
22-
23-
The repo now includes [`.github/workflows/deploy-pages.yml`](./.github/workflows/deploy-pages.yml), which builds the static Vite demo from `tensor-viz/packages/viewer-demo` and publishes it to GitHub Pages.
24-
25-
Important limitation: GitHub Pages is static-only. The public site can render browser-side linear layouts from the new sidebar and still open local `.npy` files, but it cannot run the Python `tensor_viz.viz(...)` server or serve `/api/session.json`.
26-
2729
### One-time GitHub setup
2830

2931
1. Push this repo, including the submodule pointer you want Pages to build.
@@ -41,26 +43,8 @@ npm run build --workspace @tensor-viz/viewer-demo
4143

4244
The built site is written to `tensor-viz/packages/viewer-demo/dist`.
4345

44-
### Linear Layout Sidebar Schema
45-
46-
The public site's layout editor accepts JSON shaped like Triton's `LinearLayout.from_bases(...)` call:
47-
48-
```json
49-
{
50-
"name": "Blocked Layout",
51-
"bases": [
52-
["warp", [[0, 8], [0, 16]]],
53-
["thread", [[4, 0], [8, 0], [0, 1], [0, 2], [0, 4]]],
54-
["register", [[1, 0], [2, 0]]]
55-
],
56-
"out_dims": ["x", "y"]
57-
}
58-
```
59-
60-
`out_dims` can also be written as `[name, size]` pairs when you want to pin the output shape explicitly.
61-
62-
## Notes
46+
## Usage
6347

64-
- the submodule points at `https://github.com/Deep-Learning-Profiling-Tools/tensor-viz`
65-
- the wrapper repo builds whatever committed `tensor-viz` revision the submodule pointer references
66-
- if you want Pages to include newer `tensor-viz` changes, commit them in `tensor-viz` first and then update the submodule pointer here
48+
- For day-to-day viewer usage, see [MANUAL.md](./MANUAL.md).
49+
- The manual covers selection, inspector, matrix view, tabs, slicing, HSL coloring, cell text, display toggles, and saving SVG output.
50+
- For example exports, see [docs/sample-svgs/](./docs/sample-svgs/README.md).

assets/cover.png

191 KB
Loading

docs/manual-vids/0-lclick-drag.mp4

236 KB
Binary file not shown.
284 KB
Binary file not shown.
1.41 MB
Binary file not shown.

docs/manual-vids/11-save.mp4

1.16 MB
Binary file not shown.
248 KB
Binary file not shown.
161 KB
Binary file not shown.

docs/manual-vids/4-inspector.mp4

306 KB
Binary file not shown.

0 commit comments

Comments
 (0)