You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/08/19 19:16:34 UTC

[GitHub] [incubator-mxnet] drivanov commented on issue #15560: Add fp16 support for topk

drivanov commented on issue #15560: Add fp16 support for topk
URL: https://github.com/apache/incubator-mxnet/pull/15560#issuecomment-522716553
 
 
   @anirudhacharya: I see couple bugs in _sort_op-inl.cuh_, which show up when fp16 for topK is implemented. First of all, the lines 52, 63 are identical (see https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/sort_op-inl.cuh):
   ```return static_cast<mshadow::half::half_t>(lhs) < static_cast<mshadow::half::half_t>(rhs);```
   therefore:
   ```
   cuda::less_half<half>()
   cuda::greater_half<half>()
   ```
   are identical too.
   Second, instead of 
   ```
       thrust::stable_sort_by_key(
         thrust::cuda::par.on(stream),
             key_iter, key_iter + (keys.size(0)), value_iter, cuda::greater_half<half>());
   ```
   (here and on couple of other places) we should use 
   ```
       thrust::stable_sort_by_key(
         thrust::cuda::par.on(stream),
             key_iter, key_iter + (keys.size(0)), value_iter.get(), cuda::greater_half<half>());
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services