Skip to content

Commit 88d78d1

Browse files
Fix setting of memory fraction in test_garbage_collect_expandable (#1… (#2697)
Fixes SWDEV-551121 test_cuda.py::TestCudaOptimsCUDA::test_grad_scaling_autocast_fused_optimizers_AdamW_cuda_float32 test_cuda.py::TestCudaOptimsCUDA::test_grad_scaling_autocast_fused_optimizers_Adam_cuda_float32 test_cuda.py::TestCudaOptimsCUDA::test_grad_scaling_autocast_fused_optimizers_SGD_cuda_float32 Co-authored-by: rraminen <[email protected]>
1 parent 1d172a9 commit 88d78d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_cuda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4475,7 +4475,7 @@ def alloc(n):
44754475
# expandable_segment blocks can be in the free list when this is called.
44764476
alloc(80)
44774477
finally:
4478-
orig = torch.cuda.get_per_process_memory_fraction(0)
4478+
torch.cuda.memory.set_per_process_memory_fraction(orig)
44794479

44804480
def test_allocator_settings(self):
44814481
def power2_div(size, div_factor):

0 commit comments

Comments
 (0)