Skip to content

Commit 753b450

Browse files
jeejeeleemzusman
authored andcommitted
[Bugfix] Add checks for LoRA and CPU offload (vllm-project#11810)
Signed-off-by: Jee Jee Li <[email protected]>
1 parent 7da0406 commit 753b450

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vllm/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,6 +2051,11 @@ def __post_init__(self):
20512051
f"max_cpu_loras ({self.max_cpu_loras}) must be >= "
20522052
f"max_loras ({self.max_loras})")
20532053

2054+
def verify_with_cache_config(self, cache_config: CacheConfig):
2055+
# TODO LoRA supports CPU offload.
2056+
if cache_config.cpu_offload_gb > 0:
2057+
raise ValueError("CPU offload is not supported with LoRA yet.")
2058+
20542059
def verify_with_model_config(self, model_config: ModelConfig):
20552060
if self.lora_dtype in (None, "auto"):
20562061
self.lora_dtype = model_config.dtype
@@ -3138,6 +3143,7 @@ def __post_init__(self):
31383143
self.cache_config.verify_with_parallel_config(self.parallel_config)
31393144

31403145
if self.lora_config:
3146+
self.lora_config.verify_with_cache_config(self.cache_config)
31413147
self.lora_config.verify_with_model_config(self.model_config)
31423148
self.lora_config.verify_with_scheduler_config(
31433149
self.scheduler_config)

0 commit comments

Comments
 (0)