WIP - do not merge - Vllm v1 hidden states#1
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
|
Here is a diagram for our implementation. sequenceDiagram
participant async_llm
participant EngineCore
participant GpuModelRunner/TpuModelRunner
EngineCore->>async_llm:EngineCoreOutput
note over async_llm: Is Sequence Complete? If yes...
note over async_llm: Is server enable_return_hidden_states? If yes...
note over async_llm: Are hidden states requested? If yes...
async_llm->>EngineCore:send HiddenStatesExtractionRequest
note over EngineCore: create prefill-only EngineCoreRequest (prompt_token_ids=prompt+response)
EngineCore->>GpuModelRunner/TpuModelRunner: EngineCoreRequest
note over GpuModelRunner/TpuModelRunner:Slice out hidden states for only last token
note over GpuModelRunner/TpuModelRunner:Move slice (1,D) to CPU
note over GpuModelRunner/TpuModelRunner:Include in ModelRunnerOutput as List[float] (~77kb)
GpuModelRunner/TpuModelRunner->>EngineCore: ModelRunnerOutput
EngineCore->>async_llm: EngineCoreOutput
Here is some analysis of internal serialization costs.
|
…ionary on res is still keyed incorrectly)
…engine requests still validate the enable_return_hidden_states flag
No description provided.