Skip to content

Commit 7a52036

Browse files
Fix setting of memory fraction in test_garbage_collect_expandable (#1… (#2696)
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 336f231 commit 7a52036

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
@@ -4305,7 +4305,7 @@ def alloc(n):
43054305
# expandable_segment blocks can be in the free list when this is called.
43064306
alloc(80)
43074307
finally:
4308-
orig = torch.cuda.get_per_process_memory_fraction(0)
4308+
torch.cuda.memory.set_per_process_memory_fraction(orig)
43094309

43104310
def test_allocator_settings(self):
43114311
def power2_div(size, div_factor):

0 commit comments

Comments
 (0)