Skip to content

Relax the allocation domain constraint. #1492

Merged
wujingyue merged 4 commits intomainfrom
wjy/alloc
Dec 12, 2023
Merged

Relax the allocation domain constraint. #1492
wujingyue merged 4 commits intomainfrom
wjy/alloc

Conversation

@wujingyue
Copy link
Collaborator

@wujingyue wujingyue commented Dec 9, 2023

Currently, MarkAliasPass skips an output when its allocation domain is set at all. This PR makes it smarter to check compliance.

This PR prepares #1478 for landing. Before segmentation, we'll run alias analysis on the un-segmented fusion and mark layouts for aliasing. During scheduling, we'll run alias analysis again on segmented fusions and have to recognize the preferred layout is compliant with the previously marked layout.

@wujingyue
Copy link
Collaborator Author

!build

@wujingyue wujingyue changed the base branch from main to wjy/alias December 11, 2023 06:41
Base automatically changed from wjy/alias to main December 11, 2023 21:54
Copy link
Collaborator

@jjsjann123 jjsjann123 left a comment

Choose a reason for hiding this comment

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

LGTM

at::Tensor out_tensor = out_tensors[0];
testValidate(fec.fusion(), {out_tensor}, {in_tensor}, __LINE__, __FILE__);

EXPECT_TRUE(out_tensor.is_alias_of(in_tensor));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

cc'ing @kevinstephano since you were asking about support like this earlier.

@wujingyue
Copy link
Collaborator Author

!build

@wujingyue wujingyue merged commit f3ff377 into main Dec 12, 2023
@wujingyue wujingyue deleted the wjy/alloc branch December 12, 2023 01:34
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