Skip to content

vllm.v1.worker.gpu.model_states.prompt_embeds

Classes:

PromptEmbedsState

GPU-side state for user-provided prompt embeddings.

Each request's embeddings are copied to the GPU once at add_request, off the per-step hot path. A per-request pointer table (UVA) then lets a single triton kernel overlay all scheduled prompt-embeds rows onto inputs_embeds each step, with no python loops or per-request H2D copies.

Methods:

  • apply –

    Overlay prompt embeddings onto inputs_embeds for the batch.

apply(input_batch, num_computed_tokens, inputs_embeds)

Overlay prompt embeddings onto inputs_embeds for the batch.