diffusers
a3e0b8ec - Synchronize the compute stream before offloading to disk (#14657)

Commit
6 days ago
Synchronize the compute stream before offloading to disk (#14657) `_offload_to_disk` releases the onloaded tensors at the end, returning their device memory to the allocator while the compute stream may still be reading them. The memory is then reused by the next onload, so the in-flight kernel reads foreign data and the output becomes NaN. `_offload_to_memory` already synchronizes for this reason, do the same on the disk path. Reproducer: tests/models/autoencoders/test_models_autoencoder_vidtok.py::TestAutoencoderVidTokMemory::test_group_offloading_with_disk[leaf_level-False]
Author
Parents
Loading