Support IPC for Expandable Segments (#130890)

This reapplication commit is the same as before except it resolves a build error in an internal build where `handle` was shadowed.

Differential Revision: [D60547506](https://our.internmc.facebook.com/intern/diff/D60547506)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130890
Approved by: https://github.com/dsjohns2
This commit is contained in:
zdevito
2024-08-02 09:49:22 -07:00
committed by PyTorch MergeBot
parent 618e2c9de4
commit 8d9c3a71f6
4 changed files with 260 additions and 63 deletions

View File

@ -98,9 +98,6 @@ TEST_CUDA_IPC = (
TEST_MULTIGPU = TEST_CUDA_IPC and torch.cuda.device_count() > 1
if TEST_CUDA_IPC:
torch.cuda.memory._set_allocator_settings("expandable_segments:False")
if not NO_MULTIPROCESSING_SPAWN:
# We want to use `spawn` if able because some of our tests check that the
# data loader terminiates gracefully. To prevent hanging in the testing