[Config] Remove diffusion_batch_size and use max_num_seqs instead. (#6484)
Signed-off-by: LyxWxj <yuxuanlou621@foxmail.com> Signed-off-by: Yuxuan Rho <104440472+LyxWxj@users.noreply.github.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
8e26dce1f4
commit
7992c2213e
16 files changed
+36
-95
No files matched your search
@@ -129,7 +129,6 @@ class AsyncOmniEngine:
|
||||
model: str,
|
||||
stage_init_timeout: int = 300,
|
||||
init_timeout: int = 600,
|
||||
diffusion_batch_size: int = 1,
|
||||
single_stage_mode: bool = False,
|
||||
transfer_emitter: Any = None,
|
||||
prom_metrics: Any = None,
|
||||
@@ -140,7 +139,6 @@ class AsyncOmniEngine:
|
||||
) -> None:
|
||||
self.model = model
|
||||
self.tokenizer = tokenizer
|
||||
self.diffusion_batch_size = diffusion_batch_size
|
||||
# Cached by get_diffusion_od_config().
|
||||
self._diffusion_od_config_view: Any = None
|
||||
startup_timeout = int(init_timeout)
|
||||
@@ -320,7 +318,6 @@ class AsyncOmniEngine:
|
||||
config_path=self.config_path,
|
||||
single_stage_mode=self.single_stage_mode,
|
||||
stage_init_timeout=stage_init_timeout,
|
||||
diffusion_batch_size=self.diffusion_batch_size,
|
||||
async_chunk=self.async_chunk,
|
||||
tokenizer=self.tokenizer,
|
||||
single_stage_id_filter=self._single_stage_id_filter,
|
||||
|
||||
@@ -1546,7 +1546,6 @@ def launch_diffusion_stage_replica(
|
||||
stage_config: Any,
|
||||
metadata: Any,
|
||||
stage_init_timeout: int,
|
||||
batch_size: int,
|
||||
use_inline: bool,
|
||||
replica_id: int = 0,
|
||||
omni_master_server: OmniMasterServer | None = None,
|
||||
@@ -1565,7 +1564,6 @@ def launch_diffusion_stage_replica(
|
||||
stage_config,
|
||||
metadata,
|
||||
stage_init_timeout=stage_init_timeout,
|
||||
batch_size=batch_size,
|
||||
use_inline=use_inline,
|
||||
)
|
||||
return client, StageReplicaResources()
|
||||
@@ -1624,7 +1622,6 @@ def launch_diffusion_stage_replica(
|
||||
request_address=proc_manager.addresses.inputs[0],
|
||||
response_address=proc_manager.addresses.outputs[0],
|
||||
proc_manager=proc_manager,
|
||||
batch_size=batch_size,
|
||||
)
|
||||
return client, StageReplicaResources(
|
||||
manager=proc_manager,
|
||||
|
||||
@@ -1813,7 +1813,6 @@ def initialize_diffusion_stage(
|
||||
stage_cfg: Any,
|
||||
metadata: StageMetadata,
|
||||
stage_init_timeout: int,
|
||||
batch_size: int = 1,
|
||||
use_inline: bool = False,
|
||||
) -> Any:
|
||||
"""Build a diffusion stage client.
|
||||
@@ -1823,15 +1822,12 @@ def initialize_diffusion_stage(
|
||||
stage_cfg: Stage configuration.
|
||||
metadata: Extracted stage metadata.
|
||||
stage_init_timeout: Timeout in seconds for stage initialization handshake
|
||||
batch_size: Client-side request batch width. Does not set scheduler
|
||||
``max_num_seqs``; pass ``--max-num-seqs`` or stage YAML for that.
|
||||
Forwarded to ``StageDiffusionClient``.
|
||||
use_inline: If True, uses the inline diffusion client instead of subprocess.
|
||||
"""
|
||||
from vllm_omni.diffusion.stage_diffusion_client import create_diffusion_client
|
||||
|
||||
od_config = build_diffusion_config(model, stage_cfg, metadata)
|
||||
return create_diffusion_client(model, od_config, metadata, stage_init_timeout, batch_size, use_inline)
|
||||
return create_diffusion_client(model, od_config, metadata, stage_init_timeout, use_inline)
|
||||
|
||||
|
||||
def _stage_declares_cfg_pairs(model_config: Any) -> bool:
|
||||
|
||||
@@ -87,7 +87,6 @@ class StageRemoteFactoryContext:
|
||||
base_metadata: Any
|
||||
vllm_config: Any | None = None
|
||||
executor_class: type | None = None
|
||||
diffusion_batch_size: int = 1
|
||||
|
||||
|
||||
def _build_load_balancer_factory(policy: str) -> Callable[[], LoadBalancer]:
|
||||
@@ -124,7 +123,6 @@ class StageRuntime:
|
||||
config_path: str,
|
||||
*,
|
||||
stage_init_timeout: int,
|
||||
diffusion_batch_size: int,
|
||||
async_chunk: bool,
|
||||
tokenizer: str | None = None,
|
||||
log_stats: bool = False,
|
||||
@@ -133,7 +131,6 @@ class StageRuntime:
|
||||
self._model = model
|
||||
self._config_path = config_path
|
||||
self._stage_init_timeout = stage_init_timeout
|
||||
self._diffusion_batch_size = diffusion_batch_size
|
||||
self._async_chunk = async_chunk
|
||||
self._tokenizer = tokenizer
|
||||
self._log_stats = log_stats
|
||||
@@ -672,7 +669,6 @@ class StageRuntime:
|
||||
stage_config=plan.stage_cfg,
|
||||
metadata=plan.metadata,
|
||||
stage_init_timeout=stage_init_timeout,
|
||||
batch_size=self._diffusion_batch_size,
|
||||
use_inline=plan.num_replicas == 1
|
||||
and bool(self._num_stages == 1 or inline_diffusion or custom_pipeline_args),
|
||||
replica_id=plan.replica_id,
|
||||
@@ -681,10 +677,9 @@ class StageRuntime:
|
||||
)
|
||||
|
||||
logger.info(
|
||||
"[StageRuntime] Stage %s replica %s initialized (diffusion, batch_size=%d)",
|
||||
"[StageRuntime] Stage %s replica %s initialized (diffusion)",
|
||||
plan.metadata.stage_id,
|
||||
plan.replica_id,
|
||||
self._diffusion_batch_size,
|
||||
)
|
||||
return cast(StagePoolClient, client)
|
||||
except Exception:
|
||||
@@ -768,7 +763,6 @@ class DistStageRuntime(StageRuntime):
|
||||
config_path: str,
|
||||
*,
|
||||
stage_init_timeout: int,
|
||||
diffusion_batch_size: int,
|
||||
async_chunk: bool,
|
||||
single_stage_id_filter: int | None,
|
||||
omni_master_address: str,
|
||||
@@ -785,7 +779,6 @@ class DistStageRuntime(StageRuntime):
|
||||
model=model,
|
||||
config_path=config_path,
|
||||
stage_init_timeout=stage_init_timeout,
|
||||
diffusion_batch_size=diffusion_batch_size,
|
||||
async_chunk=async_chunk,
|
||||
tokenizer=tokenizer,
|
||||
log_stats=log_stats,
|
||||
@@ -914,7 +907,6 @@ class DistStageRuntime(StageRuntime):
|
||||
base_metadata=metadata,
|
||||
vllm_config=plan.stage_vllm_config,
|
||||
executor_class=plan.executor_class,
|
||||
diffusion_batch_size=self._diffusion_batch_size,
|
||||
)
|
||||
return self._create_remote_replica_client(ctx, plan.replica_id)
|
||||
|
||||
@@ -977,7 +969,6 @@ class DistStageRuntime(StageRuntime):
|
||||
base_metadata=template.metadata,
|
||||
vllm_config=template.stage_vllm_config,
|
||||
executor_class=template.executor_class,
|
||||
diffusion_batch_size=self._diffusion_batch_size,
|
||||
)
|
||||
return contexts
|
||||
|
||||
@@ -1045,7 +1036,6 @@ class DistStageRuntime(StageRuntime):
|
||||
metadata,
|
||||
request_address=resources.addresses.inputs[0],
|
||||
response_address=resources.addresses.outputs[0],
|
||||
batch_size=ctx.diffusion_batch_size,
|
||||
)
|
||||
logger.info(
|
||||
"[DistStageRuntime] Remote diffusion replica attached stage=%d replica=%d",
|
||||
@@ -1109,7 +1099,6 @@ def create_stage_runtime(
|
||||
*,
|
||||
single_stage_mode: bool,
|
||||
stage_init_timeout: int,
|
||||
diffusion_batch_size: int,
|
||||
async_chunk: bool,
|
||||
tokenizer: str | None = None,
|
||||
# Distributed-only params:
|
||||
@@ -1131,7 +1120,6 @@ def create_stage_runtime(
|
||||
model=model,
|
||||
config_path=config_path,
|
||||
stage_init_timeout=stage_init_timeout,
|
||||
diffusion_batch_size=diffusion_batch_size,
|
||||
async_chunk=async_chunk,
|
||||
tokenizer=tokenizer,
|
||||
log_stats=log_stats,
|
||||
@@ -1148,7 +1136,6 @@ def create_stage_runtime(
|
||||
model=model,
|
||||
config_path=config_path,
|
||||
stage_init_timeout=stage_init_timeout,
|
||||
diffusion_batch_size=diffusion_batch_size,
|
||||
async_chunk=async_chunk,
|
||||
tokenizer=tokenizer,
|
||||
log_stats=log_stats,
|
||||
|
||||
Reference in new issue
Block a user