vllm.model_executor.models.ernie45_vl
¶
Inference-only Ernie VL model compatible with HuggingFace weights.
Classes:
-
Ernie4_5_VLImagePixelInputs–Dimensions:
-
Ernie4_5_VLMoeForConditionalGeneration– -
Ernie4_5_VLVideoPixelInputs–Dimensions:
-
Ernie4_5_VisionAttention–VisionAttention using VLLM framework APIs.
-
Ernie4_5_VisionTransformer–
Functions:
-
all_gather_interleave–All-gather the input tensor interleavely across model parallel group.
Ernie4_5_VLImagePixelInputs
¶
Bases: TensorSchema
Dimensions: - np: The total number of patches over each image over each prompt in the batch - ni: Number of images - cps: Number of channels * patch_size * patch_size
Ernie4_5_VLMoeForConditionalGeneration
¶
Bases: Module, SupportsMultiModal, SupportsLoRA, SupportsPP, SupportsMRoPE, SupportsEncoderCudaGraph
_set_visual_token_mask(input_ids)
¶
Set mask for visual tokens (image/video patches and delimiters).
Ernie4_5_VLVideoPixelInputs
¶
Bases: TensorSchema
Dimensions: - np: The total number of patches over each image over each prompt in the batch - ni: Number of images - cps: Number of channels * temporal_patch_size * patch_size * patch_size
Ernie4_5_VisionTransformer
¶
Bases: Module
Methods:
-
prepare_encoder_metadata–Compute encoder metadata outside the CUDA graph.
prepare_encoder_metadata(grid_thw, *, num_pad=0, max_batch_size=None, max_seqlen_override=None, device=None)
¶
Compute encoder metadata outside the CUDA graph.
Splits the rotary embeddings, cu_seqlens and max_seqlen out of
forward so they can be precomputed on the host side and fed into a
captured graph through fixed buffers. Shared by the eager path, CUDA
graph capture and CUDA graph replay
Parameters:
-
(grid_thw¶Tensor | list[list[int]]) –Per-frame grid sizes as a
[num_frames, 3]tensor or an equivalent list of[t, h, w]. -
(num_pad¶int, default:0) –Legacy
cu_seqlenspadding -
(max_batch_size¶int | None, default:None) –If set, pad
cu_seqlenstomax_batch_size + 1entries for a fixed graph buffer shape. -
(max_seqlen_override¶int | None, default:None) –If set, use this value for
max_seqleninstead of deriving it fromcu_seqlens. CUDA graph capture bakesmax_seqlenat capture time, so it must cover the worst-case replay. -
(device¶device | None, default:None) –Device for the returned tensors. Defaults to
self.device.
Returns:
all_gather_interleave(local_tensor, hidden_size, tp_size)
¶
All-gather the input tensor interleavely across model parallel group.