Skip to content

Factor out code that maps input layout to output root.#1587

Merged
wujingyue merged 3 commits intomainfrom
wjy/factor
Jan 6, 2024
Merged

Factor out code that maps input layout to output root.#1587
wujingyue merged 3 commits intomainfrom
wjy/factor

Conversation

@wujingyue
Copy link
Collaborator

This is a follow-up to #1584 (comment).

This also comes with a refactor to mergeContiguity so handle(ViewOp) can use mapInLayoutToOutRoot. I can split that out if you find it hard to review.

…ayout.

This PR also comes with a refactor to `mergeContiguity` so
`handle(ViewOp)` can use `mapInLayoutToOutRoot`. I can split that out if
you find it hard to review.
@wujingyue wujingyue requested a review from jacobhinkle January 5, 2024 00:58
@wujingyue
Copy link
Collaborator Author

!build

@wujingyue wujingyue requested a review from Priya2698 January 5, 2024 03:23
}
for (const auto i : c10::irange(out_root_layout->size())) {
allocation_to_contiguity.pushBack(
in_allocation_id, in_layout.contiguity[i]);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Context: to work around #1174, allocation_to_contiguity may contain IterDomains both from the input TV and from the output. This however is unnecessary. The new code only puts output IterDomains in allocation_to_contiguity and looks up out_root_to_in_rfactor for expanded extents. It has the equivalent behavior but is more intuitive and doesn't need the in_rfactor_to_out_root map.

Copy link
Collaborator

@Priya2698 Priya2698 left a comment

Choose a reason for hiding this comment

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

LGTM

@wujingyue wujingyue merged commit 8f343a4 into main Jan 6, 2024
@wujingyue wujingyue deleted the wjy/factor branch January 6, 2024 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants