fix(instrument): remove 5 of 6 roundtrip suppressions and fix root causes#971
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR narrows roundtrip structural-equality suppression to only the "Variable pointer mismatch" case and updates printer/test code to stop relying on the suppressed special-cases: it removes tile.load printer special-casing, centralizes tile.load test construction, normalizes op IDs, adds call result types in SSA tests, and standardizes loop index types in SSA verification tests. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
caa0721 to
876e7d5
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the RoundtripInstrument by removing several legacy error suppressions for IR asymmetries that have been resolved, such as UnknownType and operator name mismatches. It also simplifies the Python printer by removing special-case logic for tile.load and updates unit tests to use more accurate data types (e.g., DataType.INDEX for loop indices) and standardized helper functions. One review comment suggests updating a TODO issue reference from #929 to #970 to correctly track the remaining parser limitation regarding variable pointer reuse.
| # TODO(#929): fix the parser to reuse same-named dynamic-shape Var | ||
| # objects across param types, return types, and body — then remove. |
There was a problem hiding this comment.
The TODO references issue #929, but the pull request description indicates that #929 is closed by this PR and the root cause for the remaining suppression is now tracked in #970. The issue number should be updated to #970 for consistency and accurate tracking.
| # TODO(#929): fix the parser to reuse same-named dynamic-shape Var | |
| # objects across param types, return types, and body — then remove. | |
| # TODO(#970): fix the parser to reuse same-named dynamic-shape Var | |
| # objects across param types, return types, and body — then remove. |
a0405cd to
60aee1c
Compare
…uses (hw-native-sys#929) Remove error message suppressions from RoundtripInstrument that were hiding real issues in tests, the printer, and type inference. Fix the underlying problems at their source instead: - Remove UnknownType suppression: fix tests to pass correct result type to ir.Call instead of relying on UnknownType default - Remove tensor.add/adds suppression: fix tests to use tensor.adds for scalar operands (matching DSL dispatch behavior) - Remove tile.load 3→4 args suppression: fix tests to construct 4-arg tile.load with valid_shapes and kwargs; remove printer special case that padded 3-arg to 4-arg - Remove TileType tile_view suppression: fix InheritTileViewLayout to also propagate slayout (was only copying blayout and pad) - Remove SplitMode suppression: already fixed upstream (hw-native-sys#964) - Fix for-loop vars/bounds in tests to use INDEX dtype (matching DSL pl.range() behavior) instead of INT64 Keep only Variable pointer mismatch suppression — the parser creates separate Var objects for same-named dynamic-shape parameters across param types, return types, and body. Tracked in hw-native-sys#970.
60aee1c to
67f8286
Compare
Summary
Closes #929
Remove 5 of 6 error message suppressions from
RoundtripInstrumentstructural equality check, fixing underlying issues at their source instead of papering over them.Suppressions removed (5)
ir.Callinstead of relying onUnknownTypedefaulttensor.addsfor scalar operands (matching DSL dispatch)tile.loadwithvalid_shapesand kwargs; removed printer special case that padded 3-arg to 4-argAdditional fixes
test_verify_ssa_pass.pyto useINDEXdtype (matching DSLpl.range()behavior) instead ofINT64_load_call()helper intest_legalize_pto_buffer_reuse.pyto reduce duplicationSuppression kept (1)
Varobjects for same-named dynamic-shape parameters across param types, return types, and body. Root cause tracked in [Pass] InitMemRef fragments dynamic-shape Var pointers, breaking roundtrip structural equality #970.Test plan
Variable pointer mismatchsuppression is still needed (test_dynamic_shape fails without it)