Scheduler: count split-worker memory when placing a model on a node
When a distributed-mode backend node has P2P split workers attached (llama.cpp RPC or MLX workers that lend memory to a node), the model scheduler does not count that extra memory. It only looks at the memory of the node itself.
What happens today
- A model that is too big for a node alone, but fits across the node and its split workers, is not seen as a fit for that node.
- A big model can instead be placed on a node that has no split workers.
- The workaround is to pin the model to the node with a placement rule.
What we want
- The scheduler adds the usable memory of a node's attached split workers (online ones, and only those the node may use, for example not over a slow relay path unless the admin allowed it) to the node's capacity when it picks a node for a model.
- The Nodes page shows the capacity with and without split workers, so an admin can see why a model landed where it did.
- A split worker that leaves or goes offline lowers the capacity again, and a model that no longer fits is not placed there.
Open points
- How to treat a worker that is attached to a node but currently on a slow path.
- Whether models already loaded across workers should block a reassignment of the worker.
Related
Split workers for distributed-mode backend nodes (P2P work, in the combined P2P and websocket change).
A use case for this: workers with small GPUs, where one big model fits none of them alone.
Most of the time each card runs its own models as a normal distributed node. Occasionally we want one model spread across all of them. Today we do that with llama.cpp RPC by hand and switch the whole cluster between the two setups, so it is one or the other.
What would let us drop that switch:
- A GPU that is both a node and a split worker. The scheduler would then need to count its memory once: what the node's own models use, and what it lends to another node's split model.
- Opting in per model. Only the big model should be split. A node-wide setting would make every model that node loads shard across the workers.
- Per-GPU memory on the Nodes page for split workers, as for nodes, so you can see where the layers went.