Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

fix(router): free XPU memory on eviction, guarded for builds without torch.xpu

Lim, Xiang Yang7d2fad9d4c6b
diff --git a/laya/router.py b/laya/router.py
index 6becc646..b4b0adf0 100644
--- a/laya/router.py
+++ b/laya/router.py
@@ -362,6 +362,8 @@ class Router(HookRegistry):
import torch
if torch.cuda.is_available():
torch.cuda.empty_cache()
+ if hasattr(torch, "xpu") and torch.xpu.is_available():
+ torch.xpu.empty_cache()
except Exception:
pass
self._dispatch_lifecycle("on_evict", freed)