unisim.backend.genesis.materialization.preserve_torch_globals¶
- unisim.backend.genesis.materialization.preserve_torch_globals(torch)[source]¶
Snapshot torch global defaults and restore them after
gs.init.gs.initmutates the host process: it forcestorch.set_default_device("cuda:0")on the GPU lane, and passingseed=would reseed the global RNG (REPORT #1372 §3.5 [10]). The adapter never passes a seed and restores default device/dtype plus the torch RNG state so the training process observes no pollution (REPORT #1372 §5.8).