Skip to content

Commit 7c53a3d

Browse files
author
puppy
committed
test op-cumsum
1 parent d252e36 commit 7c53a3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vllm_ascend/sample/sampler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _apply_top_k_top_p(
5151
logits.masked_fill_(elements_to_discard, -float("inf"))
5252

5353
if p is not None:
54-
cumprob = torch.cumsum(probs_sort, dim=-1)
54+
cumprob = torch.cumsum(probs_sort.to(torch.float32), dim=-1).to(probs_sort.dtype)
5555
top_p_mask = cumprob <= 1 - p.unsqueeze(dim=1)
5656
top_p_mask[:, -1] = False # at least one
5757

0 commit comments

Comments
 (0)