Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Do MKL's vsl RNG contains a warm up process during initialization?

balabi_b_
Beginner
521 Views

I recently read a paper http://www0.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf  in which the author pointed out how important initialization is in usage of PRNG and he suggested that a warm up is needed for every usage of PRNG. And there is also paper written by the author of Mersenne Twister called "Common Defects in Initialization of Pseudorandom Number Generators"

So I am wondering, when we use vslNewStream to initialize a stream of particular PRNG algorithm. Does it automatically take care of those traps in initialization of a particular PRNG? Does it contains a warm up already? Can I safely generate random number sequence immediately after vslNewStream or should I add a warm up myself?

0 Kudos
1 Solution
Andrey_N_Intel
Employee
521 Views

Hello,

Intel MKL random number generators do not apply any additional steps related to a warm-up. Initialization of each basic random number generator is documented in Vector Statistics Notes, https://software.intel.com/en-us/mkl-vsnotes. For example, https://software.intel.com/en-us/node/590402 describes how the library initializes MRG32K3a generator. Choice of the basic random number generator, a seed for it, as well as the method for distribution random number generator and other random number processing related  techniques are defined by requirements of the specific application and are expected to be done on the side of the user.

Please, note that the library provides the interface to HW RDRAND instruction based generator which can be considered as one of the options for generation of the seed. Additionally, this article https://software.intel.com/en-us/articles/initializing-Intel-MKL-BRNGs discusses some of the aspects related to seeding of Intel MKL RNGs.

Please, let me know if it helps.

Thanks,

Andrey 

View solution in original post

0 Kudos
3 Replies
Andrey_N_Intel
Employee
522 Views

Hello,

Intel MKL random number generators do not apply any additional steps related to a warm-up. Initialization of each basic random number generator is documented in Vector Statistics Notes, https://software.intel.com/en-us/mkl-vsnotes. For example, https://software.intel.com/en-us/node/590402 describes how the library initializes MRG32K3a generator. Choice of the basic random number generator, a seed for it, as well as the method for distribution random number generator and other random number processing related  techniques are defined by requirements of the specific application and are expected to be done on the side of the user.

Please, note that the library provides the interface to HW RDRAND instruction based generator which can be considered as one of the options for generation of the seed. Additionally, this article https://software.intel.com/en-us/articles/initializing-Intel-MKL-BRNGs discusses some of the aspects related to seeding of Intel MKL RNGs.

Please, let me know if it helps.

Thanks,

Andrey 

0 Kudos
balabi_b_
Beginner
521 Views

Andrey Nikolaev (Intel) wrote:

Hello,

Intel MKL random number generators do not apply any additional steps related to a warm-up...

Thank you very much, Andrey.

At first, I thought since MKL has wrapped everything into a unified interface, it probably takes care of everything inside.

I think the documentation is not elaborate enough on this aspect. If users didn't done enough investigation on PRNG. They probably won't know a warm up is need for safe use of PRNG, and different PRNG needs different length of warm up, some are quite long. However it is just not mentioned in the MKL documentation.

Reliable Information such as how long warm up should be safe for each PRNG is not easy for users to gather in a short time. I hope the documentation could elaborate on this in the future.

best regards

 

 

0 Kudos
Andrey_N_Intel
Employee
521 Views

Thank you for the feedback. We will analyze how the documentation on Intel MKL RNGs can be extended. Andrey

0 Kudos
Reply