mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-mxnet] xidulu edited a comment on issue #15928: [RFC] A faster version of Gamma sampling on GPU.
Date Mon, 19 Aug 2019 11:07:37 GMT
xidulu edited a comment on issue #15928: [RFC] A faster version of Gamma sampling on GPU.
   The device-side api I mentioned is the `RandGenerator` class. (the one used in `ndarray.random()`),
it generates random number with `curand_uniform()`:
   Host api can be seen here (the one I used)

   Random numbers are generated with `curandGenerateUniform()`
   In terms of random number generation, `RandGenerator` (which is basically a wrapper over
the CUDA device api, IMO) may be comparable to mshadow/random. 
   ~However, is it possible that the overhead of _managing random states_ in `RandGenerator`
affects its performance ?~
   To find out the bottleneck of `ndarray.random()`, I remove the while loop in the kernel:
   The new version becomes ten times faster than the origin one:  160ms V.S 1600ms at size
10e7. (of course, some samples are not sampled correctly). 
   A few words about additional storage:
   In my experiment, I tracked the GPU memory usage with `watch -d -n 0.5 nvidia-smi` (the
   may be problematic), I discovered that my method, though explicitly requested for extra
storage, only consumed an acceptable amount of extra memory in practice. $ndarray.random.gamma()$
used around 2400Mb while my method used around 2500Mb when sampling 10e7 samples.

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:

With regards,
Apache Git Services

View raw message