Skip to main content

validate_swarm

Function validate_swarm 

Source
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:

  1. Every peers[].service reference resolves to a known service.
  2. There is exactly one member with role: coordinator.
  3. All members agree on layer_count.
  4. The stage members 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.