All-gather local logits along the vocab dimension to reconstruct [H, V_global].
(
logits: torch.Tensor, # [H, V_local]
)
| 75 | |
| 76 | |
| 77 | def _allgather_logits( |
| 78 | logits: torch.Tensor, # [H, V_local] |
| 79 | ) -> torch.Tensor: |
| 80 | """All-gather local logits along the vocab dimension to reconstruct [H, V_global].""" |
| 81 | return all_gather_tensor(logits, gather_dim=1, group=dist.group.WORLD) |
| 82 | |
| 83 | |
| 84 | def apply_top_k_top_p( |
no outgoing calls
no test coverage detected