From 3d46d2ece759d412e8be12055de9d5b09900b8da Mon Sep 17 00:00:00 2001 From: Sanket Kale Date: Thu, 14 Nov 2024 18:02:03 +0530 Subject: [PATCH] Rebased and resolved merge conflicts --- cmake/cpu_extension.cmake | 20 ++++++-------------- csrc/cpu/attention.cpp | 4 +++- requirements-cpu.txt | 12 +++--------- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/cmake/cpu_extension.cmake b/cmake/cpu_extension.cmake index cfa641aa015e2..c65ad2940a6e4 100644 --- a/cmake/cpu_extension.cmake +++ b/cmake/cpu_extension.cmake @@ -16,9 +16,14 @@ include_directories("${CMAKE_SOURCE_DIR}/csrc") # # Check the compile flags # + +if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + list(APPEND CXX_COMPILE_FLAGS + "-mf16c" + ) +endif() list(APPEND CXX_COMPILE_FLAGS "-fopenmp" - "-mf16c" "-DVLLM_CPU_EXTENSION") execute_process(COMMAND cat /proc/cpuinfo @@ -134,20 +139,7 @@ endif() message(STATUS "CPU extension compile flags: ${CXX_COMPILE_FLAGS}") -<<<<<<< HEAD -<<<<<<< HEAD list(APPEND LIBS numa) -======= -list(APPEND LIBS dnnl numa) ->>>>>>> ad80d348 (Enabled path for ARM machines) -======= -list(APPEND LIBS numa) - -# Appending the dnnl library for the AVX2 and AVX512, as it is not utilized by Power architecture. -if (AVX2_FOUND OR AVX512_FOUND) - list(APPEND LIBS dnnl) -endif() ->>>>>>> b424c9aa (Enabled path for ARM machines) # # _C extension diff --git a/csrc/cpu/attention.cpp b/csrc/cpu/attention.cpp index e9d7c79427b0c..eb359ec17565e 100644 --- a/csrc/cpu/attention.cpp +++ b/csrc/cpu/attention.cpp @@ -22,6 +22,7 @@ struct KernelVecType { using v_load_vec_type = vec_op::FP32Vec16; }; +#ifndef __aarch64__ template <> struct KernelVecType { using q_load_vec_type = vec_op::FP16Vec8; @@ -31,6 +32,7 @@ struct KernelVecType { using qk_acc_vec_type = vec_op::FP32Vec16; using v_load_vec_type = vec_op::FP16Vec16; }; +#endif #ifdef __AVX512BF16__ template <> @@ -781,4 +783,4 @@ void paged_attention_v2( CALL_V2_KERNEL_LAUNCHER_BLOCK_SIZE(scalar_t); CPU_KERNEL_GUARD_OUT(paged_attention_v2_impl) }); -} +} \ No newline at end of file diff --git a/requirements-cpu.txt b/requirements-cpu.txt index ac20ea15f4aab..81710ae516ef2 100644 --- a/requirements-cpu.txt +++ b/requirements-cpu.txt @@ -1,13 +1,7 @@ # Common dependencies -r requirements-common.txt -<<<<<<< HEAD -# Dependencies for x86_64 CPUs -torch == 2.5.1+cpu; platform_machine != "ppc64le" -torchvision; platform_machine != "ppc64le" # required for the image processor of phi3v, this must be updated alongside torch -======= # Dependencies for CPUs -torch==2.4.0+cpu; platform_machine != "ppc64le" and platform_machine != "aarch64" -torch==2.4.0; platform_machine == "aarch64" -torchvision; platform_machine != "ppc64le" # required for the image processor of phi3v, this must be updated alongside torch ->>>>>>> ad80d348 (Enabled path for ARM machines) +torch==2.5.1+cpu; platform_machine != "ppc64le" and platform_machine != "aarch64" +torch==2.5.0; platform_machine == "aarch64" +torchvision; platform_machine != "ppc64le" # required for the image processor of phi3v, this must be updated alongside torch \ No newline at end of file