@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 640cc9dd7d
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 5, 01:00 UTC

feat: Add LoRA support for Gemma4ForConditionalGeneration (#39291)

Signed-off-by: allgather <all2allops@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

allgather committed Apr 17, 2026 at 09:39 UTC 640cc9dd7dae3ba08f4dc6e479403fbaf99f2d93
1 file changed +10 -2
vllm/model_executor/models/gemma4_mm.py
+10 -2
@@ -67,6 +67,7 @@ from vllm.utils.tensor_schema import TensorSchema, TensorShape
67 from .interfaces import (
68 MultiModalEmbeddings,
69 SupportsEagle3,
70 + SupportsLoRA,
71 SupportsMultiModal,
72 SupportsPP,
73 )
@@ -880,6 +881,7 @@ class Gemma4ForConditionalGeneration(
881 nn.Module,
882 SupportsMultiModal,
883 SupportsPP,
884 + SupportsLoRA,
885 SupportsEagle3,
886 ):
887 packed_modules_mapping = {
@@ -1358,10 +1360,16 @@ class Gemma4ForConditionalGeneration(
1360
1361 def get_mm_mapping(self) -> MultiModelKeys:
1362 """Get the module prefix mapping for multimodal models."""
1363 + connectors = ["embed_vision"]
1364 + tower_models = ["vision_tower"]
1365 + if self.audio_tower is not None:
1366 + connectors.append("embed_audio")
1367 + tower_models.append("audio_tower")
1368 +
1369 return MultiModelKeys.from_string_field(
1370 language_model="language_model",
1363 - connector=["embed_vision", "embed_audio"],
1364 - tower_model=["vision_tower", "audio_tower"],
1371 + connector=connectors,
1372 + tower_model=tower_models,
1373 )
1374
1375 @classmethod