[Bugfix][DP] Fix creating too many DP Placement Groups (#26880)

Signed-off-by: Kebe <mail@kebe7jun.com>
Signed-off-by: Rui Qiao <ruisearch42@gmail.com>
Co-authored-by: Rui Qiao <ruisearch42@gmail.com>
This commit is contained in:
Kebe 2025-10-24 05:16:51 +09:00 committed by GitHub
parent dbfbf9f324
commit 51dd14ac2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -497,6 +497,8 @@ class CoreEngineActorManager:
)
placement_groups.append(pg)
local_dp_ranks.append(i)
if len(placement_groups) == dp_size:
break
if len(placement_groups) < dp_size:
raise ValueError(
@ -506,6 +508,13 @@ class CoreEngineActorManager:
"Available resources: "
f"{available_resources}"
)
assert len(placement_groups) == dp_size, (
f"Created {len(placement_groups)} DP placement groups, expected {dp_size}"
)
assert len(local_dp_ranks) == dp_size, (
f"local_dp_ranks length {len(local_dp_ranks)} does not match "
f"expected {dp_size}"
)
return placement_groups, local_dp_ranks
@staticmethod