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

possible documentation error for initialization of Philox4x32-10 BRNG in MKL VSL

Norris__Peter
Beginner
460 Views

There seems to be a discrepancy between the method of initialization of the Philox-4x32-10 random number generator in the following two web-pages when more than a single 32-bit integer is used for initialization:

(1) https://software.intel.com/en-us/mkl-vsnotes-philox4x32-10
Stream Initialization by Function vslNewStreamEx

and the following article:

(2) https://software.intel.com/en-us/articles/new-counter-based-random-number-generators-in-intel-math-kernel-library

The case in (1) seems a bit odd to me, since k is meant to be a 64-bit (2x32-bit) key, while the counter c is a128-bit (4x32-bit). Yet, the method described for n>2 is trying to initialize k with more than 64-bits. Perhaps the text is wrong for (1) and that for n>2 the params[3,4,5,6] should instead be setting c?

Has anyone used this BRNG with multiple-word initialization?

Thanks.  P.

0 Kudos
1 Solution
Pavel_D_Intel1
Employee
460 Views

Hi Peter,
Thanks for bringing us this observation!

Yes, the description of the vslNewStreamEx function for Philox 4x32-10 in VS Notes contains a bug.
The right description is expected to be like this:

Philox4x32-10 generates the stream and initializes it specifying the array params[] of n 32-bit integers:

  1. If n = 0, assume c = k0 = k1 = 0.
  2. If n = 1, assume k = params[0], c = 0.
  3. If n = 2, assume k = params[0] + params[1]*232c = 0.
  4. If n = 3, assume k = params[0] + params[1]*232c = params[2].
  5. If n = 4, assume k = params[0] + params[1]*232c = params[2] + params[3]*232.
  6. If n = 5, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264.
  7. If n >= 6, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264 + params[5]*296.

We will update the documentation in one of the future releases of the library.

Regards,
Pavel

View solution in original post

0 Kudos
3 Replies
Pavel_D_Intel1
Employee
461 Views

Hi Peter,
Thanks for bringing us this observation!

Yes, the description of the vslNewStreamEx function for Philox 4x32-10 in VS Notes contains a bug.
The right description is expected to be like this:

Philox4x32-10 generates the stream and initializes it specifying the array params[] of n 32-bit integers:

  1. If n = 0, assume c = k0 = k1 = 0.
  2. If n = 1, assume k = params[0], c = 0.
  3. If n = 2, assume k = params[0] + params[1]*232c = 0.
  4. If n = 3, assume k = params[0] + params[1]*232c = params[2].
  5. If n = 4, assume k = params[0] + params[1]*232c = params[2] + params[3]*232.
  6. If n = 5, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264.
  7. If n >= 6, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264 + params[5]*296.

We will update the documentation in one of the future releases of the library.

Regards,
Pavel

0 Kudos
Norris__Peter
Beginner
460 Views

OK, Thanks Pavel!

0 Kudos
Gennady_F_Intel
Moderator
460 Views

The problem is escalated and this thread will be updated when the fix will be released.

0 Kudos
Reply