Fix the debugging searches that pruned work they never checked - #85
Merged
Merged
Conversation
cymbalrush
force-pushed
the
feat/compute-plan
branch
2 times, most recently
from
September 8, 2026 03:46
be16cb2 to
9a0d480
Compare
Six related defects in the debugging package, all of which made a tool
report a clean or unchanged result over work it had not done.
Search narrowing (search_strategy, validator, comparator):
* `_depth_range` was computed and logged but never consulted when
choosing what to yield, so bisection visited the whole graph at one
model execution per side per batch. Both `_group_unchecked_nodes_by_depth`
and `_get_next_batch_from_current_level` now filter on it.
* The lower bound could advance past unchecked siblings when a level was
larger than `batch_size`; the guard now tests `<=` the passed depth.
* `Status.EXCLUDED` was projected to UNKNOWN, which strategies narrow on,
so a graph opening with placeholders and views narrowed to depth 0
before a single value was compared. Adds `ValidationResult.SKIPPED`,
which is neither evidence of a fault nor evidence against one.
FX graph diff (graph_diff, graph_match):
* Only top-level `fx.Node` args were followed, so `aten.cat`/`aten.stack`
got no incoming edges and their inputs looked unused. Arguments are now
flattened through lists, tuples and dicts, and kwargs are wired by name.
* An FX node's identity was its op and target alone -- `_attr_digest`
reads an `ir_object` an FX node does not have -- so `cat(dim=0)` and
`cat(dim=1)` hashed identically and diffed as isomorphic. Constant args
and the exported result type now feed the digest.
Crashes:
* `ComputeDevice.__missing__` is the dict hook, never called by Enum, so
an unrecognised residency raised instead of degrading to UNKNOWN.
* `_body_counts` recorded a call for a callee with no `coreai.graph`,
and `_histogram` then raised KeyError on the whole histogram.
* Benchmarker: interval id 0 was both the "not timed" sentinel and a real
id; the sentinel now sits outside the counter's range and is rejected
before lookup. `_state` transitions moved under the callback lock.
Tests cover each behaviour change. Pre-existing failures in
test_benchmarker (module timings) and test_intermediates are unaffected.
cymbalrush
force-pushed
the
feat/compute-plan
branch
from
September 8, 2026 03:49
9a0d480 to
8598730
Compare
gokulkrishna98
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Search narrowing (search_strategy, validator, comparator):
_depth_rangewas computed and logged but never consulted when choosing what to yield, so bisection visited the whole graph at one model execution per side per batch. Both_group_unchecked_nodes_by_depthand_get_next_batch_from_current_levelnow filter on it.batch_size; the guard now tests<=the passed depth.Status.EXCLUDEDwas projected to UNKNOWN, which strategies narrow on, so a graph opening with placeholders and views narrowed to depth 0 before a single value was compared. AddsValidationResult.SKIPPED, which is neither evidence of a fault nor evidence against one.FX graph diff (graph_diff, graph_match):
fx.Nodeargs were followed, soaten.cat/aten.stackgot no incoming edges and their inputs looked unused. Arguments are now flattened through lists, tuples and dicts, and kwargs are wired by name._attr_digestreads anir_objectan FX node does not have -- socat(dim=0)andcat(dim=1)hashed identically and diffed as isomorphic. Constant args and the exported result type now feed the digest.Crashes:
ComputeDevice.__missing__is the dict hook, never called by Enum, so an unrecognised residency raised instead of degrading to UNKNOWN._body_countsrecorded a call for a callee with nocoreai.graph, and_histogramthen raised KeyError on the whole histogram._statetransitions moved under the callback lock.