[Bugfix][Qwen3-Omni] Include deferred residual in captured Thinker states (#7304)

Signed-off-by: Deep Shah <deep@socratic.co>
This commit is contained in:
Deep Shah authored and GitHub committed 2026-09-16 11:36:52 -07:00
1 parent d4dba0ddb1
commit 4392af5ce3
2 files changed
+53 -3

No files matched your search

@@ -588,7 +588,10 @@ class Qwen3MoeLLMModel(_Qwen3MoeLLMModel):
if layer_idx in capture_set:
hs = captured_hidden_states.setdefault("hidden_states", {})
layers = hs.setdefault("layers", {})
layers[layer_idx] = hidden_states.clone().view(-1, hidden_states.shape[-1])
# vLLM defers the residual addition until the next RMSNorm.
# Reconstruct the logical decoder state before capturing it.
captured = hidden_states.clone() if residual is None else hidden_states + residual
layers[layer_idx] = captured.view(-1, captured.shape[-1])
hidden_states, residual = layer(
positions,