Jiejing 57f206a8d5 engine: expose Scheduler.add_prompted_sequence and free_finished_seqs
Two bindings a prefill/decode split needs from the scheduler:

- add_prompted_sequence(seq): put a sequence whose KV blocks and state
  were filled by the caller (received from a prompt-only engine)
  straight into the prompted queue, without cloning. The sequence holds
  prompt + first generated token, with everything but the last token
  computed; the checks assert that layout.
- free_finished_seqs(): expose the existing helper that moves finished
  sequences out of running and returns them without freeing blocks or
  state, so a prompt-only engine can export the prefilled KV first and
  free the sequence itself afterwards.

No scheduling behaviour changes for engines that do not call them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFPG29daR1FhchJBTjiEKr
2026-10-21 22:26:29 +00:00
..
__init__.pyi initial commit 2026-10-20 12:09:42 +08:00
cuda_utils.pyi initial commit 2026-10-20 12:09:42 +08:00
engine.pyi engine: expose Scheduler.add_prompted_sequence and free_finished_seqs 2026-10-21 22:26:29 +00:00
graph_timer.pyi initial commit 2026-10-20 12:09:42 +08:00