mirror of
https://github.com/vllm-project/vllm-ascend.git
synced 2025-10-20 13:43:53 +08:00
This PR add custom ascendc kernel rotary_embedding support in vllm-ascend, related CMakeLists and setuptools is also added in this PR. Related: https://github.com/vllm-project/vllm-ascend/issues/156 --------- Signed-off-by: ganyi <pleaplusone.gy@gmail.com>
26 lines
870 B
Python
26 lines
870 B
Python
import os
|
|
from typing import Any, Callable, Dict
|
|
|
|
env_variables: Dict[str, Callable[[], Any]] = {
|
|
# max compile thread num
|
|
"MAX_JOBS": lambda: os.getenv("MAX_JOBS", None),
|
|
"CMAKE_BUILD_TYPE": lambda: os.getenv("CMAKE_BUILD_TYPE"),
|
|
"COMPILE_CUSTOM_KERNELS":
|
|
lambda: os.getenv("COMPILE_CUSTOM_KERNELS", None),
|
|
# If set, vllm-ascend will print verbose logs during compliation
|
|
"VERBOSE": lambda: bool(int(os.getenv('VERBOSE', '0'))),
|
|
"ASCEND_HOME_PATH": lambda: os.getenv("ASCEND_HOME_PATH", None),
|
|
"LD_LIBRARY_PATH": lambda: os.getenv("LD_LIBRARY_PATH", None),
|
|
}
|
|
|
|
|
|
def __getattr__(name: str):
|
|
# lazy evaluation of environment variables
|
|
if name in env_variables:
|
|
return env_variables[name]()
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
|
|
|
|
def __dir__():
|
|
return list(env_variables.keys())
|