[Fix] DSA: skip-topk pipeline handoff for owed outputs (#43832)

Co-authored-by: Aarav <211792885+AaravMehta-07@users.noreply.github.com>
This commit is contained in:
Aarav
2026-10-16 14:35:23 -07:00
committed by GitHub
co-authored by Aarav
parent 71b60fa46c
commit d5d87899f9
2 changed files with 108 additions and 3 deletions
+2 -2
View File
@@ -3194,7 +3194,7 @@ class DeepseekV2Model(nn.Module):
topk_indices = index_topk_share.topk_indices
if (
not forward_batch.forward_mode.is_idle()
and hidden_states.shape[0] != 0
and proxy_tensors["hidden_states"].shape[0] != 0
):
assert topk_indices is not None, (
f"PP stage ending at layer {self.end_layer} must forward "
@@ -3202,7 +3202,7 @@ class DeepseekV2Model(nn.Module):
"skip-topk layer."
)
if topk_indices is None:
topk_indices = hidden_states.new_empty(
topk_indices = proxy_tensors["hidden_states"].new_empty(
(0, get_dsa_index_topk(self.config)), dtype=torch.int32
)
proxy_tensors.tensors["topk_indices"] = topk_indices