{
  "environment": {
    "python": "3.12.15",
    "platform": "Linux",
    "device": "CPU",
    "dependencies": [
      "Python standard library"
    ]
  },
  "paged_allocation": {
    "snapshots": [
      {
        "title": "After Prefill",
        "block_size": 4,
        "total_blocks": 32,
        "max_len_for_fixed_reservation": 32,
        "used_token_slots": 62,
        "allocated_blocks": 17,
        "allocated_slots": 68,
        "internal_fragmentation": 6,
        "fixed_reserved_slots": 128,
        "fixed_unused_slots": 66,
        "free_blocks": [
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          29,
          30,
          31
        ],
        "lengths": {
          "A": 8,
          "B": 19,
          "C": 5,
          "D": 30
        },
        "block_tables": {
          "A": [
            0,
            1
          ],
          "B": [
            2,
            3,
            4,
            5,
            6
          ],
          "C": [
            7,
            8
          ],
          "D": [
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16
          ]
        }
      },
      {
        "title": "After Decode",
        "block_size": 4,
        "total_blocks": 32,
        "max_len_for_fixed_reservation": 32,
        "used_token_slots": 72,
        "allocated_blocks": 19,
        "allocated_slots": 76,
        "internal_fragmentation": 4,
        "fixed_reserved_slots": 128,
        "fixed_unused_slots": 56,
        "free_blocks": [
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          29,
          30,
          31
        ],
        "lengths": {
          "A": 11,
          "B": 24,
          "C": 7,
          "D": 30
        },
        "block_tables": {
          "A": [
            0,
            1,
            17
          ],
          "B": [
            2,
            3,
            4,
            5,
            6,
            18
          ],
          "C": [
            7,
            8
          ],
          "D": [
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16
          ]
        }
      }
    ],
    "cache_payload": "allocation and integer IDs only",
    "release_in_main": false,
    "reference_counting": false
  },
  "prefix_caching": {
    "requests": [
      {
        "request_id": "A",
        "tokens": [
          "请",
          "解释",
          "KV",
          "Cache",
          "工作",
          "原理",
          "以及",
          "例子",
          "先",
          "讲",
          "原理"
        ],
        "prompt_length": 11,
        "block_size": 4,
        "full_blocks": 2,
        "partial_tail_tokens": 3,
        "cache_hits": 0,
        "cache_misses": 2,
        "reused_tokens": 0,
        "tokens_to_process": 11,
        "physical_ids": [
          0,
          1
        ],
        "blocks": [
          {
            "tokens": [
              "请",
              "解释",
              "KV",
              "Cache"
            ],
            "parent_hash": "ROOT",
            "hash": "69dbe89baa5bcb8c8d8d9d05bfa55c48608839da68ac76576ad060d1804665b2",
            "physical_id": 0,
            "hit": false
          },
          {
            "tokens": [
              "工作",
              "原理",
              "以及",
              "例子"
            ],
            "parent_hash": "69dbe89baa5bcb8c8d8d9d05bfa55c48608839da68ac76576ad060d1804665b2",
            "hash": "3d7aa799da317e13e3a1916b6777edefbaf2653270b11012a226140b04d3991c",
            "physical_id": 1,
            "hit": false
          }
        ],
        "partial_tail": [
          "先",
          "讲",
          "原理"
        ],
        "cached_block_count": 2
      },
      {
        "request_id": "B",
        "tokens": [
          "请",
          "解释",
          "KV",
          "Cache",
          "工作",
          "原理",
          "以及",
          "例子",
          "再",
          "比较",
          "GQA",
          "MLA"
        ],
        "prompt_length": 12,
        "block_size": 4,
        "full_blocks": 3,
        "partial_tail_tokens": 0,
        "cache_hits": 2,
        "cache_misses": 1,
        "reused_tokens": 8,
        "tokens_to_process": 4,
        "physical_ids": [
          0,
          1,
          2
        ],
        "blocks": [
          {
            "tokens": [
              "请",
              "解释",
              "KV",
              "Cache"
            ],
            "parent_hash": "ROOT",
            "hash": "69dbe89baa5bcb8c8d8d9d05bfa55c48608839da68ac76576ad060d1804665b2",
            "physical_id": 0,
            "hit": true
          },
          {
            "tokens": [
              "工作",
              "原理",
              "以及",
              "例子"
            ],
            "parent_hash": "69dbe89baa5bcb8c8d8d9d05bfa55c48608839da68ac76576ad060d1804665b2",
            "hash": "3d7aa799da317e13e3a1916b6777edefbaf2653270b11012a226140b04d3991c",
            "physical_id": 1,
            "hit": true
          },
          {
            "tokens": [
              "再",
              "比较",
              "GQA",
              "MLA"
            ],
            "parent_hash": "3d7aa799da317e13e3a1916b6777edefbaf2653270b11012a226140b04d3991c",
            "hash": "a952ccaf353d6c119e2b240489a8f3d15b075b35d1fde99edd0c369dfc3608a0",
            "physical_id": 2,
            "hit": false
          }
        ],
        "partial_tail": [],
        "cached_block_count": 3
      }
    ],
    "hash": "SHA-256 of repr((previous_hash, tuple(block_tokens))) encoded as UTF-8",
    "cache_payload": "hash-to-block-ID mapping only",
    "reference_counting": false,
    "eviction": false
  },
  "batch_scheduling": {
    "runs": [
      {
        "policy": "static",
        "request_specs": [
          {
            "id": "A",
            "arrival": 0,
            "tokens": 8
          },
          {
            "id": "B",
            "arrival": 1,
            "tokens": 5
          },
          {
            "id": "C",
            "arrival": 2,
            "tokens": 3
          },
          {
            "id": "D",
            "arrival": 4,
            "tokens": 6
          },
          {
            "id": "E",
            "arrival": 5,
            "tokens": 2
          }
        ],
        "max_batch_size": 3,
        "states": {
          "A": {
            "id": "A",
            "arrival": 0,
            "tokens": 8,
            "remaining": 0,
            "start": 0,
            "finish": 8,
            "generated": 8
          },
          "B": {
            "id": "B",
            "arrival": 1,
            "tokens": 5,
            "remaining": 0,
            "start": 8,
            "finish": 13,
            "generated": 5
          },
          "C": {
            "id": "C",
            "arrival": 2,
            "tokens": 3,
            "remaining": 0,
            "start": 8,
            "finish": 11,
            "generated": 3
          },
          "D": {
            "id": "D",
            "arrival": 4,
            "tokens": 6,
            "remaining": 0,
            "start": 8,
            "finish": 14,
            "generated": 6
          },
          "E": {
            "id": "E",
            "arrival": 5,
            "tokens": 2,
            "remaining": 0,
            "start": 14,
            "finish": 16,
            "generated": 2
          }
        },
        "timeline": [
          {
            "time": 0,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 1,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 2,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 3,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 4,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 5,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 6,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 7,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 8,
            "slots": [
              "B",
              "C",
              "D"
            ]
          },
          {
            "time": 9,
            "slots": [
              "B",
              "C",
              "D"
            ]
          },
          {
            "time": 10,
            "slots": [
              "B",
              "C",
              "D"
            ]
          },
          {
            "time": 11,
            "slots": [
              "B",
              "C✓",
              "D"
            ]
          },
          {
            "time": 12,
            "slots": [
              "B",
              "C✓",
              "D"
            ]
          },
          {
            "time": 13,
            "slots": [
              "B✓",
              "C✓",
              "D"
            ]
          },
          {
            "time": 14,
            "slots": [
              "E",
              "·",
              "·"
            ]
          },
          {
            "time": 15,
            "slots": [
              "E",
              "·",
              "·"
            ]
          }
        ],
        "metrics": {
          "makespan": 16,
          "total_tokens": 24,
          "throughput": 1.5,
          "avg_wait": 5.2,
          "avg_turnaround": 10.0,
          "slot_utilization": 0.5
        }
      },
      {
        "policy": "continuous",
        "request_specs": [
          {
            "id": "A",
            "arrival": 0,
            "tokens": 8
          },
          {
            "id": "B",
            "arrival": 1,
            "tokens": 5
          },
          {
            "id": "C",
            "arrival": 2,
            "tokens": 3
          },
          {
            "id": "D",
            "arrival": 4,
            "tokens": 6
          },
          {
            "id": "E",
            "arrival": 5,
            "tokens": 2
          }
        ],
        "max_batch_size": 3,
        "states": {
          "A": {
            "id": "A",
            "arrival": 0,
            "tokens": 8,
            "remaining": 0,
            "start": 0,
            "finish": 8,
            "generated": 8
          },
          "B": {
            "id": "B",
            "arrival": 1,
            "tokens": 5,
            "remaining": 0,
            "start": 1,
            "finish": 6,
            "generated": 5
          },
          "C": {
            "id": "C",
            "arrival": 2,
            "tokens": 3,
            "remaining": 0,
            "start": 2,
            "finish": 5,
            "generated": 3
          },
          "D": {
            "id": "D",
            "arrival": 4,
            "tokens": 6,
            "remaining": 0,
            "start": 5,
            "finish": 11,
            "generated": 6
          },
          "E": {
            "id": "E",
            "arrival": 5,
            "tokens": 2,
            "remaining": 0,
            "start": 6,
            "finish": 8,
            "generated": 2
          }
        },
        "timeline": [
          {
            "time": 0,
            "slots": [
              "A",
              "·",
              "·"
            ]
          },
          {
            "time": 1,
            "slots": [
              "A",
              "B",
              "·"
            ]
          },
          {
            "time": 2,
            "slots": [
              "A",
              "B",
              "C"
            ]
          },
          {
            "time": 3,
            "slots": [
              "A",
              "B",
              "C"
            ]
          },
          {
            "time": 4,
            "slots": [
              "A",
              "B",
              "C"
            ]
          },
          {
            "time": 5,
            "slots": [
              "A",
              "B",
              "D"
            ]
          },
          {
            "time": 6,
            "slots": [
              "A",
              "D",
              "E"
            ]
          },
          {
            "time": 7,
            "slots": [
              "A",
              "D",
              "E"
            ]
          },
          {
            "time": 8,
            "slots": [
              "D",
              "·",
              "·"
            ]
          },
          {
            "time": 9,
            "slots": [
              "D",
              "·",
              "·"
            ]
          },
          {
            "time": 10,
            "slots": [
              "D",
              "·",
              "·"
            ]
          }
        ],
        "metrics": {
          "makespan": 11,
          "total_tokens": 24,
          "throughput": 2.1818181818181817,
          "avg_wait": 0.4,
          "avg_turnaround": 5.2,
          "slot_utilization": 0.7272727272727273
        }
      }
    ],
    "time_unit": "one abstract decode iteration",
    "tokens_per_active_request_per_iteration": 1,
    "prefill_modeled": false,
    "kv_capacity_modeled": false,
    "gpu_execution_modeled": false
  }
}
