-
Notifications
You must be signed in to change notification settings - Fork 53
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
split inner reduction heuristics into 2d and 3d heuristics #3330
Conversation
!build |
!build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stamp for mechanical changes.
@@ -63,7 +63,7 @@ void reduceProductTo(int64_t& z, int64_t& y, int64_t& x, const int64_t max) { | |||
} | |||
} | |||
|
|||
std::unique_ptr<ReductionParams> innerReductionHeuristic( | |||
std::unique_ptr<ReductionParams> inner2dReductionHeuristic( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: this is renamed as a 2d reduction. But in the code comment, we refer to this as 1D schedule, which is a bit confusing.
csrc/scheduler/reduction.cpp
Outdated
debug() << rparams->toString() << std::endl; | ||
} | ||
|
||
// If 3d, check if it's supported by the scheduler, otherwise force 1D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I think I was mistaken. So if we do return rparams
at line 947, that's the 1d schedule this comment is referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 2D, we don't have 1D
scheduler.
!build |
|
||
} else { | ||
rparams->grid_dim_iter_dom = ParallelType::BIDx; | ||
if (gdimx > scheduler_utils::x_grid_limit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't gdimx
set to LaunchParams::UNINITIALIZED_VAL
here?
Therefore, this if-block is alway False.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤕 Is this supposed to be godim? And since this is just a copy of the old function, we also need to fix the other one then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤕 Is this supposed to be godim? And since this is just a copy of the old function, we also need to fix the other one then.
@rdspring1 added a fix in #3432 (comment)
What's in this PR?
This PR separates inner reduction heuristics into distinct 2D and 3D heuristic functions.
Why?
The 2D and 3D reductions represent different domain structures within the reduction tensor view:
These two configurations require different parallelization strategies, so keeping them in separate functions enhances maintainability and allows for individual optimization of each heuristic.
code changes
The existing
innerReductionHeuristic()
is duplicated asinner2dReductionHeuristic
andinner3dReductionHeuristic
, will cleaninner2dReductionHeuristic
in a separate PR.