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]
J
jiqing-feng committed
a3e0b8ec235c27a6c17a21976daf7fd32d819d05
Parent: 7a4e1e3
Committed by GitHub <noreply@github.com>
on 9/18/2026, 12:06:16 PM