mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
[BugFix] fix cuda-python requirement (#5261)
* fix cuda-python requirement * update * fix
This commit is contained in:
@@ -1807,6 +1807,15 @@ class FDConfig:
|
|||||||
int(envs.FD_DISABLED_RECOVER) == 0
|
int(envs.FD_DISABLED_RECOVER) == 0
|
||||||
), "FD_DISABLED_RECOVER is not supported while ENABLE_V1_KVCACHE_SCHEDULER is turned on."
|
), "FD_DISABLED_RECOVER is not supported while ENABLE_V1_KVCACHE_SCHEDULER is turned on."
|
||||||
|
|
||||||
|
if self.eplb_config is not None and self.eplb_config.enable_eplb:
|
||||||
|
try:
|
||||||
|
import cuda # noqa
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError(
|
||||||
|
"cuda-python not installed. Install the version matching your CUDA toolkit:\n"
|
||||||
|
" CUDA 12.x → pip install cuda-python==12.*\n"
|
||||||
|
)
|
||||||
|
|
||||||
def print(self):
|
def print(self):
|
||||||
"""
|
"""
|
||||||
print all config
|
print all config
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ from typing import List, Tuple
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import paddle
|
import paddle
|
||||||
from cuda import cudart
|
|
||||||
|
try:
|
||||||
|
from cuda import cudart
|
||||||
|
except ImportError:
|
||||||
|
cudart = None
|
||||||
|
|
||||||
from fastdeploy.config import EPLBConfig
|
from fastdeploy.config import EPLBConfig
|
||||||
|
|
||||||
@@ -90,6 +94,12 @@ def create_mmap(model_name: List, ep_rank: int, ep_size: int, shm_uuid: str, epl
|
|||||||
shm_ptr = ctypes.cast(shm_ptr, ctypes.POINTER(ctypes.c_int8))
|
shm_ptr = ctypes.cast(shm_ptr, ctypes.POINTER(ctypes.c_int8))
|
||||||
addr = ctypes.addressof(shm_ptr.contents)
|
addr = ctypes.addressof(shm_ptr.contents)
|
||||||
|
|
||||||
|
if cudart is None:
|
||||||
|
raise ImportError(
|
||||||
|
"cuda-python not installed. Install the version matching your CUDA toolkit:\n"
|
||||||
|
" CUDA 12.x → pip install cuda-python==12.*\n"
|
||||||
|
)
|
||||||
|
|
||||||
# Register memory with CUDA
|
# Register memory with CUDA
|
||||||
(ret,) = cudart.cudaHostRegister(addr, shm_size, 0)
|
(ret,) = cudart.cudaHostRegister(addr, shm_size, 0)
|
||||||
if ret != cudart.cudaError_t.cudaSuccess:
|
if ret != cudart.cudaError_t.cudaSuccess:
|
||||||
|
|||||||
@@ -46,4 +46,3 @@ msgspec
|
|||||||
einops
|
einops
|
||||||
setproctitle
|
setproctitle
|
||||||
aistudio_sdk
|
aistudio_sdk
|
||||||
cuda-python==12.8
|
|
||||||
|
|||||||
Reference in New Issue
Block a user