### paged_kv_sim.py ===== After Prefill ===== Active requests: 4 Used token slots: 62 [Fixed max-length reservation] Reserved slots: 128 Unused reserved slots: 66 [Paged allocation] Allocated blocks: 17 Allocated slots: 68 Internal fragmentation: 6 Free blocks: 15 [Block tables] A: length= 8, blocks=[0, 1], capacity= 8, unused=0 B: length=19, blocks=[2, 3, 4, 5, 6], capacity=20, unused=1 C: length= 5, blocks=[7, 8], capacity= 8, unused=3 D: length=30, blocks=[9, 10, 11, 12, 13, 14, 15, 16], capacity=32, unused=2 ===== After Decode ===== Active requests: 4 Used token slots: 72 [Fixed max-length reservation] Reserved slots: 128 Unused reserved slots: 56 [Paged allocation] Allocated blocks: 19 Allocated slots: 76 Internal fragmentation: 4 Free blocks: 13 [Block tables] A: length=11, blocks=[0, 1, 17], capacity=12, unused=1 B: length=24, blocks=[2, 3, 4, 5, 6, 18], capacity=24, unused=0 C: length= 7, blocks=[7, 8], capacity= 8, unused=1 D: length=30, blocks=[9, 10, 11, 12, 13, 14, 15, 16], capacity=32, unused=2 ### prefix_cache_sim.py ===== Request A ===== Prompt length: 11 Full blocks: 2 Partial tail tokens: 3 Cache hits: 0/2 Reused tokens: 0 Tokens to process: 11 Physical block IDs: [0, 1] ===== Request B ===== Prompt length: 12 Full blocks: 3 Partial tail tokens: 0 Cache hits: 2/3 Reused tokens: 8 Tokens to process: 4 Physical block IDs: [0, 1, 2] ### continuous_batching_sim.py ============================================================ STATIC BATCHING ============================================================ [Decode Timeline] Time | Slot 1 | Slot 2 | Slot 3 ---------------------------------------- 0 | A | · | · 1 | A | · | · 2 | A | · | · 3 | A | · | · 4 | A | · | · 5 | A | · | · 6 | A | · | · 7 | A | · | · 8 | B | C | D 9 | B | C | D 10 | B | C | D 11 | B | C✓ | D 12 | B | C✓ | D 13 | B✓ | C✓ | D 14 | E | · | · 15 | E | · | · [Per-request Metrics] ID | Arrival | Start | Finish | Wait | Turnaround A | 0 | 0 | 8 | 0 | 8 B | 1 | 8 | 13 | 7 | 12 C | 2 | 8 | 11 | 6 | 9 D | 4 | 8 | 14 | 4 | 10 E | 5 | 14 | 16 | 9 | 11 [Aggregate Metrics] Makespan: 16 Total generated: 24 tokens Throughput: 1.500 tokens/unit Average wait: 5.200 time units Average turnaround: 10.000 time units Slot utilization: 50.00% ============================================================ CONTINUOUS BATCHING ============================================================ [Decode Timeline] Time | Slot 1 | Slot 2 | Slot 3 ---------------------------------------- 0 | A | · | · 1 | A | B | · 2 | A | B | C 3 | A | B | C 4 | A | B | C 5 | A | B | D 6 | A | D | E 7 | A | D | E 8 | D | · | · 9 | D | · | · 10 | D | · | · [Per-request Metrics] ID | Arrival | Start | Finish | Wait | Turnaround A | 0 | 0 | 8 | 0 | 8 B | 1 | 1 | 6 | 0 | 5 C | 2 | 2 | 5 | 0 | 3 D | 4 | 5 | 11 | 1 | 7 E | 5 | 6 | 8 | 1 | 3 [Aggregate Metrics] Makespan: 11 Total generated: 24 tokens Throughput: 2.182 tokens/unit Average wait: 0.400 time units Average turnaround: 5.200 time units Slot utilization: 72.73%