Skip to content

Commit

Permalink
Intel(R) oneAPI Collective Communications Library (oneCCL) 2021.5.2 (#72
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sazanovd authored Mar 2, 2022
1 parent b5d62ca commit b7d66de
Show file tree
Hide file tree
Showing 374 changed files with 31,424 additions and 21,458 deletions.
52 changes: 43 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ option(BUILD_EXAMPLES "Build examples" TRUE)
option(BUILD_FT "Build functional tests" TRUE)
option(BUILD_REG_TESTS "Build regression tests" TRUE)
option(BUILD_CONFIG "Build cmake configs" TRUE)
option(ENABLE_MPI "Enable MPI for library" TRUE)
option(ENABLE_MPI_TESTS "Enable MPI for tests" TRUE)
option(ENABLE_SYCL_INTEROP_EVENT "Enable support for interop event functionality" TRUE)
option(ENABLE_OFI_HMEM "Enable support for OFI HMEM" FALSE)
option(ENABLE_MPI "Enable MPI support" TRUE)
option(ENABLE_MPI_TESTS "Enable MPI tests support" TRUE)
option(ENABLE_SYCL_INTEROP_EVENT "Enable SYCL interop event support" TRUE)
option(ENABLE_OFI_HMEM "Enable support OFI HMEM support" FALSE)
option(ENABLE_OFI_OOT_PROV "Enable OFI out-of-tree providers support" FALSE)
option(ENABLE_ITT "Enable ITT profiling support" TRUE)
option(ENABLE_STUB_BACKEND "Enable stub backend" TRUE)

option(USE_CODECOV_FLAGS "Calculate code coverage" FALSE)
option(WITH_ASAN "Use address sanitizer, can only be used in Debug build" FALSE)
Expand All @@ -75,6 +78,9 @@ message(STATUS "Enable MPI support: ${ENABLE_MPI}")
message(STATUS "Enable MPI tests support: ${ENABLE_MPI_TESTS}")
message(STATUS "Enable SYCL interop event support: ${ENABLE_SYCL_INTEROP_EVENT}")
message(STATUS "Enable OFI HMEM support: ${ENABLE_OFI_HMEM}")
message(STATUS "Enable OFI out-of-tree providers support: ${ENABLE_OFI_OOT_PROV}")
message(STATUS "Enable ITT profiling support: ${ENABLE_ITT}")
message(STATUS "Enable stub backend" ${ENABLE_STUB_BACKEND})

add_definitions(-DCCL_C_COMPILER="${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
add_definitions(-DCCL_CXX_COMPILER="${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
Expand Down Expand Up @@ -118,6 +124,13 @@ set(HWLOC_LIB_DIR "${DEPS_DIR}/hwloc/lib/")
message(STATUS "HWLOC_INCLUDE_DIR: ${HWLOC_INCLUDE_DIR}")
message(STATUS "HWLOC_LIB_DIR: ${HWLOC_LIB_DIR}")

set(ITT_INCLUDE_DIR "${DEPS_DIR}/itt/include")
set(ITT_LIB_DIR "${DEPS_DIR}/itt/lib64")
message(STATUS "ITT_INCLUDE_DIR: ${ITT_INCLUDE_DIR}")
message(STATUS "ITT_LIB_DIR: ${ITT_LIB_DIR}")

set(LEVEL_ZERO_INCLUDE_DIR "${DEPS_DIR}/level_zero/include/")
message(STATUS "LEVEL_ZERO_INCLUDE_DIR: ${LEVEL_ZERO_INCLUDE_DIR}")

set(CMAKE_SKIP_INSTALL_RPATH TRUE)
set(CMAKE_SKIP_RPATH TRUE)
Expand All @@ -130,30 +143,51 @@ if (${CMAKE_VERSION} VERSION_LESS 3.1)
endif()

# common release/debug compilation settings
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_COMPILER_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Werror -D_GNU_SOURCE -fvisibility=internal")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_COMPILER_FLAGS} -Wall -Wextra -Wno-unused-parameter -Werror -D_GNU_SOURCE -fvisibility=internal")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${C_COMPILER_FLAGS} -O0 -g -DENABLE_DEBUG")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${C_COMPILER_FLAGS} -O3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${C_COMPILER_FLAGS} -O2 -g")
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_COMPILER_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Werror -D_GNU_SOURCE -fvisibility=internal")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_COMPILER_FLAGS} -Wall -Wextra -Wno-unused-parameter -Werror -D_GNU_SOURCE -fvisibility=internal")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CXX_COMPILER_FLAGS} -O0 -g -DENABLE_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CXX_COMPILER_FLAGS} -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${CXX_COMPILER_FLAGS} -O2 -g")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-fallthrough")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough")
endif()

set(COMMON_CMAKE_DIR ${PROJECT_SOURCE_DIR}/cmake)
if (COMPUTE_BACKEND)
precheck_compute_backend()
message(STATUS "COMPUTE_BACKEND: ${COMPUTE_BACKEND}")
set_compute_backend(${COMMON_CMAKE_DIR})
if (${COMPUTE_BACKEND} STREQUAL "dpcpp_level_zero" AND ENABLE_OFI_HMEM)
if (${COMPUTE_BACKEND} STREQUAL "dpcpp" AND ENABLE_OFI_HMEM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCCL_ENABLE_OFI_HMEM=1")
message(STATUS "Enable OFI HMEM support for compute backend ${COMPUTE_BACKEND}")
endif()
endif()

if (ENABLE_OFI_OOT_PROV)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCCL_ENABLE_OFI_OOT_PROV=1")
message(STATUS "Enable OFI out-of-tree providers support")
endif()

if (ENABLE_ITT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCCL_ENABLE_ITT=1")
message(STATUS "Enable ITT profiling support")
endif()

if (ENABLE_STUB_BACKEND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCCL_ENABLE_STUB_BACKEND=1")
message(STATUS "Enable stub backend")
endif()

if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
#c++17 introduces algined new operator, use it
Expand Down Expand Up @@ -192,7 +226,7 @@ enable_testing()

set(EXTERNAL_LIBS "")

set(EXAMPLES_INC_DIRS ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/examples/include ${MPI_INCLUDE_DIR})
set(EXAMPLES_INC_DIRS ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/examples/include ${MPI_INCLUDE_DIR} ${LEVEL_ZERO_INCLUDE_DIR})
set(EXAMPLES_LIB_DIRS ${MPI_LIB_DIR} ${LIBFABRIC_LIB_DIR})

# allow `deprecated`
Expand Down Expand Up @@ -221,7 +255,7 @@ endif()

set(CCL_MAJOR_VERSION "2021")
set(CCL_MINOR_VERSION "5")
set(CCL_UPDATE_VERSION "0")
set(CCL_UPDATE_VERSION "2")
set(CCL_PRODUCT_STATUS "Gold")
string(TIMESTAMP CCL_PRODUCT_BUILD_DATE "%Y-%m-%dT %H:%M:%SZ")
get_vcs_properties("git")
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ If your CXX compiler requires SYCL, it is possible to specify it (DPC++ is suppo
Modify `cmake` command as follows:

```
cmake .. -DCMAKE_C_COMPILER=your_c_compiler -DCMAKE_CXX_COMPILER=dpcpp -DCOMPUTE_BACKEND=dpcpp_level_zero
cmake .. -DCMAKE_C_COMPILER=your_c_compiler -DCMAKE_CXX_COMPILER=dpcpp -DCOMPUTE_BACKEND=dpcpp
```

## Specify the build type
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Intel(R) oneAPI DPC++/C++ Compiler with Level Zero v1.0 support.

To install Level Zero, refer to the instructions in [Intel(R) Graphics Compute Runtime repository](https://github.com/intel/compute-runtime/releases) or to the [installation guide](https://dgpu-docs.intel.com/installation-guides/index.html) for oneAPI users.

### BF16 support <!-- omit in toc -->

- AVX512F-based implementation requires GCC 4.9 or higher.
- AVX512_BF16-based implementation requires GCC 10.0 or higher and GNU binutils 2.33 or higher.


## Installation

General installation scenario:
Expand Down
60 changes: 0 additions & 60 deletions cmake/FindComputeCpp.cmake

This file was deleted.

12 changes: 4 additions & 8 deletions cmake/FindIntelSYCL_level_zero.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ else()
message("DPCPP_ROOT prefix path hint is not defiend")
endif()

find_package(level_zero REQUIRED)
set(COMPUTE_BACKEND_NAME ze_loader)

if (NOT COMPUTE_BACKEND_NAME)
message("Not OpenCL or L0")
endif()


include(CheckCXXCompilerFlag)
include(FindPackageHandleStandardArgs)

Expand Down Expand Up @@ -70,12 +66,12 @@ find_package_handle_standard_args(IntelSYCL_level_zero
INTEL_SYCL_SUPPORTED)

if(IntelSYCL_level_zero_FOUND AND NOT TARGET Intel::SYCL_level_zero)
get_target_property(LEVEL_ZERO_INCLUDE_DIRECTORIES ze_loader INTERFACE_INCLUDE_DIRECTORIES)

add_library(Intel::SYCL_level_zero UNKNOWN IMPORTED)
list(APPEND SYCL_LEVEL_ZERO_INCLUDE_DIRS "${LEVEL_ZERO_INCLUDE_DIRECTORIES}")
list(APPEND SYCL_LEVEL_ZERO_INCLUDE_DIRS "${INTEL_SYCL_INCLUDE_DIRS}")
message(STATUS "IntelSYCL_level_zero_FOUND: ${LEVEL_ZERO_INCLUDE_DIR}")
list(APPEND SYCL_LEVEL_ZERO_INCLUDE_DIRS "${LEVEL_ZERO_INCLUDE_DIR}")
list(APPEND SYCL_LEVEL_ZERO_INCLUDE_DIRS "${INTEL_SYCL_INCLUDE_DIRS}")

message(STATUS "SYCL_LEVEL_ZERO_INCLUDE_DIRS: ${SYCL_LEVEL_ZERO_INCLUDE_DIRS}")
set(imp_libs
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:-fsycl>
${COMPUTE_BACKEND_NAME})
Expand Down
Loading

0 comments on commit b7d66de

Please sign in to comment.