-
Notifications
You must be signed in to change notification settings - Fork 535
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
Reduce by key #2254
Reduce by key #2254
Conversation
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 only did a quick run through this PR. I didn't look into the logic just yet. There is a lot of stuff here. There are a couple of suggestions I have made. Your tests are only testing your float code paths. They should be testing all types. There is also a lot of repetition there. I think things can be improved. It is exciting that we will finally have a reduce by key in ArrayFire. Awesome work.
95d867e
to
cafdf69
Compare
@syurkevi Is this ready for review ? Has umar's feedback been addressed ? |
All outstanding feedback has been addressed, however we were also considering handling the multidimensional cases. If the multidimensional case needs to be added then it isn't ready yet. |
@syurkevi this doesn't build for me unless I add |
That's probably so because this branch is quite outdated from master. |
ef8af22
to
236e34a
Compare
236e34a
to
d8724c3
Compare
d8724c3
to
2fd02f0
Compare
97213b5
to
9592d01
Compare
Rebased latest master and minor repairs
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.
Looks good. I need to do another pass on the kernels of each backend.
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.
forge
's commit SHA is older than master's in this PR. Should that be updated?
Hi @mark-poscablo
Tks |
Hi @WilliamTambellini , we should probably ask the author @syurkevi, but I think this PR does not address that use case. Reduce by key would do something like the following: Using
It essentially does the reduction operation on groups, where elements that have the same keys are in the same group. |
adds multidimensional tests of varying sizes and types to match one dimensional cases
34ed8ee
to
c844c72
Compare
c844c72
to
f2ade27
Compare
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 have reviewed api level (c/cpp/unified) source code and CPU backend implementation. I am still going through CUDA backend. Will submit another set of comments once that is done.
@@ -43,11 +43,49 @@ namespace af | |||
AFAPI array sum(const array &in, const int dim, const double nanval); | |||
#endif | |||
|
|||
#if AF_API_VERSION >= 37 | |||
/** | |||
C++ Interface for sum of elements along given dimension by key |
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 there an order to the keys that will be present in the output keys for all the newly added *ByKey
functions ? We need to mention this somewhere in the documentation whatever the expectation should be.
Implements one dimensional reduce by key for all backends.