Ir para o conteúdo principal

Escrever uma avaliação PREreview

Portable, Seekable Random Streams for Parallel CPU Simulation

Publicado
Servidor
Preprints.org
DOI
10.20944/preprints202609.1244.v1

A long simulation that checkpoints its random generator and resumes on a different machine is relying on a property that std::mt19937 does not have. The C++ standard fixes the text format of an engine’s stream operators only partially, and the three major standard libraries disagree on both the numeric base of the digits and the order of the 624 state words. A checkpoint written under libstdc++ fails to load under the MSVC standard library, and loads without any diagnostic, at the wrong position,under libc++. This paper describes vphilox, a header-only C++20 library that removes the failure by changing what is stored. The generator is Philox4x32-10, a counter-based construction whose entire state is a key and a position, so a checkpoint is six 32-bit integers and a word offset, not a snapshot of engine internals. The same property gives constant-time seek and gives each worker an independent substream with no coordination, so a task draws the same numbers whatever the thread count and schedule. The cost of those properties is the question the design has to answer, because the earlier attempt to adopt Philox in a production machine-learning library was rejected on the grounds that scalar Philox runs at one tenth the speed of the Mersenne Twister. We report that the tenfold penalty did not reproduce on any of five processors measured, and that interleaving independent counters across SIMD lanes brings the generator to between 0.22× and 0.75× the cost per byte of std::mt19937 on the bulk path. Aggregate cost per byte is flat across thread counts, and the first parallel limit we find is hyperthread co-location, not the generator.

Você pode escrever uma avaliação PREreview de Portable, Seekable Random Streams for Parallel CPU Simulation. Uma avaliação PREreview é uma avaliação de um preprint e pode variar de algumas frases a um parecer extenso, semelhante a um parecer de revisão por pares realizado por periódicos.

Antes de começar

We will ask you to log in with your ORCID iD. If you don’t have an iD, you can create one.

What is an ORCID iD?

An ORCID iD is a unique identifier that distinguishes you from everyone with the same or similar name.

Começar agora