How jamessshhh/bayesian-llm-inference-scheduling works
LATENT is a research simulator for evaluating uncertainty-aware scheduling of LLM inference requests, not a production serving system. The main workflow generates synthetic or ShareGPT workloads, supplies predicted service costs and uncertainty, chooses among scheduling policies, simulates a single non-preemptive worker, and summarizes latency and starvation-related metrics. Its internal layers include request data, posterior estimation, and optional online uncertainty recalibration. The README documents the overall workflow; source excerpts show simulator and policy behavior, while several predictor and policy modules are indexed but not excerpted, so their internal links are omitted where unverified.
Main entry points: run2.py Synthetic experiments · base.py FIFO and policy base · run6.py ShareGPT experiments · simulator.py Single-worker simulator
Components 17
Workload generation
- Synthetic workloads
latent/workload/synthetic.py - ShareGPT workloads
latent/workload/sharegpt.py
Prediction and uncertainty
- Synthetic predictions
latent/predictor/noisy.py - Learned predictor
latent/predictor/learned.py - Posterior estimates
latent/predictor/posterior.py - Online recalibration
latent/predictor/recalibrate.py
Scheduling policies
- FIFO and policy base
latent/policies/base.py - Oracle and point SJF
latent/policies/sjf.py - Aging SJF
latent/policies/aging.py - LATENT policy
latent/policies/latent_policy.py - TIE-style policy
latent/policies/tie.py
Simulation and results
- Request records
latent/sim/request.py - Single-worker simulator
latent/sim/simulator.py - Latency metrics
latent/sim/metrics.py - Synthetic experiments
experiments/run2.py - ShareGPT experiments
experiments/run6.py
Other components
- Researcher
Connections 20
- Researcher → Synthetic experiments: runs
README.md - Researcher → ShareGPT experiments: runs
README.md - Synthetic experiments → Synthetic workloads: generates
experiments/run2.py - ShareGPT experiments → ShareGPT workloads: generates
experiments/run6.py - Synthetic workloads → Request records: creates
latent/workload/synthetic.py - ShareGPT workloads → Request records: creates
latent/workload/sharegpt.py - Synthetic experiments → Synthetic predictions: adds predictions
experiments/run2.py - ShareGPT workloads → Learned predictor: uses predictions
- Synthetic experiments → Single-worker simulator: runs
experiments/run2.py - ShareGPT experiments → Single-worker simulator: runs
experiments/run6.py - Single-worker simulator → FIFO and policy base: selects via
latent/sim/simulator.py - LATENT policy → Posterior estimates: estimates cost
latent/policies/latent_policy.py - LATENT policy → Online recalibration: optionally recalibrates
latent/policies/latent_policy.py - Single-worker simulator → Latency metrics: summarizes results
- Synthetic experiments → Latency metrics: computes metrics
experiments/run2.py - ShareGPT experiments → Latency metrics: computes metrics
experiments/run6.py - Oracle and point SJF → FIFO and policy base: implements
latent/policies/sjf.py - Aging SJF → FIFO and policy base: implements
latent/policies/aging.py - LATENT policy → FIFO and policy base: implements
latent/policies/latent_policy.py - TIE-style policy → FIFO and policy base: implements
latent/policies/tie.py