Have median reduce over all dims and return just the value if dim is not provided#1741
Have median reduce over all dims and return just the value if dim is not provided#1741lantiga wants to merge 4 commits intopytorch:masterfrom
Conversation
apaszke
left a comment
There was a problem hiding this comment.
The changes look good but are a bit incomplete. To properly support distributed master-worker you also need to add medianall as part of the Function enum, register the handler in master_worker/worker/Dispatch.cpp and add an RPC stub in master_worker/master/generic/THDTensor.* (both in header and the C file).
|
Thank you @apaszke, admittedly I didn't delve deep enough in distributed. Your pointers are a great start, I'll complete the PR asap. |
apaszke
left a comment
There was a problem hiding this comment.
Looks good now! Do you plan to add a THC implementation? For now it can just do:
- view as a flat vector
- sort
- memcpy the scalar
|
Sure thing |
|
Sorry @apaszke , I could only get to this today. I'm using but compilation fails complaining that |
|
Probably the answer is: use |
|
You can use |
|
Doh! |
|
With the last commit I added both median and medianall to THC. In the end I used @apaszke where should I move the two functions in terms of location? |
|
after this is rebased, this is good to go. |
|
@soumith rebased |
|
this is now merged into master. Thanks a lot Luca! |
Fixes pytorch#1741 Relaxing vectorization check to avoid false assert on strides for broadcasted domains Shamelessly stole Kevin's cpp repro.
…rch#1741) amax was removed from _scaled_mm by pytorch#128683. Remove it from the internal at::cuda::blas::scaled_gemm, as well. This allows hipBLASLt to find additional solutions rather than forcing amax to be used and then discarding the result. Pull Request resolved: pytorch#135421 Approved by: https://github.com/drisspg, https://github.com/eqy
Solves #1692.