Skip to content

New transform: Push indexing to only materialized nodes.#634

Open
kaushikcfd wants to merge 3 commits intomainfrom
indirection_pusher
Open

New transform: Push indexing to only materialized nodes.#634
kaushikcfd wants to merge 3 commits intomainfrom
indirection_pusher

Conversation

@kaushikcfd
Copy link
Collaborator

Generalizes the logic in #425.

@kaushikcfd kaushikcfd force-pushed the indirection_pusher branch 5 times, most recently from 35e4a63 to a15bd58 Compare February 20, 2026 19:43
@kaushikcfd kaushikcfd force-pushed the indirection_pusher branch 10 times, most recently from 8d1f516 to c42a786 Compare March 2, 2026 01:21
@kaushikcfd kaushikcfd changed the base branch from main to some_typing_fixes_0 March 2, 2026 01:22
@kaushikcfd kaushikcfd marked this pull request as ready for review March 2, 2026 01:22
@kaushikcfd kaushikcfd requested a review from inducer March 2, 2026 01:31
Base automatically changed from some_typing_fixes_0 to main March 2, 2026 01:36
@kaushikcfd kaushikcfd force-pushed the indirection_pusher branch 3 times, most recently from a1f0f4b to bf08e13 Compare March 2, 2026 07:21
@inducer inducer requested a review from Copilot March 2, 2026 14:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_nodes transform and export it from pytato.__init__.
  • Add extensive tests covering many indexing composition/broadcasting scenarios.
  • Add assert_allclose_to_ref test 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.

@kaushikcfd kaushikcfd force-pushed the indirection_pusher branch 3 times, most recently from 9b43f79 to 6dd89c4 Compare March 3, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants