What aspects to consider before initializing Intel® MKL BRNGs?

To help you identify a correct strategy for seed generation, we consider several important aspects:

1. Intel® MKL random number generators are based on the deterministic algorithms. This feature helps you obtain the same random number sequence as soon as you initialize the same BRNG with the same seed. The “repeatability” property, which also takes place between runs of the application, can be useful during the tuning of your model and its parameters.

2. When you need different sequences of random numbers, for example between runs of the application, you should generate a new seed each time you initialize and use VSL BRNGs .
You can generate a new seed by means of tools that are “external” to Intel MKL, like a physical source of random numbers or system instruments, for example, time counters. Before choosing another seed in the new run of the application, consider the requirements of your task (why do you need different random number sequences for every new run of your application? what are expectations regarding random numbers (statistical properties, unpredictability, etc.) produced as a result of seeding by a system tool?)

3. If you provide an inappropriate value of seed to initialize the VSL BRNG, the library will set its default value, which is documented in VSL Notes.

4. Choice of the seed can impact the properties of the first BRNG outputs.
We consider two examples:
a. Due to specifics of the MT2203 algorithm, its parameters, and initialization procedure some seeds like 777 can result in a few first identical numbers obtained in different random streams associated with different MT2203 generators.
b. The VSL 31-bit multiplicative congruential generator MCG31m1 when initialized with the seed equal to 1 returns 1.0/ (double) (2^31-1) = 4.656612875245797E-010. For a small size dataset, this can result in biased statistical properties of the random number stream. A similar example can be provided for another VSL multiplicative congruential generator, MCG59.
If the described above situations are unacceptable, please discard the first few numbers of the random sequence or choose another seed that meets the needs requirements of your application.
For more complete information about compiler optimizations, see our Optimization Notice.