[Elastic EP] Reuse CUDA graphs across reconfiguration (#54985)
This commit is contained in:
+17
-1
@@ -216,6 +216,8 @@ class ParallelConfig:
|
||||
|
||||
enable_elastic_ep: bool = False
|
||||
"""Enable elastic expert parallelism with stateless NCCL groups for DP/EP."""
|
||||
elastic_ep_max_dp_size: int = Field(default=None, ge=1) # type: ignore[assignment]
|
||||
"""Maximum data parallel size supported by elastic expert parallelism."""
|
||||
|
||||
enable_dbo: bool = False
|
||||
"""Enable dual batch overlap for the model executor."""
|
||||
@@ -435,7 +437,9 @@ class ParallelConfig:
|
||||
)
|
||||
"""The configurations for fault tolerance."""
|
||||
|
||||
@field_validator("disable_nccl_for_dp_synchronization", mode="wrap")
|
||||
@field_validator(
|
||||
"disable_nccl_for_dp_synchronization", "elastic_ep_max_dp_size", mode="wrap"
|
||||
)
|
||||
@classmethod
|
||||
def _skip_none_validation(cls, value: Any, handler: Callable) -> Any:
|
||||
"""Skip validation if the value is `None` when initialisation is delayed."""
|
||||
@@ -941,6 +945,18 @@ class ParallelConfig:
|
||||
" for dense models."
|
||||
)
|
||||
|
||||
max_dp_size = self.elastic_ep_max_dp_size
|
||||
self.elastic_ep_max_dp_size = (
|
||||
max_dp_size
|
||||
if self.enable_elastic_ep and max_dp_size is not None
|
||||
else self.data_parallel_size
|
||||
)
|
||||
if self.elastic_ep_max_dp_size < self.data_parallel_size:
|
||||
raise ValueError(
|
||||
"--elastic-ep-max-dp-size must be greater than or equal to "
|
||||
f"the initial data_parallel_size ({self.data_parallel_size})."
|
||||
)
|
||||
|
||||
self.data_parallel_index = self.data_parallel_rank
|
||||
|
||||
if self.distributed_executor_backend == "external_launcher":
|
||||
|
||||
Reference in New Issue
Block a user