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

Rewrite the rfactor scheduling directive #8490

Merged
merged 39 commits into from
Dec 27, 2024
Merged

Conversation

alexreinking
Copy link
Member

@alexreinking alexreinking commented Nov 24, 2024

Rewrite the rfactor scheduling directive.

The old implementation suffered from several serious issues. It duplicated substantial amounts of the logic in ApplySplit.cpp, the way it handled adapting the predicate to the reducing func was unprincipled, and it confused dims and vars in a way that could segfault. It also left the order of pure dimensions unspecified. The new implementation chooses to follow the existing dims list.

This PR corrects all of these issues while also being shorter, better organized, and hopefully more maintainable.

Fixes #7854

@alexreinking alexreinking changed the title Issues/7854 rfactor fixes Rewrite the rfactor scheduling directive Nov 24, 2024
@alexreinking alexreinking marked this pull request as ready for review December 5, 2024 16:31
@alexreinking
Copy link
Member Author

Since the failing tests are no longer related to this code, I think it's worth getting a first pass of feedback.

@steven-johnson
Copy link
Contributor

It would be helpful to add a bit of background about why the rewrite was necessary and how/why it's better now

@alexreinking
Copy link
Member Author

It would be helpful to add a bit of background about why the rewrite was necessary and how/why it's better now

I added some to the PR description

@alexreinking
Copy link
Member Author

Gentle review ping

src/Func.cpp Outdated Show resolved Hide resolved
src/Func.cpp Outdated Show resolved Hide resolved
src/Func.cpp Outdated Show resolved Hide resolved
src/Func.cpp Outdated Show resolved Hide resolved
src/Func.cpp Outdated Show resolved Hide resolved
src/Func.cpp Outdated Show resolved Hide resolved
src/Func.cpp Outdated Show resolved Hide resolved
@abadams
Copy link
Member

abadams commented Dec 10, 2024

Is there any meaningful fuzzing that we could use here to flush out corner cases? E.g. take a histogram, do some random splits and reorders of the vars and rvars, rfactor out some of the rvars, maybe do some more splits and reorders, compute the intermediate at some loop level of the reducing func, and then realize the whole thing and see if you get the right result.

@alexreinking
Copy link
Member Author

Is there any meaningful fuzzing that we could use here to flush out corner cases?

I think we'll hit this as I start to implement autoschedulers for PyTorch

Copy link
Member

@abadams abadams left a comment

Choose a reason for hiding this comment

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

Very nice. This is much more understandable.

@alexreinking alexreinking merged commit a9f82db into main Dec 27, 2024
19 checks passed
@alexreinking alexreinking deleted the issues/7854-rfactor-fixes branch December 27, 2024 18:38
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.

segfault on rfactoring an RVar produced by fusing a Var with an RVar
3 participants