[Misc] Refactor static stage metadata lookups (#7602)
Signed-off-by: Nick Cao <ncao@redhat.com> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
1 parent
1586c41ae4
commit
1d3dc8bf83
5 files changed
+41
-18
No files matched your search
@@ -186,7 +186,7 @@ class AsyncOmni(AsyncOmniBase, EngineClient):
|
||||
|
||||
# Reject diffusion list-prompt early with a clear API error.
|
||||
if isinstance(prompt, list) and any(
|
||||
getattr(client, "stage_type", "") == "diffusion" for client in getattr(self.engine, "stage_clients", [])
|
||||
stage_config.stage_type == "diffusion" for stage_config in self.engine.stage_configs
|
||||
):
|
||||
raise ValueError(
|
||||
"Diffusion stages accept only a single prompt per request. "
|
||||
@@ -626,7 +626,7 @@ class AsyncOmni(AsyncOmniBase, EngineClient):
|
||||
|
||||
def _split_stage_ids_by_type(self, stage_ids: list[int] | None = None) -> tuple[list[int], list[int]]:
|
||||
"""Split stage ids into AR/LLM (EngineCore) vs diffusion (worker RPC)."""
|
||||
n_stages = len(self.engine.stage_clients)
|
||||
n_stages = len(self.engine.stage_configs)
|
||||
if stage_ids is None:
|
||||
stage_ids = list(range(n_stages))
|
||||
else:
|
||||
@@ -640,8 +640,8 @@ class AsyncOmni(AsyncOmniBase, EngineClient):
|
||||
ar_stage_ids: list[int] = []
|
||||
diffusion_stage_ids: list[int] = []
|
||||
for sid in stage_ids:
|
||||
client = self.engine.stage_clients[sid]
|
||||
if getattr(client, "stage_type", "llm") == "diffusion":
|
||||
stage_config = self.engine.stage_configs[sid]
|
||||
if stage_config.stage_type == "diffusion":
|
||||
diffusion_stage_ids.append(sid)
|
||||
else:
|
||||
ar_stage_ids.append(sid)
|
||||
|
||||
Reference in new issue
Block a user