Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release/2.7] Remove unnecessary static library installation for wheel packaging #1440

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/BuildOnWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ else()
${ATen_XPU_MKL_SRCS}
${ATen_XPU_NATIVE_CPP_SRCS}
${ATen_XPU_GEN_SRCS})
install(TARGETS torch_xpu_ops DESTINATION "${TORCH_INSTALL_LIB_DIR}")
target_compile_definitions(torch_xpu_ops PRIVATE TORCH_XPU_BUILD_MAIN_LIB)
# Split SYCL kernels into 2 libraries as categories 1) Common (Unary+Binary+Reduce+Pow+Copy+Activation+Foreach) 2) Others.
set(ATen_XPU_SYCL_COMMON_SRCS)
Expand All @@ -267,6 +266,10 @@ else()
string(REGEX MATCH "Reduce" IS_REDUCE ${sycl_src})
string(REGEX MATCH "Activation" IS_ACTIVATION ${sycl_src})
string(REGEX MATCH "Foreach" IS_FOREACH ${sycl_src})
string(REGEX MATCH "Norm" IS_NORM ${sycl_src})
string(REGEX MATCH "Loss" IS_LOSS ${sycl_src})
string(REGEX MATCH "Resize" IS_RESIZE ${sycl_src})
string(REGEX MATCH "Distribution" IS_DISTRIBUTION ${sycl_src})

if(NOT IS_FOREACH STREQUAL "")
list(APPEND ATen_XPU_SYCL_COMMON_SRCS ${sycl_src})
Expand All @@ -278,6 +281,14 @@ else()
list(APPEND ATen_XPU_SYCL_COMMON_SRCS ${sycl_src})
elseif(NOT IS_ACTIVATION STREQUAL "")
list(APPEND ATen_XPU_SYCL_COMMON_SRCS ${sycl_src})
elseif(NOT IS_NORM STREQUAL "")
list(APPEND ATen_XPU_SYCL_COMMON_SRCS ${sycl_src})
elseif(NOT IS_LOSS STREQUAL "")
list(APPEND ATen_XPU_SYCL_COMMON_SRCS ${sycl_src})
elseif(NOT IS_RESIZE STREQUAL "")
list(APPEND ATen_XPU_SYCL_COMMON_SRCS ${sycl_src})
elseif(NOT IS_DISTRIBUTION STREQUAL "")
list(APPEND ATen_XPU_SYCL_COMMON_SRCS ${sycl_src})
else()
list(APPEND ATen_XPU_SYCL_OTHERS_SRCS ${sycl_src})
endif()
Expand All @@ -291,9 +302,6 @@ else()
target_compile_definitions(${sycl_common_lib} PRIVATE TORCH_XPU_BUILD_MAIN_LIB)
list(APPEND TORCH_XPU_OPS_LIBRARIES ${sycl_common_lib})

# Decouple with PyTorch cmake definition.
install(TARGETS ${sycl_common_lib} DESTINATION "${TORCH_INSTALL_LIB_DIR}")

# Other kernel lib
set(sycl_lib torch_xpu_ops_sycl_kernels)
sycl_add_library(
Expand All @@ -303,9 +311,6 @@ else()
target_compile_definitions(${sycl_lib} PRIVATE TORCH_XPU_BUILD_MAIN_LIB)
list(APPEND TORCH_XPU_OPS_LIBRARIES ${sycl_lib})

# Decouple with PyTorch cmake definition.
install(TARGETS ${sycl_lib} DESTINATION "${TORCH_INSTALL_LIB_DIR}")

target_link_libraries(torch_xpu_ops
PUBLIC
${sycl_common_lib}
Expand Down
Loading