(H: int)
| 854 | return logits, indices |
| 855 | |
| 856 | |
| 857 | @nvtx.annotate() |
| 858 | def flashinfer_sampling_from_logits( |
| 859 | weights: torch.Tensor, # [V, D] |
| 860 | hidden_states: torch.Tensor, # [n_hidden_states, D] |
| 861 | num_samples: int, |
| 862 | temperature: torch.Tensor, # scalar (0-d) |
| 863 | tp: "TPInfo" = TP1, |
| 864 | **_kwargs, |