Skip to content

Commit 1f878e2

Browse files
committed
Perform GC
Signed-off-by: Hui Gao <[email protected]>
1 parent ac8e0a6 commit 1f878e2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/integration/defs/accuracy/test_llm_api_pytorch.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,11 @@ def test_nvfp4_multi_gpus(self, tp_size, pp_size, ep_size, mtp_nextn, fp8kv,
22872287
sm_version = get_sm_version()
22882288
if moe_backend == "TRTLLM" and sm_version in (120, 121):
22892289
pytest.skip(f"{moe_backend} backend does not support SM 120 or 121")
2290+
2291+
import gc
2292+
gc.collect()
2293+
torch.cuda.empty_cache()
2294+
22902295
print(f"\n--- nvidia-smi start to test ---")
22912296
print_device_memory()
22922297

@@ -2330,6 +2335,10 @@ def test_nvfp4_multi_gpus(self, tp_size, pp_size, ep_size, mtp_nextn, fp8kv,
23302335
print("=================================== test finishes")
23312336
print_device_memory()
23322337

2338+
import gc
2339+
gc.collect()
2340+
torch.cuda.empty_cache()
2341+
23332342
time.sleep(180)
23342343
print(f"\n--- nvidia-smi after testing after 180s ---")
23352344
print_device_memory()

0 commit comments

Comments
 (0)