[Bugfix] Fix /wake_up crash on hybrid models (Mamba/DeltaNet) (#41602)

Signed-off-by: Kevin Glynn <kevglynn@gmail.com>
This commit is contained in:
Kevin Glynn
2026-07-29 00:17:35 +00:00
committed by GitHub
parent fe65aa6a97
commit 56f31af62a
2 changed files with 66 additions and 3 deletions
+10 -3
View File
@@ -991,9 +991,16 @@ class GPUModelRunner(
return
kv_caches = getattr(self, "kv_caches", [])
for cache_tensor in kv_caches:
if cache_tensor is not None:
cache_tensor.zero_()
for cache_entry in kv_caches:
if cache_entry is None:
continue
# Hybrid models (Mamba, DeltaNet) store per-layer state as a
# list of tensors rather than a single tensor.
if isinstance(cache_entry, list):
for t in cache_entry:
t.zero_()
else:
cache_entry.zero_()
k_attr_names = ("_k_scale", "k_scale")
v_attr_names = ("_v_scale", "v_scale")