Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add functions for retrieving the default tile sizes in MDRangePolicy #6839
base: develop
Are you sure you want to change the base?
Add functions for retrieving the default tile sizes in MDRangePolicy #6839
Changes from 1 commit
80ed305
3911681
879ca05
2f5ce8e
8e99bb2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why is this one called
tile_length_*
while all the others aretile_size_*
? We don't usetile_length
anywhere else.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.
I had mixed thoughts on this. Unlike the other two functions, this one only returns a length of a tile in 1 dimension (of a specified rank). But in the interest of keep the interfaces consistent, changed it to
tile_size_*
.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.
Lets only expose
tile_size_recommended
andmax_total_tile_size
, I am not sure how a user would correctly uselargest_tile_size_recommended
which really is more like a "recommended tile size in the rank which corresponds to the fastest iteration".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.
Removed
largest_tile_size_recommended()
.I have no strong opinion on keeping or removing it. But for Cuda/HIP/SYCL, the tile size of '16' is used by default in the rank with the fastest iteration. Users won't have access to this default number without this function.
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.
Please assert that the recommended tile size is "valid", that is the tile size is non-negative (if appropriate) for each dimension and the total flattened size does not exceed the 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.
Added checks to confirm that the recommended tile size per rank is positive value and is less than the recommended largest tile size per rank.
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.
As for checking the total flattened size not exceeding the limit, I was going to add the following unit test:
but it seems that there may be some deficiencies in
MDRangePolicy
that checks for this condition.kokkos/core/src/KokkosExp_MDRangePolicy.hpp
Lines 379 to 387 in 98b1a38
Currently the product of all tile sizes are checked against
properties.max_threads
instead ofproperties.max_total_tile_size
. For Cuda and HIP,properties.max_total_tile_size != properties.max_threads
, so some inconsistencies are found when running the unit test. I think this part will need to be addressed separately.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.
I am confused about what that test is trying to achieve.
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.
The main purpose of this test is to verify that the new functions are correctly returning the default tile sizes that are internally used during the construction of
MDRangePolicy
. Some of these are used from the values set in a function for each backend:kokkos/core/src/KokkosExp_MDRangePolicy.hpp
Lines 143 to 152 in 98b1a38
with exception to the last rank of the policy.
So, the test is checking against the internal value to confirm that the function will be returning the right values.