Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

CuArrays.randn(odd_number, another_odd_number) throws CURANDError #392

Closed
tkf opened this issue Aug 19, 2019 · 2 comments · Fixed by #399
Closed

CuArrays.randn(odd_number, another_odd_number) throws CURANDError #392

tkf opened this issue Aug 19, 2019 · 2 comments · Fixed by #399
Labels

Comments

@tkf
Copy link
Contributor

tkf commented Aug 19, 2019

Describe the bug

CuArrays.randn(11, 5) throws a CURANDError. Other combinations of odd numbers (e.g., CuArrays.randn(11, 5)) also throws.

To Reproduce

julia> CuArrays.randn(11, 5)
ERROR: CURANDError(code 105, Length requested is not a multple of dimension)
Stacktrace:
 [1] generate_normal(::CuArrays.CURAND.RNG, ::CuArray{Float32,2}, ::Int64, ::Int64) at /home/takafumi/.julia/dev/CuArrays/src/rand/error.jl:51
 [2] #randn!#3 at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:22 [inlined]
 [3] randn! at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:22 [inlined]
 [4] #randn!#19 at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:74 [inlined]
 [5] randn!(::CuArray{Float32,2}) at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:74
 [6] #randn#25(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Type{Float32}, ::Int64, ::Vararg{Int64,N} where N) at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:81
 [7] randn(::Type{Float32}, ::Int64, ::Vararg{Int64,N} where N) at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:81
 [8] #randn#29(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Int64, ::Vararg{Int64,N} where N) at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:87
 [9] randn(::Int64, ::Int64) at /home/takafumi/.julia/dev/CuArrays/src/rand/highlevel.jl:87
 [10] top-level scope at none:0

Expected behavior
It shouldn't throw.

Build log

(v1.1) pkg> build CuArrays
  Building CUDAnative → `~/.julia/packages/CUDAnative/nItlk/deps/build.log`
  Building Conda ─────→ `~/.julia/packages/Conda/kLXeC/deps/build.log`
  Building FFTW ──────→ `~/.julia/packages/FFTW/2okGQ/deps/build.log`

shell> cat ~/.julia/packages/CUDAnative/nItlk/deps/build.log

Environment details (please complete this section)
Details on Julia:

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, broadwell)

(v1.1) pkg> st CuArrays
    Status `~/.julia/environments/v1.1/Project.toml`
  [79e6a3ab] Adapt v1.0.0
  [be33ccc6] CUDAnative v2.2.1
  [3a865a2d] CuArrays v1.1.0 [`~/.julia/dev/CuArrays`]
  [1914dd2f] MacroTools v0.5.1
  [872c559c] NNlib v0.6.0
  [ae029012] Requires v0.5.2

julia> println(read(joinpath(dirname(dirname(pathof(CUDAnative))), "deps", "ext.jl"), String))
# autogenerated file, do not edit
const libcudadevrt = "/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcudadevrt.a"
const ptx_support = VersionNumber[v"3.2.0", v"4.0.0", v"4.1.0", v"4.2.0", v"4.3.0", v"5.0.0"]
const configured = true
const libdevice = Dict(v"3.0.0"=>"/usr/local/cuda-8.0/nvvm/libdevice/libdevice.compute_30.10.bc",v"3.5.0"=>"/usr/local/cuda-8.0/nvvm/libdevice/libdevice.compute_35.10.bc",v"5.0.0"=>"/usr/local/cuda-8.0/nvvm/libdevice/libdevice.compute_50.10.bc")
const nvdisasm = "/usr/local/cuda-8.0/bin/nvdisasm"
const target_support = VersionNumber[v"3.0.0", v"3.2.0", v"3.5.0", v"3.7.0", v"5.0.0", v"5.2.0", v"5.3.0", v"6.0.0", v"6.1.0", v"6.2.0"]
const cuda_driver_version = v"10.1.0"
const ptxas = "/usr/local/cuda-8.0/bin/ptxas"

I'm using CuArrays.jl 3ab04e2

@tkf tkf added the bug label Aug 19, 2019
@tkf tkf changed the title CuArrays.randn(11, 5) throws CURANDError CuArrays.randn(odd_number, another_odd_number) throws CURANDError Aug 19, 2019
@maleadt
Copy link
Member

maleadt commented Aug 23, 2019

With that PR:

julia> using CuArrays

julia> CuArrays.randn(11, 5)
11×5 CuArray{Float32,2}:
  0.292537    -0.665012   -1.29028    -1.13676    0.785245
 -0.718359     0.543361   -0.882222   -0.353028  -1.32038 
  0.0999969   -0.716751   -0.0649378   0.542733   0.466775
 -0.393198    -1.49132    -0.81823    -1.5026     1.24028 
  2.54702      1.48046     1.42658    -1.21751    0.835877
 -0.00343647   0.137359   -0.128527    1.24434    1.48455 
  0.00829232  -1.22076     0.281007   -0.265028   0.312494
 -0.250976     0.30717     0.829573   -1.4704     0.399408
  0.128979     1.11349    -0.747209   -0.989137  -0.887673
  0.372805    -0.0376158  -1.3797      0.279169   0.291944
  1.08216     -0.710872    0.995154    0.952599  -0.365164

@tkf
Copy link
Contributor Author

tkf commented Aug 23, 2019

Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants