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

IPEX adaption #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ if(Patch_FOUND)
else()
message(FATAL_ERROR, "Did not find patch")
endif()
set (patch_file "${CMAKE_CURRENT_SOURCE_DIR}/patches/Fix_the_link_path_issue_in_oneCCL.patch")
execute_process(COMMAND ${Patch_EXECUTABLE} -p1 -i ${patch_file} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set (patch_file "${CMAKE_CURRENT_SOURCE_DIR}/patches/oneCCL.patch")
execute_process(COMMAND ${Patch_EXECUTABLE} -p1 -i ${patch_file} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/third_party/oneCCL)

# Find OneCCL Lib
set(DEPENDS_LIB)
Expand Down
24 changes: 0 additions & 24 deletions patches/Fix_the_link_path_issue_in_oneCCL.patch

This file was deleted.

109 changes: 109 additions & 0 deletions patches/oneCCL.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4dce00..fa3f90c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -253,9 +253,9 @@ configure_file(cmake/vars.sh.in ${CMAKE_CURRENT_BINARY_DIR}/vars.sh @ONLY)
configure_file(cmake/setvars.sh.in ${CMAKE_CURRENT_BINARY_DIR}/setvars.sh @ONLY)
configure_file(cmake/ccl ${CMAKE_CURRENT_BINARY_DIR}/ccl @ONLY)
configure_file(third-party-programs.txt ${CMAKE_CURRENT_BINARY_DIR}/third-party-programs.txt COPYONLY)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vars.sh DESTINATION ${CCL_INSTALL_ENV})
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/setvars.sh DESTINATION ${CCL_INSTALL_ENV})
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ccl DESTINATION ${CCL_INSTALL_MODULE})
+#install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vars.sh DESTINATION ${CCL_INSTALL_ENV})
+#install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/setvars.sh DESTINATION ${CCL_INSTALL_ENV})
+#install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ccl DESTINATION ${CCL_INSTALL_MODULE})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/third-party-programs.txt DESTINATION ${CCL_INSTALL_LICENSE})
install(PROGRAMS ${PROJECT_SOURCE_DIR}/LICENSE DESTINATION ${CCL_INSTALL_LICENSE})

@@ -274,14 +274,14 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
#include other CMakeLists

add_subdirectory(src)
-add_subdirectory(examples/benchmark)
-add_subdirectory(examples/common)
-add_subdirectory(examples/cpu)
+#add_subdirectory(examples/benchmark)
+#add_subdirectory(examples/common)
+#add_subdirectory(examples/cpu)
if (CCL_ENABLE_SYCL)
add_subdirectory(examples/sycl)
endif()

-add_subdirectory(tests/functional)
+#add_subdirectory(tests/functional)

if (BUILD_UT)
#add_subdirectory(tests/unit)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d5a25c0..b644a4a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -232,7 +232,7 @@ link_directories(${LIBFABRIC_LIB_DIR})
add_library(ccl SHARED $<TARGET_OBJECTS:ccl-objects>)
target_include_directories(ccl PUBLIC ${CCL_INC_DIRS})
# link with release_mt libmpi.so for oneAPI Base toolkit
-set_target_properties(ccl PROPERTIES LINK_FLAGS "-Wl,-rpath,../../../../mpi/latest/lib/release_mt/")
+set_target_properties(ccl PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_INSTALL_RPATH}")
target_link_libraries(ccl PUBLIC dl pthread ${EXTERNAL_LIBS} ${COMPUTE_RUNTIME_TARGET_NAME} fabric mpi)
if (NOT LIB_SO_VERSION AND NOT LIB_MAJOR_VERSION)
set_target_properties(ccl PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CCL_BUILD_DIR})
@@ -240,20 +240,21 @@ else()
set_target_properties(ccl PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CCL_BUILD_DIR} VERSION ${LIB_SO_VERSION} SOVERSION ${LIB_MAJOR_VERSION})
endif()
install(TARGETS ccl LIBRARY DESTINATION ${CCL_INSTALL_LIB})
-install(FILES
- "../cmake/FindOpenCL.cmake"
- "../cmake/FindL0.cmake"
- "../cmake/FindSYCL.cmake"
- "../cmake/FindIntelSYCL.cmake"
- "../cmake/FindComputeCpp.cmake"
- DESTINATION ${CCL_INSTALL_LIB})
+
+#install(FILES
+# "../cmake/FindOpenCL.cmake"
+# "../cmake/FindL0.cmake"
+# "../cmake/FindSYCL.cmake"
+# "../cmake/FindIntelSYCL.cmake"
+# "../cmake/FindComputeCpp.cmake"
+# DESTINATION ${CCL_INSTALL_LIB})


#static library
add_library(ccl-static STATIC $<TARGET_OBJECTS:ccl-objects>)
set_target_properties(ccl-static PROPERTIES OUTPUT_NAME ccl)
set_target_properties(ccl-static PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CCL_BUILD_DIR})
-install(TARGETS ccl-static ARCHIVE DESTINATION ${CCL_INSTALL_LIB} OPTIONAL)
+#install(TARGETS ccl-static ARCHIVE DESTINATION ${CCL_INSTALL_LIB} OPTIONAL)

if(MULTI_GPU_SUPPORT)
message("Turn on L0 multi-gpu unit tests")
@@ -266,8 +267,8 @@ if(MULTI_GPU_SUPPORT)
endif(MULTI_GPU_SUPPORT)

#headers installation
-install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
- DESTINATION ${CCL_INSTALL_INCLUDE} FILES_MATCHING REGEX ".*\\.(h|hpp)$")
+#install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
+# DESTINATION ${CCL_INSTALL_INCLUDE} FILES_MATCHING REGEX ".*\\.(h|hpp)$")

#mpi & ofi rt
file(GLOB mpi_bins "${PROJECT_SOURCE_DIR}/mpi/bin/*")
@@ -276,14 +277,14 @@ install(PROGRAMS ${mpi_bins} DESTINATION ${CCL_INSTALL_BIN})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/ofi/lib/
DESTINATION ${CCL_INSTALL_LIB})

-install(DIRECTORY ${PROJECT_SOURCE_DIR}/mpi/include/
- DESTINATION ${CCL_INSTALL_INCLUDE})
+#install(DIRECTORY ${PROJECT_SOURCE_DIR}/mpi/include/
+# DESTINATION ${CCL_INSTALL_INCLUDE})

install(DIRECTORY ${PROJECT_SOURCE_DIR}/mpi/lib/
DESTINATION ${CCL_INSTALL_LIB})

-install(DIRECTORY ${PROJECT_SOURCE_DIR}/mpi/etc/
- DESTINATION ${CCL_INSTALL_ETC})
+#install(DIRECTORY ${PROJECT_SOURCE_DIR}/mpi/etc/
+# DESTINATION ${CCL_INSTALL_ETC})

install(DIRECTORY ${PROJECT_SOURCE_DIR}/mpi/licensing/
DESTINATION ${CCL_INSTALL_LICENSE}/mpi/)