Repository navigation
[9/12] Add DLA logical rewrites and float consumer views - #3189
mgohil-png wants to merge 1 commit into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@coderabbitai full review |
Action performed
|
f04824d to
235d183
Compare
|
235d183 to
15b0bb3
Compare
70453d5 to
8e6a940
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dla/onnxscript-08-lstm #3189 +/- ##
==========================================================
+ Coverage 82.37% 82.40% +0.02%
==========================================================
Files 742 743 +1
Lines 83407 83532 +125
==========================================================
+ Hits 68710 68831 +121
- Misses 14697 14701 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8e6a940 to
83824fa
Compare
Signed-off-by: mgohil <[email protected]>
83824fa to
3d16e9a
Compare
| if formal == "tensor(float)" or ( | ||
| "tensor(float)" in constraints.get(formal, []) | ||
| and binding | ||
| and all(d == ir.DataType.FLOAT for d in binding) |
There was a problem hiding this comment.
When two Unsqueeze inputs to a Sum both need a FLOAT cast, each one gets skipped because the other is still INT64. That leaves the Sum with mixed types and it fails ONNX type checking. Could we collect the inputs that need casts before deciding which ones to convert?
| if np.broadcast_shapes(*shapes) != np.broadcast_shapes( | ||
| shapes[0], shapes[2 - index] | ||
| ): | ||
| return False |
There was a problem hiding this comment.
When both Where branches are zero, failing the shape check for the first branch ends the search. Dropping the other branch can still preserve the output shape. Could we continue here so the rule tries that branch too?
What does this PR do?
Type of change: new feature
Adds finite zero-branch Where lowering, supported binary Not lowering and private FLOAT views for eligible Greater comparisons. A direct pass gives schema-required FLOAT consumers reusable views of native integer data while retaining other integer/control users.
Usage
Internal logical batch and float-consumer pass after layout. Per-operand conversion and shared ownership checks determine eligibility.
Testing
Pre-fix CI readiness check (2026-11-05; head
8e6a940c6b): unit tests, code quality, and documentation workflows passed for that head. These results predate the singleton fix; updated-head CI results are pending. Aggregate checks still include cancelled duplicate runs.Focus: Shared masks/casts, native/refused forms, public boolean endpoints, integer comparison boundaries and mixed intermediate dtype normalization.
Slice validation: 124 tests passed on this slice using
python -m pytest tests/unit/onnx/graph_surgery/dla_transforms tests/unit/onnx/graph_surgery/test_graph_utils.py -o addopts= -q -p no:cacheprovider --strict-markers.Repository checks: Ruff, formatting, license, security, whitespace and applicable repository hooks passed. Mypy reports the preexisting Windows
os.sched_getaffinityerror; it was excluded from commit hooks after confirming the same unrelated error.Added source lines against this PR's base: 259 added Python source lines; tests and documentation excluded.
Before your PR is "Ready for review"
Follow the Contributor guidelines and Security Coding Practices. Commits are signed and signed off.
CONTRIBUTING.md?: N/A - uses existing dependencies; no external source copied.Additional Information
Base: #3188. Merge after that PR; this slice builds on the preceding stack changes.
Merge order is 1 through 12. Review against the immediate base so earlier slices are excluded from this diff. Series: 1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12/12
Where lowering assumes finite FP32 data and may change signed zero. NaN/Inf equivalence is outside this arithmetic lowering contract.
Summary by CodeRabbit
Where,Not, andGreateroperations, using arithmetic-based alternatives in supported cases while preserving native behavior for unsupported cases.Unsqueezeoutputs, while retaining integer outputs for other consumers.