Add Loraconfig parameter to get_punica_wrapper function (#31408)
Signed-off-by: ZT-AIA <1028681969@qq.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
@@ -128,7 +128,7 @@ class LoRAModelManager:
|
||||
max_num_batched_tokens,
|
||||
max_batches=self.max_num_seqs,
|
||||
device=self.device,
|
||||
max_loras=self.lora_config.max_loras,
|
||||
lora_config=self.lora_config,
|
||||
)
|
||||
|
||||
self.punica_wrapper_mapping[DEFAULT_LANGUAGE_WRAPPER_KEY] = (
|
||||
@@ -148,7 +148,7 @@ class LoRAModelManager:
|
||||
max_num_batched_tokens,
|
||||
max_batches=self.max_num_seqs,
|
||||
device=self.device,
|
||||
max_loras=self.lora_config.max_loras,
|
||||
lora_config=self.lora_config,
|
||||
)
|
||||
lm_prefix = self.mm_mapping.language_model[0]
|
||||
self.punica_wrapper_mapping[lm_prefix] = llm_punica_wrapper
|
||||
@@ -186,7 +186,7 @@ class LoRAModelManager:
|
||||
num_encoder_tokens,
|
||||
max_batches=self.max_num_seqs * limit_per_prompt,
|
||||
device=self.device,
|
||||
max_loras=self.lora_config.max_loras,
|
||||
lora_config=self.lora_config,
|
||||
)
|
||||
for prefix in self.mm_mapping.tower_model:
|
||||
self.punica_wrapper_mapping[prefix] = tower_punica_wrapper
|
||||
@@ -201,7 +201,7 @@ class LoRAModelManager:
|
||||
connector_tokens,
|
||||
max_batches=self.max_num_seqs * limit_per_prompt,
|
||||
device=self.device,
|
||||
max_loras=self.lora_config.max_loras,
|
||||
lora_config=self.lora_config,
|
||||
)
|
||||
for prefix in self.mm_mapping.connector:
|
||||
self.punica_wrapper_mapping[prefix] = connector_punica_wrapper
|
||||
|
||||
@@ -45,7 +45,8 @@ class PunicaWrapperGPU(PunicaWrapperBase):
|
||||
):
|
||||
PunicaWrapperBase.__init__(self, max_num_batched_tokens, max_batches, device)
|
||||
|
||||
self.max_loras = kwargs["max_loras"]
|
||||
self.lora_config = kwargs["lora_config"]
|
||||
self.max_loras = self.lora_config.max_loras
|
||||
|
||||
self.token_mapping_meta = LoRAKernelMeta.make(
|
||||
self.max_loras, max_num_batched_tokens, device=device
|
||||
|
||||
Reference in New Issue
Block a user