determinism#

Best-effort determinism for reproducible runs.

Functions

enable_determinism

Seed every random number generator and ask PyTorch for deterministic kernels.

enable_determinism(seed)#

Seed every random number generator and ask PyTorch for deterministic kernels.

An operation without a deterministic kernel only warns, so repeated runs on the same hardware, software and parallel layout agree as closely as the remaining kernels allow. Call this at startup, before the first CUDA matmul: cuBLAS reads CUBLAS_WORKSPACE_CONFIG when it creates its handle. A value of that variable that is already set is kept, with a warning if cuBLAS does not treat it as deterministic.

Parameters:

seed (int)

Return type:

None