Skip to content

Commit

Permalink
Add a switch to custom_allgather import (#705)
Browse files Browse the repository at this point in the history
Co-authored-by: baishihao <[email protected]>
  • Loading branch information
shihaobai and baishihao authored Jan 16, 2025
1 parent 0fcedc0 commit bd54e43
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lightllm/common/vllm_kernel/_custom_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
logger.error("vllm or lightllm_kernel is not installed, you can't use custom ops")

try:
from lightllm.common.vllm_kernel._ops import init_custom_gather_ar
from lightllm.common.vllm_kernel._ops import all_gather
from lightllm.common.vllm_kernel._ops import allgather_dispose
from lightllm.common.vllm_kernel._ops import allgather_register_buffer
from lightllm.common.vllm_kernel._ops import allgather_get_graph_buffer_ipc_meta
from lightllm.common.vllm_kernel._ops import allgather_register_graph_buffers
ENABLE_CUSTOM_GATHER = os.getenv("ENABLE_CUSTOM_GATHER", "False").upper() in ["ON", "TRUE", "1"]
if ENABLE_CUSTOM_GATHER:
from lightllm.common.vllm_kernel._ops import init_custom_gather_ar
from lightllm.common.vllm_kernel._ops import all_gather
from lightllm.common.vllm_kernel._ops import allgather_dispose
from lightllm.common.vllm_kernel._ops import allgather_register_buffer
from lightllm.common.vllm_kernel._ops import allgather_get_graph_buffer_ipc_meta
from lightllm.common.vllm_kernel._ops import allgather_register_graph_buffers
except ImportError:
logger.error("lightllm_kernel is not installed, you can't use custom allgather")

0 comments on commit bd54e43

Please sign in to comment.