From c1e365fea09aafda387cac12fdff43d28c598979 Mon Sep 17 00:00:00 2001
From: BienBoy <92378515+BienBoy@users.noreply.github.com>
Date: 星期六, 01 二月 2025 23:29:34 +0800
Subject: [PATCH] fix: resolve unexpected 'out of memory' issue in multi-GPU setup (#2373)
---
funasr/bin/train.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/funasr/bin/train.py b/funasr/bin/train.py
index fcd763f..d0f154a 100644
--- a/funasr/bin/train.py
+++ b/funasr/bin/train.py
@@ -221,7 +221,8 @@
)
trainer.start_step = 0
- torch.cuda.empty_cache()
+ with torch.cuda.device(kwargs["device"]):
+ torch.cuda.empty_cache()
time_escaped = (time.perf_counter() - time_slice_i) / 3600.0
logging.info(
--
Gitblit v1.9.1