Skip to content

Commit acea51a

Browse files
committed
Clean up CUDA state between tests
1 parent 944be5a commit acea51a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_cuda.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ def test_out_of_memory_retry(self):
442442
IS_JETSON, "oom reporting has issues on jetson igx due to partial nvml support"
443443
)
444444
def test_set_per_process_memory_fraction(self):
445+
if torch.version.hip:
446+
torch.cuda.empty_cache()
447+
torch.cuda.reset_peak_memory_stats()
448+
445449
orig = torch.cuda.get_per_process_memory_fraction(0)
446450
try:
447451
# test invalid fraction value.

0 commit comments

Comments
 (0)