Fix: Build error seen on Power Architecture (#10421)
Signed-off-by: Manjul Mohan <manjul.mohan@ibm.com> Signed-off-by: B-201 <Joy25810@foxmail.com> Signed-off-by: Isotr0py <2037008807@qq.com> Signed-off-by: youkaichao <youkaichao@gmail.com> Signed-off-by: ismael-dm <ismaeldm99@gmail.com> Signed-off-by: Andrew Nesbitt <andrewnez@gmail.com> Signed-off-by: mgoin <michael@neuralmagic.com> Signed-off-by: yan ma <yan.ma@intel.com> Signed-off-by: Angus Wang <wangjadehao@gmail.com> Signed-off-by: Lucas Wilkinson <lwilkinson@neuralmagic.com> Signed-off-by: rickyx <rickyx@anyscale.com> Signed-off-by: Jee Jee Li <pandaleefree@gmail.com> Signed-off-by: Mengqing Cao <cmq0113@163.com> Signed-off-by: Travis Johnson <tsjohnso@us.ibm.com> Co-authored-by: Manjul Mohan manjul.mohan@ibm.com <manjulmohan@ltcd97-lp2.aus.stglabs.ibm.com> Co-authored-by: B-201 <Joy25810@foxmail.com> Co-authored-by: Isotr0py <2037008807@qq.com> Co-authored-by: youkaichao <youkaichao@gmail.com> Co-authored-by: ismael-dm <ismaeldm99@gmail.com> Co-authored-by: Andrew Nesbitt <andrewnez@gmail.com> Co-authored-by: Michael Goin <michael@neuralmagic.com> Co-authored-by: Yan Ma <yan.ma@intel.com> Co-authored-by: Angus Wang <wangjadehao@gmail.com> Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com> Co-authored-by: Ricky Xu <rickyx@anyscale.com> Co-authored-by: Kevin H. Luu <kevin@anyscale.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com> Co-authored-by: Mengqing Cao <cmq0113@163.com> Co-authored-by: Travis Johnson <tsjohnso@us.ibm.com> Co-authored-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
parent
11fd7ea639
commit
1ea291a417
@ -16,10 +16,16 @@ include_directories("${CMAKE_SOURCE_DIR}/csrc")
|
|||||||
#
|
#
|
||||||
# Check the compile flags
|
# Check the compile flags
|
||||||
#
|
#
|
||||||
|
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
|
||||||
|
list(APPEND CXX_COMPILE_FLAGS
|
||||||
|
"-fopenmp"
|
||||||
|
"-DVLLM_CPU_EXTENSION")
|
||||||
|
else()
|
||||||
list(APPEND CXX_COMPILE_FLAGS
|
list(APPEND CXX_COMPILE_FLAGS
|
||||||
"-fopenmp"
|
"-fopenmp"
|
||||||
"-mf16c"
|
"-mf16c"
|
||||||
"-DVLLM_CPU_EXTENSION")
|
"-DVLLM_CPU_EXTENSION")
|
||||||
|
endif()
|
||||||
|
|
||||||
execute_process(COMMAND cat /proc/cpuinfo
|
execute_process(COMMAND cat /proc/cpuinfo
|
||||||
RESULT_VARIABLE CPUINFO_RET
|
RESULT_VARIABLE CPUINFO_RET
|
||||||
|
|||||||
@ -24,12 +24,20 @@ struct KernelVecType<float> {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct KernelVecType<c10::Half> {
|
struct KernelVecType<c10::Half> {
|
||||||
|
#ifdef __powerpc64__
|
||||||
|
// Power architecture-specific vector types
|
||||||
|
using q_load_vec_type = vec_op::FP32Vec8;
|
||||||
|
using k_load_vec_type = vec_op::FP32Vec16;
|
||||||
|
using v_load_vec_type = vec_op::FP32Vec16;
|
||||||
|
#else
|
||||||
|
// Fallback for other architectures, including x86
|
||||||
using q_load_vec_type = vec_op::FP16Vec8;
|
using q_load_vec_type = vec_op::FP16Vec8;
|
||||||
using q_vec_type = vec_op::FP32Vec16;
|
|
||||||
using k_load_vec_type = vec_op::FP16Vec16;
|
using k_load_vec_type = vec_op::FP16Vec16;
|
||||||
|
using v_load_vec_type = vec_op::FP16Vec16;
|
||||||
|
#endif
|
||||||
|
using q_vec_type = vec_op::FP32Vec16;
|
||||||
using k_vec_type = vec_op::FP32Vec16;
|
using k_vec_type = vec_op::FP32Vec16;
|
||||||
using qk_acc_vec_type = vec_op::FP32Vec16;
|
using qk_acc_vec_type = vec_op::FP32Vec16;
|
||||||
using v_load_vec_type = vec_op::FP16Vec16;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __AVX512BF16__
|
#ifdef __AVX512BF16__
|
||||||
|
|||||||
@ -25,7 +25,13 @@ struct KernelVecType<c10::BFloat16> {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct KernelVecType<c10::Half> {
|
struct KernelVecType<c10::Half> {
|
||||||
|
#ifdef __powerpc64__
|
||||||
|
// Power architecture-specific vector type
|
||||||
|
using load_vec_type = vec_op::FP32Vec16;
|
||||||
|
#else
|
||||||
|
// Fallback for other architectures
|
||||||
using load_vec_type = vec_op::FP16Vec16;
|
using load_vec_type = vec_op::FP16Vec16;
|
||||||
|
#endif
|
||||||
using azp_adj_load_vec_type = vec_op::INT32Vec16;
|
using azp_adj_load_vec_type = vec_op::INT32Vec16;
|
||||||
using cvt_vec_type = vec_op::FP32Vec16;
|
using cvt_vec_type = vec_op::FP32Vec16;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user