Skip to content

Commit

Permalink
Squash IBM/vllm 22
Browse files Browse the repository at this point in the history
  • Loading branch information
tjohnson31415 committed May 13, 2024
1 parent 9300e7e commit fc9fe28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vllm/model_executor/layers/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ def _get_ranks(x: torch.Tensor, indices: torch.Tensor) -> torch.Tensor:
"""
vals = x[torch.arange(0, len(x), device=x.device, dtype=indices.dtype),
indices]
return (x > vals[:, None]).long().sum(1).add_(1)
result = (x > vals[:, None])
del vals
return result.sum(1).add_(1)


def _get_logprobs(
Expand Down

0 comments on commit fc9fe28

Please sign in to comment.