Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve conflicts by recomputation #3625

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

naoyam
Copy link
Collaborator

@naoyam naoyam commented Dec 20, 2024

Stacked on top of #3611

This PR resolves the conflicts found by the analysis added at #3611 by recomputing slice/pad input tensors. With this, fusions like ResizeSchedulerTest.SliceRotateCatResidual can be scheduled as a single kernel by the resize scheduler.

Recomputation is not the only possible way to resolve conflicts. We could do, for example, cache a block of a input tensor such that multiple uses of the input can be done by just using the block. This would look more like a produce-based scheduling approach. I prototyped that approach here, but it didn't perform well for RoPE.

@naoyam naoyam force-pushed the resize_scheduler_recomputation branch from 5d1d07e to 7380a40 Compare December 20, 2024 00:48
@naoyam
Copy link
Collaborator Author

naoyam commented Dec 20, 2024

!test

Base automatically changed from resize_scheduler_exclusiveness to main December 20, 2024 04:19
@naoyam
Copy link
Collaborator Author

naoyam commented Dec 20, 2024

!test

@naoyam
Copy link
Collaborator Author

naoyam commented Dec 20, 2024

!test

@@ -133,6 +120,30 @@ bool ResizeScheduler::canScheduleCompileTime(Fusion* fusion) {
return false;
}

for (auto out_tv : ir_utils::filterByType<TensorView>(fusion->outputs())) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This check is needed since the non-exclusivity check is dropped. It was redundant before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Most of the changes here are due to the change of the output type of getNonExclusiveResizeInfo and are just mechanical changes.

@naoyam naoyam requested a review from jacobhinkle December 20, 2024 18:16
@naoyam naoyam marked this pull request as ready for review December 20, 2024 18:17
@naoyam naoyam added the rope label Dec 20, 2024
@naoyam naoyam marked this pull request as draft December 24, 2024 01:16
@naoyam
Copy link
Collaborator Author

naoyam commented Dec 24, 2024

Found a bug. Will update soon.

@naoyam
Copy link
Collaborator Author

naoyam commented Dec 24, 2024

!test

@naoyam naoyam marked this pull request as ready for review December 24, 2024 06:56
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.

1 participant