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 16, 19:30 UTC
[Bugfix] Lower gemma's unloaded_params exception to warning (#7002)
Michael Goin committed
Aug 1, 2024 at 15:01 UTC
f4fd390f5de585fd94877158bea4e1b2d1920df3
3 files changed
+12
-9
vllm/model_executor/models/gemma.py
+3
-3
@@ -404,6 +404,6 @@ class GemmaForCausalLM(nn.Module, SupportsLoRA):
404
loaded_params.add(name)
405
unloaded_params = params_dict.keys() - loaded_params
406
if unloaded_params:
407
- raise RuntimeError(
408
- "Some weights are not initialized from checkpoints: "
409
- f"{unloaded_params}")
407
+ logger.warning(
408
+ "Some weights are not initialized from checkpoints: %s",
409
+ unloaded_params)
vllm/model_executor/models/gemma2.py
+6
-3
@@ -23,6 +23,7 @@ from transformers import Gemma2Config
23
from vllm.attention import Attention, AttentionMetadata
24
from vllm.config import CacheConfig, LoRAConfig
25
from vllm.distributed import get_tensor_model_parallel_world_size
26
+from vllm.logger import init_logger
27
from vllm.model_executor.layers.activation import GeluAndMul
28
from vllm.model_executor.layers.layernorm import GemmaRMSNorm
29
from vllm.model_executor.layers.linear import (MergedColumnParallelLinear,
@@ -41,6 +42,8 @@ from vllm.sequence import IntermediateTensors, SamplerOutput
42
43
from .interfaces import SupportsLoRA
44
45
+logger = init_logger(__name__)
46
+
47
48
class Gemma2MLP(nn.Module):
49
@@ -390,6 +393,6 @@ class Gemma2ForCausalLM(nn.Module, SupportsLoRA):
393
394
unloaded_params = params_dict.keys() - loaded_params
395
if unloaded_params:
393
- raise RuntimeError(
394
- "Some weights are not initialized from checkpoints: "
395
- f"{unloaded_params}")
396
+ logger.warning(
397
+ "Some weights are not initialized from checkpoints: %s",
398
+ unloaded_params)
vllm/model_executor/models/paligemma.py
+3
-3
@@ -342,6 +342,6 @@ class PaliGemmaForConditionalGeneration(nn.Module, SupportsVision):
342
343
unloaded_params = params_dict.keys() - loaded_params
344
if unloaded_params:
345
- raise RuntimeError(
346
- "Some weights are not initialized from checkpoints: "
347
- f"{unloaded_params}")
345
+ logger.warning(
346
+ "Some weights are not initialized from checkpoints: %s",
347
+ unloaded_params)