- engine.py: _Result 改用 threading.Condition.wait_for 替代 Event busy-wait,非流式模式线程被内核挂起而非 1760 万次空转 - scheduler.py: _execute_decode 将 temperature/top_k/top_p 张量 移至循环外预先分配,避免每步重复 torch.tensor();input_ids 改用 torch.empty 避免不必要的 zero 初始化(两处均为完全覆盖) - _execute_prefill: input_ids 同改为 torch.empty |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| cache.py | ||
| engine.py | ||
| sampling.py | ||
| scheduler.py | ||
| server.py | ||