vllm
e09e439f - [Core] Native input path for the Rust engine core, with fast-path requests

Commit
21 days ago
[Core] Native input path for the Rust engine core, with fast-path requests With `VLLM_RUST_CORE_NATIVE_IO=1` and the native output path in use, the input socket thread of `vllm-engine-core-io` replaces `process_input_sockets`. It decodes each add request off the GIL and classifies it once, as it arrives: - Fast path: a request that meets no Python collaborator is admitted as a `NativeAddRequest`, with no Python `Request`. The scheduler builds the Rust request from the decoded one and hashes its blocks in Rust; the workers get its Python `SamplingParams` (decoded once, with `preprocess_add_request`'s watermark enforcement) and prompt `TokenBuffer`. `NativeAddRequest` exposes only what the engine and the binding read of a request they did not build, and the binding skips syncing it. - Slow path: everything else (structured outputs, extra args such as KV transfer params, multimodal inputs, LoRA, sessions, ... and every other message type) goes to `EngineCoreProc._process_input_message`, the body of the Python input thread factored out, with its original frames. The native input path needs no KV, EC or aux output connector (their hooks take Python requests) and a `*_cbor` prefix-caching hash, the only ones the fast path computes. It announces no `prefix_hash_config`, so the Rust frontend does not compute prompt block hashes the engine would recompute. `test_rust_native_input.py` sends the fuzzer's requests through a real socket and runs the fast-path ones against the Python scheduler step by step, through preemption, aborts and the end of each request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CJckC9nFcrpLQhRK5vTJZU Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Author
Committer
Parents
Loading