Skip to content
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

argmax(::CuArray) returns nothing with NaN-values #553

Closed
simeonschaub opened this issue Nov 18, 2020 · 1 comment
Closed

argmax(::CuArray) returns nothing with NaN-values #553

simeonschaub opened this issue Nov 18, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@simeonschaub
Copy link

For regular arrays, argmax returns a valid index if NaNs are present:

julia> argmax([NaN32])
1

while for CuArray, this returns nothing:

julia> argmax(gpu([NaN32])) === nothing
true

Julia and CUDA versions:

julia> versioninfo()
Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen 9 3900X 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, znver2)

julia> CUDA.versioninfo()
CUDA toolkit 11.0.3, artifact installation
CUDA driver 11.0.0
/usr/bin/nvidia-modprobe: unrecognized option: "-f"

ERROR: Invalid commandline, please run `/usr/bin/nvidia-modprobe --help` for usage information.

/usr/bin/nvidia-modprobe: unrecognized option: "-f"

ERROR: Invalid commandline, please run `/usr/bin/nvidia-modprobe --help` for usage information.

NVIDIA driver 450.80.2

Libraries: 
- CUBLAS: 11.2.0
- CURAND: 10.2.1
- CUFFT: 10.2.1
- CUSOLVER: 10.6.0
- CUSPARSE: 11.1.1
- CUPTI: 13.0.0
- NVML: 11.0.0+450.80.2
- CUDNN: 8.0.4 (for CUDA 11.0.0)
- CUTENSOR: 1.2.1 (for CUDA 11.0.0)

Toolchain:
- Julia: 1.5.3
- LLVM: 9.0.1
- PTX ISA support: 3.2, 4.0, 4.1, 4.2, 4.3, 5.0, 6.0, 6.1, 6.3, 6.4
- Device support: sm_35, sm_37, sm_50, sm_52, sm_53, sm_60, sm_61, sm_62, sm_70, sm_72, sm_75

1 device:
  0: GeForce GTX 1080 Ti (sm_61, 10.355 GiB / 10.913 GiB available)
@simeonschaub simeonschaub added the bug Something isn't working label Nov 18, 2020
@maleadt
Copy link
Member

maleadt commented Nov 18, 2020

The reason:

julia> findmax([NaN32] |> cu)
(NaN32, nothing)

julia> findmax([NaN32])
(NaN32, 1)

Fixed by the alternative implementation in #320 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants