New transform: Push indexing to only materialized nodes.#634
Open
kaushikcfd wants to merge 3 commits intomainfrom
Open
New transform: Push indexing to only materialized nodes.#634kaushikcfd wants to merge 3 commits intomainfrom
kaushikcfd wants to merge 3 commits intomainfrom
Conversation
35e4a63 to
a15bd58
Compare
8d1f516 to
c42a786
Compare
a1f0f4b to
bf08e13
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new transform to push indexing operations down the expression DAG so that indexing happens only at (or is forced onto) materialized nodes, generalizing prior work in #425. This is accompanied by a substantial new test suite and a small testing helper to compare transformed vs. reference evaluation.
Changes:
- Introduce
pt.push_index_to_materialized_nodestransform and export it frompytato.__init__. - Add extensive tests covering many indexing composition/broadcasting scenarios.
- Add
assert_allclose_to_reftest helper for comparing two Pytato expressions by evaluation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pytato/transform/push_index_to_materialized_nodes.py |
New transform implementation that composes/pushes indices through various ops. |
pytato/__init__.py |
Exposes push_index_to_materialized_nodes as part of the public API. |
pytato/raising.py |
Adjusts ZerosLikeOp typing/raising for the new transform’s HLO lowering path. |
pytato/array.py |
Tweaks index-expression typing (ConvertibleToIndexExpr). |
test/testlib.py |
Adds assert_allclose_to_ref helper to compare two Pytato expressions via execution. |
test/test_transform.py |
New large test module for the indexing pusher transform. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9b43f79 to
6dd89c4
Compare
6dd89c4 to
16f0843
Compare
16f0843 to
ddb362a
Compare
ddb362a to
708e8ba
Compare
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.
Generalizes the logic in #425.