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
Shared-memory-cached kernel for
reduce_cols_by_key
to limit atomic conflicts #1050Shared-memory-cached kernel for
reduce_cols_by_key
to limit atomic conflicts #1050Changes from 2 commits
8ff8444
ee9254d
6f7e6fa
8bd7b9e
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.
Not part of this PR, but I wonder if there could someday be an overload of this function that would compute this value when not specified.
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.
Sure, but what kind of use cases do you have in mind? Since this primitive works with keys in the range
[0, nkeys[
it's fair to assumenkeys
will typically be known. For a more generic primitive working with arbitrary keys, we would first need to map them to such a range, and we can computenkeys
in the process.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.
Unless you mean that instead of passing
nkeys
we should get it from the dimensions ofout
, which actually makes a lot of sense.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.
Yeah, I guess the latter option makes sense. I was considering doing something similar in the knn APIs, since the shape of the output matrices already tell us k.
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 see the following options, let me know if you have a preference:
nkeys
a default value and ignore it, using output dims instead (might break compilation due to unused variable warning?)nkeys
a default value and if not overridden by the user, get it from the output dims.nkeys
arg (potentially breaking but I doubt anyone is using this prim outside the raft codebase?)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 second option looks good to me.
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.
@Nyrio do you want me to go ahead and merge this PR in the meantime?
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.
Since we aren't in a hurry, I just did the change in this PR. I'd rather put
nkeys
in last position so we can specifyreset_sums
and ignorenkeys
, but in the interest of not breaking the API I can't do that. If we don't mind breaking the API, I can simply remove the arg and always infer.