In this article
A seed identifies initialization within a generator contract; it is not a complete multi-device replay record or a portable sequence promise.
Identify which generator a helper consumes
A preprocessing helper draws random masks through the global CuPy interface while a caller expects an explicit generator to control the experiment. The RandomState reference describes instance state and global instances used for different devices. Establish which object owns each random draw. Passing a generator to an outer function does not control a nested helper that ignores it and consumes unrelated global state instead.
Seed the intended device scope
The seed reference states that global seeding resets the generator for the current device without affecting other devices. A call made before switching devices is not a complete initialization procedure for a multi-GPU program. Map logical workers and devices to their intended generator initialization. Record that mapping explicitly rather than assuming that every accelerator starts from a shared process-wide random sequence after a single setup call.
Keep stateful call order visible
A generator advances as operations consume it. Adding a diagnostic sample or changing which helper executes first can change later random masks even when the initialization seed remains unchanged. Give independent consumers explicit ownership when their random decisions should remain independent of incidental call order. This is an application design choice, not a guarantee that arbitrary seeds produce statistically independent streams. Preserve the intended allocation of random decisions alongside the preprocessing algorithm.
Do not promise portable sequence equality
The CuPy random-sampling reference documents differences from NumPy, lack of serializable random states and the absence of a generator-identity guarantee across major versions. Store the actual library environment and generator choice in a replay record. A shared numerical seed is insufficient evidence that a different backend or upgraded environment will reproduce identical draws. When exact sampled artifacts matter, retain those artifacts or an appropriate supported reconstruction procedure as part of experiment provenance.
Test ownership with an intentional disturbance
Verify the expected device mapping, then insert a draw into a consumer that should be isolated and check whether unrelated outputs change. Use separate tests for distributional plausibility and exact replay. The guides on random-state replay and distributed loader ownership provide related context. Reproducibility requires a declared state-consumption contract; recording a seed without its generator, device scope and call structure explains only part of the experiment.
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.