Review of 54f600e (both regressions from r6):
- The direct-chain shortcut returned an ancestor hook from one direct
registration while a hooked container alias disagreed (FP32 -> BF16
flip). Only the projection's own hook still short-circuits; ancestor
hooks require agreement across all indexed paths, including container
aliases, or resolution raises.
- Automatic input-device resolution still enumerated the whole graph
downward and exhausted the budget on an alias-free 48 x 128 expert model,
so resolve_input_execution_device raised before its CPU-storage
fallback. It now uses the budgeted parent index and walks upward from the
target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of f962934:
- The traversal budget was checked per pop, after materializing all
children and queueing copied path sets, so wide or deep trees could
exhaust memory first. The walk is now a lazy DFS with one mutable path;
every edge read (including pruned edges) and every generated state is
charged before it happens.
- Admission scanned the whole model per layer, rejecting large alias-free
models (48 layers x 128 experts). A decisive own or direct-chain hook now
skips alias enumeration, and one reusable parent index per admission call
derives ancestry upward from the target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of ced0acb:
- Per-segment paths could compose into a cycle (attention.parent = layer
gave projection -> layer -> attention -> layer -> root and picked the
layer CPU hook over attention CUDA hook). Composed routes must now be
acyclic and segment walks may not cross other ancestry anchors; proven
direct edges are kept.
- Resolution work was unbounded (shared-subgraph re-expansion, 64^3
products). Alias walks now fail closed past 10,000 node visits and
composition past 256 paths, with deterministic budget tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of 4acb271:
- Explicit [projection, attention, layer, model] ancestry skipped real
hook owners such as Llama's model.model and any container between layer,
attention and projection. Attention admission now builds the complete
registered path through THIS layer (projection -> layer -> root) and only
falls back to the explicit list for unregistered wrappers.
- Alias enumeration via named_modules(remove_duplicate=False) recursed
through registered back-references. It is now an iterative walk with a
path-local ancestor guard and a 64-path bound.
- The target's own hook decides before any alias scan, and the
unsupported-hook message no longer mentions the input embedding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of bfe32bb: resolve_module_execution_device walked the first
registered path from named_modules(), so a projection shared between
layers always inherited the first layer's ancestors and could resolve
the wrong device while admitting another layer.
Attention admission now passes its explicit [projection, attention,
layer, model] ancestry, checked one module at a time nearest-first.
Without explicit ancestry every registered alias path is resolved and
conflicting results raise "ambiguous shared module execution devices"
instead of picking the first. Adds shared-projection regressions (both
registration orders), unsupported/device-less hooks on an intermediate
container, and per-layer resolved-device assertions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase admission's _attention_compute_dtypes passed the projection, its
attention module, layer and the root model to _hook_execution_device as
one list, which pools execution devices from every ancestor hook. On a
model split across two GPUs the layer hook (cuda:1) and the root dispatch
hook (cuda:0) differ, so every multi-GPU run failed admission with
"ambiguous Accelerate input execution devices". Found on 2x A100 with
module-placement-gpu devices=2 at 368660e.
Add resolve_module_execution_device, which walks ancestors nearest-first
and returns the first module whose own hook yields a device (a single
hook naming two devices still raises), and use it for attention
admission and the input-embedding walk. Modelling failures now report
"Phase '<p>': Cannot model phase demand: <cause>" instead of a bogus
"needs 0 bytes on cpu but only 0 bytes" shortfall.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>