[LoRA] Add one shot triton kernel For MoE LoRA (#42290)
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
@@ -7,9 +7,22 @@ from enum import Enum
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
from vllm import envs
|
||||
from vllm.model_executor.layers.fused_moe.fused_moe import try_get_optimal_moe_config
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.utils.math_utils import next_power_of_2
|
||||
|
||||
_lora_aux_cuda_stream: torch.cuda.Stream | None = None
|
||||
|
||||
|
||||
def _get_lora_aux_cuda_stream() -> torch.cuda.Stream | None:
|
||||
if not envs.VLLM_LORA_ENABLE_DUAL_STREAM:
|
||||
return None
|
||||
global _lora_aux_cuda_stream
|
||||
if _lora_aux_cuda_stream is None and current_platform.is_cuda_alike():
|
||||
_lora_aux_cuda_stream = torch.cuda.Stream()
|
||||
return _lora_aux_cuda_stream
|
||||
|
||||
|
||||
class LoRAMappingType(Enum):
|
||||
LANGUAGE = 1
|
||||
|
||||
Reference in New Issue
Block a user