mirror of
https://github.com/deepseek-ai/DeepInfer.git
synced 2026-10-31 00:36:20 +08:00
- Turn Scheduler into a class: only waiting/running/decode_step (bound by pybind) stay public; internals become private. - Move immutable knobs into SchedulerConfig::capture(), alongside the constructor-time checks. - Drop dead state: dp_size, dp_rank, truncate_len, schedule_counter, last_step_*, tokens_chunked_prefill_remaining, and the max_num_prompts alias. The unused truncate_len constructor argument is removed from the binding, the stub and llm_engine. - Split _schedule into _schedule_normal / _schedule_prefill / _schedule_decode; decode is further split into _admit_prompted and _select_decode_batch. - Share the forked-KV detach logic between prefill and decode (_detach_forked_cache) instead of two hand-written copies. - prompted no longer carries a tuple<seq, bool>: the flag was always true. - process_outputs: the returned buffers become per-instance members instead of function-level statics shared by all Scheduler instances. The binding returns them as zero-copy numpy arrays whose base is the Scheduler, so holding an array keeps the storage alive. - SchedulerOutputs is filled incrementally instead of via a 10-arg ctor. - Fix the LCFS comment: preemption victims are the longest-output seqs. - block_manager.hpp now includes <sys/time.h> itself for gettimeofday. Verified with a differential harness that drives the old and new Scheduler through identical randomized workloads (NORMAL/PROMPT/COMPLETION, chunked prefill, MTP varlen, forks, preemption, aborts, multimodal chunk boundaries, simulated multi-rank votes) and compares full per-step state: 120/120 traces identical on macOS/clang and Linux/GCC 15; a Python smoke test through the real pybind bindings is also identical old vs new. |
||
|---|---|---|
| .. | ||
| input_metadata | ||
| block_manager.hpp | ||
| flops_estimator.hpp | ||
| mtp_varlen.hpp | ||
| outputs.hpp | ||
| prepare_sample.cpp | ||
| prepare_sample.hpp | ||
| process_output.hpp | ||
| pybind_output.cpp | ||
| pybind_scheduler.cpp | ||
| pybind_sequence.cpp | ||
| pybind.cpp | ||
| pybind.hpp | ||
| scheduler.hpp | ||
| sequence.hpp | ||
| utils.hpp | ||
| zos.cpp | ||
| zos.hpp | ||