mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-04-28 03:39:48 +00:00
[build]: amd for llamafile right now (#1594)
This commit is contained in:
parent
bb1a667169
commit
a6bb7651f8
2 changed files with 7 additions and 6 deletions
|
|
@ -332,17 +332,17 @@ if(KTRANSFORMERS_CPU_MOE_AMD)
|
|||
)
|
||||
|
||||
if(NOT BLIS_INCLUDE_DIR OR NOT BLIS_LIBRARY)
|
||||
message(FATAL_ERROR "BLIS not found; set BLIS_ROOT or specify BLIS_INCLUDE_DIR/BLIS_LIBRARY")
|
||||
message(WARNING "BLIS not found; set BLIS_ROOT or specify BLIS_INCLUDE_DIR/BLIS_LIBRARY")
|
||||
else()
|
||||
message(STATUS "Found BLIS include at ${BLIS_INCLUDE_DIR}")
|
||||
message(STATUS "Found BLIS library ${BLIS_LIBRARY}")
|
||||
set(_KT_BLIS_INCLUDE_DIR ${BLIS_INCLUDE_DIR})
|
||||
set(_KT_BLIS_LIBRARY ${BLIS_LIBRARY})
|
||||
endif()
|
||||
# The Python extension target (${PROJECT_NAME}) is created later by
|
||||
# pybind11_add_module(). Calling target_include_directories/target_link_libraries
|
||||
# here would fail because the target doesn't exist yet. Save the discovered
|
||||
# BLIS paths and apply them after the module target is created.
|
||||
set(_KT_BLIS_INCLUDE_DIR ${BLIS_INCLUDE_DIR})
|
||||
set(_KT_BLIS_LIBRARY ${BLIS_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -229,9 +229,10 @@ class CMakeBuild(build_ext):
|
|||
|
||||
# Vendor / feature specific toggles
|
||||
# Enable AMD MoE kernel on AMD by default unless user explicitly set CPUINFER_ENABLE_AMD
|
||||
if d.get("vendor") == "amd" and os.environ.get("CPUINFER_ENABLE_AMD") is None:
|
||||
cmake_args.append("-DKTRANSFORMERS_CPU_MOE_AMD=ON")
|
||||
print("-- Detected AMD CPU; enabling AMD MoE kernel (-DKTRANSFORMERS_CPU_MOE_AMD=ON)")
|
||||
# temporarily disabled this opt, use llamafile backend for now
|
||||
# if d.get("vendor") == "amd" and os.environ.get("CPUINFER_ENABLE_AMD") is None:
|
||||
# cmake_args.append("-DKTRANSFORMERS_CPU_MOE_AMD=ON")
|
||||
# print("-- Detected AMD CPU; enabling AMD MoE kernel (-DKTRANSFORMERS_CPU_MOE_AMD=ON)")
|
||||
|
||||
# On ARM, enable KML by default if not explicitly toggled
|
||||
if d.get("vendor") == "arm" and os.environ.get("CPUINFER_ENABLE_KML") is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue