Weight sync refactor + move sparse nccl engine (#44353)

Signed-off-by: hao-aaron <ahao@anyscale.com>
Signed-off-by: haoaaron <ahao@anyscale.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aaron Hao
2026-07-01 01:25:19 -07:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent f651a8a9a4
commit 77a9c5ae28
32 changed files with 951 additions and 1044 deletions
+12 -4
View File
@@ -12,7 +12,7 @@ from vllm.logger import init_logger
if TYPE_CHECKING:
import torch
from vllm.config.parallel import ParallelConfig
from vllm.config import VllmConfig
from vllm.config.weight_transfer import WeightTransferConfig
logger = init_logger(__name__)
@@ -76,14 +76,16 @@ class WeightTransferEngineFactory:
def create_engine(
cls,
config: "WeightTransferConfig",
parallel_config: "ParallelConfig",
vllm_config: "VllmConfig",
device: "torch.device",
model: "torch.nn.Module",
) -> WeightTransferEngine:
"""Create a weight transfer engine instance.
Args:
config: Weight transfer configuration containing the backend name
parallel_config: Parallel configuration for the engine
vllm_config: The full vLLM config (provides parallel/model config)
device: The device this worker's model lives on
model: The local model instance which will receive the weights
Returns:
@@ -106,7 +108,7 @@ class WeightTransferEngineFactory:
engine_cls.__name__,
)
return engine_cls(config, parallel_config, model)
return engine_cls(config, vllm_config, device, model)
# Register built-in weight transfer engines here.
@@ -124,3 +126,9 @@ WeightTransferEngineFactory.register_engine(
"vllm.distributed.weight_transfer.ipc_engine",
"IPCWeightTransferEngine",
)
WeightTransferEngineFactory.register_engine(
"sparse_nccl",
"vllm.distributed.weight_transfer.sparse_nccl_engine",
"SparseNCCLWeightTransferEngine",
)