numpy performance and random numbers

Carl Johan Rehn care02 at gmail.com
Sat Dec 19 12:02:38 EST 2009


On Dec 19, 4:47 pm, sturlamolden <sturlamol... at yahoo.no> wrote:
> On 19 Des, 16:20, Carl Johan Rehn <car... at gmail.com> wrote:
>
> > How about mulit-core or (perhaps more exciting) GPU and CUDA? I must
> > admit that I am extremely interested in trying the CUDA-alternative.
>
> > Obviously, cuBLAS is not an option here, so what is the safest route
> > for a novice parallel-programmer?
>
> The problem with PRNG is that they are iterative in nature, and
> maintain global states. They are therefore very hard to vectorize. A
> GPU will not help. The GPU has hundreds of computational cores that
> can run kernels, but you only get to utilize one.
>
> Parallel PRNGs are an unsolved problem in computer science.


>>>How did you time it?

Well, in Matlab I used "tic; for i = 1:1000, randn(100, 10000), end;
toc" and in IPython i used a similar construct but with "time" instead
of tic/(toc.


>>> Parallel PRNGs are an unsolved problem in computer science.

Thanks again for sharing your knowledge. I had no idea. This means
that if I want to speed up my application I have to go for the fastest
random generator and focus on other parts of my code that can be
vectorized.

Carl



More information about the Python-list mailing list