This repository contains verfication code for MPC augmented routing algorithms for VLLM
The Goal of this project is to compliment the features of RR and PO2 algorithms with Horizon based controller for Prefill Decode Disaggregated workloads
RR algorithm besides being simple, ignores load and doesn't provide gaurantees on the stability
By augmenting with MPC, RR becomes a weighted algorithm that helps shifting the load from the using predicted bottlenecks which reduce congesions and oscillations
Ideally under steady workloads PO2 is near optimal. But the traditional LLM worklods violates these constraints because of batching, cache affinity and high decode service times.
MPC compliments these drawbacks through future load prediction, per-node-capacity assignment and filtered states using a simplified system model.
Below is a simplified system model to estimate the queue length of individual nodes
Where, for each node i
Goals:
1. Keep the predicted queue
2. Keep
Following graph shows how the controller maintains stable throughput by load balancing across servers for heterogenous workloads. In case of LLMs the heterogenity arrives from the variable promp lengths and generation legths, GPU capacity, KV Cache distribution etc.,.
- The mean latency apprears to be lower
- The latency variance appears to be narrower
The simulation has highly simplified the real time changes in the server service rates. This makes the above results to be kept under speculation.
- Verify the PO2 implementaiton against VLLM Router library
- Re-run on actual PDDisagg workloads and verify the results
# Create a container
docker run --rm -it --network=host --group-add video --ipc=host --cap-add=SYS_PTRACE --privileged=true --shm-size=64GB --device=/dev/kfd --device=/dev/dri --cap-add=IPC_LOCK --ulimit memlock=-1 --device=/dev/infiniband --device=/dev/infiniband/rdma_cm -v /sys/class/infiniband:/sys/class/infiniband:ro -v /sys/class/infiniband_verbs:/sys/class/infiniband_verbs:ro --security-opt seccomp=unconfined -v $HOME:$HOME --name 20251217_rocm7.0_ubuntu22.04_py3.10_pytorch_release_2.8.0_rc1 rocm/7.0:rocm7.0_ubuntu22.04_py3.10_pytorch_release_2.8.0_rc1 /bin/bash
# Start all nodes
/Orbit/simulation# python ./prefill_server.py --port 8100 --delay 0.005
/Orbit/simulation# python prefill_server.py --port 8101 --delay 0.03
/Orbit/simulation# python ./decode_server.py --port 8200 --token-delay 0.01
/Orbit/simulation# python ./decode_server.py --port 8201 --token-delay 0.05
# Start the Router
/orbit# python ./router.py --prefiller-hosts 127.0.0.1 127.0.0.1 --prefiller-ports 8100 8101 --decoder-hosts 127.0.0.1 127.0.0.1 --decoder-ports 8200 8201
# Benchmark and read the results
/Orbit/simulation# python benchmark.py