Use NCCL instead of ray for control-plane communication to remove serialization overhead (#2221)

This commit is contained in:
Zhuohan Li
2024-01-03 11:30:22 -08:00
committed by GitHub
parent 1066cbd152
commit fd4ea8ef5c
34 changed files with 524 additions and 262 deletions
+4 -5
View File
@@ -1,4 +1,4 @@
from typing import List, Optional
from typing import Optional
import torch
@@ -16,28 +16,27 @@ class InputMetadata:
def __init__(
self,
prompt_lens: List[int],
is_prompt: bool,
slot_mapping: torch.Tensor,
max_context_len: Optional[int],
context_lens: Optional[torch.Tensor],
block_tables: Optional[torch.Tensor],
use_cuda_graph: bool,
) -> None:
self.prompt_lens = prompt_lens
self.is_prompt = is_prompt
self.max_context_len = max_context_len
self.slot_mapping = slot_mapping
self.context_lens = context_lens
self.block_tables = block_tables
self.use_cuda_graph = use_cuda_graph
self.is_prompt = len(prompt_lens) > 0
# Set during the execution of the first attention op.
# FIXME(woosuk): This is a hack.
self.attn_bias = None
def __repr__(self) -> str:
return ("InputMetadata("
f"prompt_lens={self.prompt_lens}, "
f"is_prompt={self.is_prompt}, "
f"max_context_len={self.max_context_len}, "
f"slot_mapping={self.slot_mapping}, "
f"context_lens={self.context_lens}, "