pub fn validate_swarm(spec: &DeploymentSpec) -> Result<(), ValidationError>Expand description
Validate pipeline-parallel inference swarm invariants.
Services that declare resources.gpu.sharding are grouped by swarm_id.
For each swarm group this checks:
- Every
peers[].servicereference resolves to a known service. - There is exactly one member with
role: coordinator. - All members agree on
layer_count. - The
stagemembers form a contiguous[0, layer_count)cover with no gaps and no overlaps.
ยงErrors
Returns a validation error if any of the above invariants is violated.