Skip to content

Commit

Permalink
Rebased and resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket Kale committed Nov 14, 2024
1 parent b8ab3bc commit 3d46d2e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
20 changes: 6 additions & 14 deletions cmake/cpu_extension.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion csrc/cpu/attention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct KernelVecType<float> {
using v_load_vec_type = vec_op::FP32Vec16;
};

#ifndef __aarch64__
template <>
struct KernelVecType<c10::Half> {
using q_load_vec_type = vec_op::FP16Vec8;
Expand All @@ -31,6 +32,7 @@ struct KernelVecType<c10::Half> {
using qk_acc_vec_type = vec_op::FP32Vec16;
using v_load_vec_type = vec_op::FP16Vec16;
};
#endif

#ifdef __AVX512BF16__
template <>
Expand Down Expand Up @@ -781,4 +783,4 @@ void paged_attention_v2(
CALL_V2_KERNEL_LAUNCHER_BLOCK_SIZE(scalar_t);
CPU_KERNEL_GUARD_OUT(paged_attention_v2_impl)
});
}
}
12 changes: 3 additions & 9 deletions requirements-cpu.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3d46d2e

Please sign in to comment.