In this article
Replay requires the generator state, logical sample assignment, and draw schedule to remain consistent.
A seeded test changes after retuning
Consider a sampling kernel whose block layout changes during optimization. The application keeps its seed, but generated values are now attached to different simulation paths. This does not immediately establish a generator defect. The first question is which logical path owns each random state, and whether that ownership survived the launch change.
The device API overview discussed here concerns the legacy cuRAND device API. Its stateful interface must be distinguished from separately documented generator systems.
Philox initialization identifies a position
For curandStatePhilox4_32_10_t, curand_init receives a seed, subsequence, and offset. The device reference specifies the generator-specific overload. Treat that tuple as initialization metadata, not as a complete description of the application experiment.
A useful application design assigns subsequences to stable simulation identities. Mapping them directly to transient physical thread positions is convenient, but a later batching or sharding change can alter which identity receives which stream. Document that mapping alongside the seed.
Output counts do not define draw schedules
Distribution calls advance generator state. The overview explicitly warns that their consumption of underlying generator values is not generally fixed. Consequently, counting returned samples is insufficient to reconstruct the internal offset after an arbitrary sequence of distribution calls.
Vector functions such as curand_uniform4 also have their own contract. Replacing scalar calls with a vector call should be treated as a replay-sensitive algorithm change until equivalence is established for the actual implementation. Do not infer matching streams merely from an equal number of output values.
Preserve ownership across launches
A kernel can load its assigned state, generate values, and write the updated state back. Reinitializing that state on every launch instead restarts from the initialization position. Accidentally doing so can repeat samples while producing perfectly plausible histograms.
For a regression case, record the logical identity, initialization tuple, requested distribution sequence, and persisted state lifecycle. The broader RNG replay guide explains why process-level seed capture alone is incomplete.
Version records and useful comparisons
The compatibility statement describes source compatibility; this should not be promoted into an unrestricted bitwise replay promise across versions. Record the actual headers, toolchain, and executable artifact used by the experiment.
Compare values by logical simulation identity before comparing aggregate statistics. Only after that mapping is understood should an inference benchmark attribute a changed result to a faster launch configuration. These checks describe an experiment design, not measured performance of a particular deployment.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.