From 248d6c068cd2d07ecfd33293b892d89d74131318 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Fri, 10 Oct 2025 12:10:27 +0800 Subject: [PATCH 1/3] add print dispatch --- src/BuildOnWindows.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BuildOnWindows.cmake b/src/BuildOnWindows.cmake index bf067c8e70..ee4ffea31e 100644 --- a/src/BuildOnWindows.cmake +++ b/src/BuildOnWindows.cmake @@ -8,7 +8,7 @@ macro(setup_common_libraries) torch_xpu_ops STATIC ${ATen_XPU_CPP_SRCS}) - set(PATH_TO_TORCH_XPU_OPS_ATEN_LIB \"torch_xpu_ops_aten.dll\") + set(PATH_TO_TORCH_XPU_OPS_ATEN_LIB "torch_xpu_ops_aten.dll") target_compile_options(torch_xpu_ops PRIVATE -DPATH_TO_TORCH_XPU_OPS_ATEN_LIB=${PATH_TO_TORCH_XPU_OPS_ATEN_LIB}) add_library( @@ -25,6 +25,7 @@ macro(setup_common_libraries) endmacro() if(BUILD_SEPARATE_OPS) + message("!!!!! BUILD_SEPARATE_OPS: ${BUILD_SEPARATE_OPS} - 1") setup_common_libraries() foreach(sycl_src ${ATen_XPU_SYCL_SRCS}) get_filename_component(name ${sycl_src} NAME_WLE REALPATH) @@ -44,6 +45,7 @@ if(BUILD_SEPARATE_OPS) # Working with the compilers which don't support device code compression, we have to split kernels # into multiple libraries to meet the bin size limitation. elseif(BUILD_SPLIT_KERNEL_LIB OR __INTEL_LLVM_COMPILER LESS 20250004 OR ICX_DATE LESS 20241205) + message("!!!!! BUILD_SEPARATE_OPS: ${BUILD_SEPARATE_OPS} - 2") setup_common_libraries() # Split SYCL kernels into 2 libraries as categories 1) Unary+Binary 2) Others. set(ATen_XPU_SYCL_BINARY_SRCS) @@ -242,6 +244,7 @@ elseif(BUILD_SPLIT_KERNEL_LIB OR __INTEL_LLVM_COMPILER LESS 20250004 OR ICX_DATE list(APPEND TORCH_XPU_OPS_LIBRARIES torch_xpu_ops) list(APPEND TORCH_XPU_OPS_LIBRARIES torch_xpu_ops_aten) else() + message("!!!!! BUILD_SEPARATE_OPS: ${BUILD_SEPARATE_OPS} - 3") # On Windows, it is not possible to combine all obj files into one library # because the obj files of kernels compiled on Windows are much larger than # those on Linux. If they are combined into one, the library size will exceed From 2960869bf51b263799fea055f523a3196f778211 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Fri, 10 Oct 2025 22:32:59 +0800 Subject: [PATCH 2/3] update code. --- src/BuildOnWindows.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BuildOnWindows.cmake b/src/BuildOnWindows.cmake index ee4ffea31e..91fac614db 100644 --- a/src/BuildOnWindows.cmake +++ b/src/BuildOnWindows.cmake @@ -34,6 +34,7 @@ if(BUILD_SEPARATE_OPS) ${sycl_lib} SHARED SYCL_SOURCES ${sycl_src}) + target_link_libraries(${sycl_lib} PUBLIC torch_xpu) target_link_libraries(torch_xpu_ops_aten PUBLIC ${sycl_lib}) list(APPEND TORCH_XPU_OPS_LIBRARIES ${sycl_lib}) From d6ce30287f2ed35666f0b3c0ac9ed64a774a3f41 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Sat, 11 Oct 2025 21:21:15 +0800 Subject: [PATCH 3/3] update code --- src/BuildOnWindows.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BuildOnWindows.cmake b/src/BuildOnWindows.cmake index 91fac614db..97fc1063b6 100644 --- a/src/BuildOnWindows.cmake +++ b/src/BuildOnWindows.cmake @@ -8,8 +8,7 @@ macro(setup_common_libraries) torch_xpu_ops STATIC ${ATen_XPU_CPP_SRCS}) - set(PATH_TO_TORCH_XPU_OPS_ATEN_LIB "torch_xpu_ops_aten.dll") - target_compile_options(torch_xpu_ops PRIVATE -DPATH_TO_TORCH_XPU_OPS_ATEN_LIB=${PATH_TO_TORCH_XPU_OPS_ATEN_LIB}) + add_library( torch_xpu_ops_aten @@ -35,6 +34,7 @@ if(BUILD_SEPARATE_OPS) SHARED SYCL_SOURCES ${sycl_src}) target_link_libraries(${sycl_lib} PUBLIC torch_xpu) + target_link_libraries(${sycl_lib} PUBLIC torch_xpu_ops) target_link_libraries(torch_xpu_ops_aten PUBLIC ${sycl_lib}) list(APPEND TORCH_XPU_OPS_LIBRARIES ${sycl_lib})