Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions simpler_setup/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,34 @@ python -m simpler_setup.tools.deps_viewer outputs/<case>_<ts>/deps.json \
# Redundant-only: select the transitively-implied edges reduced would drop
python -m simpler_setup.tools.deps_viewer outputs/<case>_<ts>/deps.json \
--edge-mode omitted

# Conservative lifecycle-aware view: preserve OUTPUT_EXISTING reuse boundaries
# and require direct TensorMap dataflow around every byte of an omitted INOUT
python -m simpler_setup.tools.deps_viewer outputs/<case>_<ts>/deps.json \
--edge-mode omitted_v2
```

`--edge-mode` selects which structural `(pred, succ)` edges are visible:

- `full` (default) — every dependency edge.
- `reduced` — the minimal (transitively-reduced) edge set: every edge already
implied by a longer path is dropped, e.g. `A->C` when `A->B->C` exists.
- `reduced` — the transitively-reduced scheduling edge set: an `explicit` or
`tensormap` edge already implied by a longer path is dropped, e.g. `A->C`
when `A->B->C` exists. A `creator` edge is always retained because it keeps
the task that owns a tensor referenced by the consumer alive; execution order
alone cannot replace that lifetime relationship.
- `omitted` — only the redundant edges `reduced` would drop (its complement),
for auditing exactly which dependencies are transitively covered.

`reduced` and `omitted` print the redundant edges to stdout as a
- `reduced_v2` — first computes structural redundancy, then preserves every
`OUTPUT_EXISTING` creator edge as a possible reuse-generation boundary. An
`INOUT` creator edge is omitted only when direct `tensormap` annotations prove
that every occupied byte flows from an earlier Output and continues to a
later `INOUT` owned by the same creator. Regions are derived from the
underlying `buffer_addr`, dtype, shape, start offset, and strides. Missing,
ambiguous, or excessively complex metadata is preserved conservatively.
- `omitted_v2` — only structurally redundant edges that remain safe to omit
after the v2 Output-lifetime check; the complement of `reduced_v2`.

All reduction modes print the redundant edges to stdout as a
`<task> -> <task>` list, where each task uses the same label as the rendered
graph — the bare `local` counter when every task is in ring 0, or the explicit
`(ring, local)` tuple once any task lives in ring >= 1. Text output emits only
Expand All @@ -355,18 +372,19 @@ selected edge set. Selected edges are drawn above background-colored edges so
they stay visible where routes overlap. When `-o` is omitted the graph is
written to a mode-specific stem (`deps_viewer_reduced.*` /
`deps_viewer_omitted.*`) rather than `deps_viewer.*` so it never clobbers a
full-graph render in the same directory. Reduction is purely structural (it
ignores the per-edge tensor/arg identity) and is skipped with a warning if the
graph contains a cycle.
full-graph render in the same directory. Reachability is computed structurally,
but if any annotation for a `(pred, succ)` pair has `source=creator`, that edge
is protected from reduction. Reduction is skipped with a warning if the graph
contains a cycle.

### Command-Line Options

| Option | Short | Description |
| ------ | ----- | ----------- |
| `input` | | Path to `deps.json` (default: newest under `./outputs/`) |
| `--output` | `-o` | Output path; default stem is `deps_viewer`, or `deps_viewer_{mode}` for `reduced` / `omitted` |
| `--output` | `-o` | Output path; default stem is `deps_viewer`, or `deps_viewer_{mode}` for any reduction mode |
| `--format` | | Output format: `text` (default) or `html` |
| `--edge-mode` | | Select visible edges: `full`, `reduced`, or `omitted`; HTML preserves full layout. |
| `--edge-mode` | | Select visible edges: `full`, `reduced`, `omitted`, `reduced_v2`, or `omitted_v2`; HTML preserves full layout. |
| `--engine` | | HTML-only Graphviz layout engine: `dot` (default), `sfdp`, `neato`, `fdp`, `circo`, `twopi` |
| `--direction` | | HTML-only flow direction for hierarchical layouts: `LR` (default) / `TB` / `BT` / `RL` |
| `--show-tensor-info` | | HTML-only: render per-task tensor rows and route edges to specific arg ports |
Expand Down
Loading
Loading