[Model] Enable torch.compile and CUDA graphs for EmbeddingGemma2 (#61572)

Signed-off-by: Vivaan Sharma <99265792+Vivaansharma2003@users.noreply.github.com>
Co-authored-by: Kevin H. Luu <khluu000@gmail.com>
This commit is contained in:
Vivaan Sharma
2026-10-15 12:32:39 +08:00
committed by GitHub
co-authored by Kevin H. Luu
parent ff5a91a456
commit 96b5b0ee4b
@@ -18,6 +18,7 @@ from transformers.models.embedding_gemma2.processing_embedding_gemma2 import (
)
from transformers.video_utils import VideoMetadata
from vllm.compilation.decorators import support_torch_compile
from vllm.config import VllmConfig
from vllm.distributed import get_tensor_model_parallel_world_size
from vllm.logger import init_logger
@@ -334,6 +335,7 @@ class EmbeddingGemma2TextPLE(nn.Module):
return self.per_layer_projection_norm(proj)
@support_torch_compile
class EmbeddingGemma2TextModel(nn.Module):
"""Text embedding backbone for EmbeddingGemma2 with bidirectional attention."""