Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1ff1218
Add first dummy version of NCCL backend
msimberg Nov 3, 2025
76a8d17
Clean up some unnecessary nccl files and try to port more mpi functio…
msimberg Nov 3, 2025
f185ce6
Add todos
msimberg Nov 27, 2025
d4909b3
Update nccl support
msimberg Dec 3, 2025
2349474
Slightly more working nccl backend with events as requests and lots o…
msimberg Dec 18, 2025
d3a4b04
Enable one more nccl test
msimberg Dec 18, 2025
4deaf82
Remove TODOs
msimberg Dec 19, 2025
69a46aa
Add is_stream_aware, start_group, end_group to all backends
msimberg Dec 19, 2025
56a0159
Clean up nccl event/request handling
msimberg Dec 19, 2025
c8e91c1
Remove debugging print
msimberg Dec 19, 2025
90933b3
cleap
msimberg Dec 19, 2025
f8c3258
Clean up and disable some tests with NCCL
msimberg Dec 22, 2025
5908b18
Remove TODO
msimberg Dec 22, 2025
e7f6fbb
Add missing cuda_event.hpp file
msimberg Dec 22, 2025
8eb0cec
Update hwmalloc
msimberg Dec 22, 2025
a6810db
Minor cleanup
msimberg Dec 22, 2025
8a854e4
More cleanup
msimberg Dec 22, 2025
863750d
Add missing stream argument
msimberg Jan 6, 2026
ea4742b
Add dummy stream parameter to libfabric and ucx backends
msimberg Jan 6, 2026
729460f
Remove TODO from FindNCCL.cmake
msimberg Jan 6, 2026
3757868
Remove TODO from test_locality.cpp
msimberg Jan 6, 2026
fb91491
Add event pool and cached cuda event helper
msimberg Jan 7, 2026
4c295b0
Remove duplicate key in clang-format config
msimberg Jan 8, 2026
fe3904d
Format nccl files
msimberg Jan 8, 2026
4ea3bef
Remove debug prints
msimberg Jan 8, 2026
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
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ BreakBeforeBraces: Allman
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
BreakConstructorInitializers: BeforeComma
ConstructorInitializerIndentWidth: 0
BreakInheritanceList: BeforeComma
#AllowShortBlocksOnASingleLine: Always
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ include(oomph_ucx)
# ---------------------------------------------------------------------
include(oomph_libfabric)

# ---------------------------------------------------------------------
# oomph NCCL variant
# ---------------------------------------------------------------------
include(oomph_nccl)

# ---------------------------------------------------------------------
# main src subdir
# ---------------------------------------------------------------------
Expand Down
72 changes: 72 additions & 0 deletions cmake/FindNCCL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# From https://github.com/pytorch/gloo/blob/main/cmake/Modules/Findnccl.cmake.

# Try to find NCCL
#
# The following variables are optionally searched for defaults
# NCCL_ROOT_DIR: Base directory where all NCCL components are found
# NCCL_INCLUDE_DIR: Directory where NCCL header is found
# NCCL_LIB_DIR: Directory where NCCL library is found
#
# The following are set after configuration is done:
# NCCL_FOUND
# NCCL_INCLUDE_DIRS
# NCCL_LIBRARIES
#
# The path hints include CUDA_TOOLKIT_ROOT_DIR seeing as some folks
# install NCCL in the same location as the CUDA toolkit.
# See https://github.com/caffe2/caffe2/issues/1601

set(NCCL_ROOT_DIR $ENV{NCCL_ROOT_DIR} CACHE PATH "Folder contains NVIDIA NCCL")

find_path(NCCL_INCLUDE_DIR
NAMES nccl.h
HINTS
${NCCL_INCLUDE_DIR}
${NCCL_ROOT_DIR}
${NCCL_ROOT_DIR}/include
${CUDA_TOOLKIT_ROOT_DIR}/include)

if ($ENV{USE_STATIC_NCCL})
message(STATUS "USE_STATIC_NCCL detected. Linking against static NCCL library")
set(NCCL_LIBNAME "libnccl_static.a")
else()
set(NCCL_LIBNAME "nccl")
endif()

find_library(NCCL_LIBRARY
NAMES ${NCCL_LIBNAME}
HINTS
${NCCL_LIB_DIR}
${NCCL_ROOT_DIR}
${NCCL_ROOT_DIR}/lib
${NCCL_ROOT_DIR}/lib/x86_64-linux-gnu
${NCCL_ROOT_DIR}/lib64
${CUDA_TOOLKIT_ROOT_DIR}/lib64)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIR NCCL_LIBRARY)

if (NCCL_FOUND)
set(NCCL_HEADER_FILE "${NCCL_INCLUDE_DIR}/nccl.h")
message(STATUS "Determining NCCL version from the header file: ${NCCL_HEADER_FILE}")
file (STRINGS ${NCCL_HEADER_FILE} NCCL_MAJOR_VERSION_DEFINED
REGEX "^[ \t]*#define[ \t]+NCCL_MAJOR[ \t]+[0-9]+.*$" LIMIT_COUNT 1)
if (NCCL_MAJOR_VERSION_DEFINED)
string (REGEX REPLACE "^[ \t]*#define[ \t]+NCCL_MAJOR[ \t]+" ""
NCCL_MAJOR_VERSION ${NCCL_MAJOR_VERSION_DEFINED})
message(STATUS "NCCL_MAJOR_VERSION: ${NCCL_MAJOR_VERSION}")
endif()
set(NCCL_INCLUDE_DIRS ${NCCL_INCLUDE_DIR})
set(NCCL_LIBRARIES ${NCCL_LIBRARY})
message(STATUS "Found NCCL (include: ${NCCL_INCLUDE_DIRS}, library: ${NCCL_LIBRARIES})")
mark_as_advanced(NCCL_ROOT_DIR NCCL_INCLUDE_DIRS NCCL_LIBRARIES)

if(NOT TARGET NCCL::nccl AND NCCL_FOUND)
add_library(NCCL::nccl SHARED IMPORTED)
set_target_properties(NCCL::nccl PROPERTIES
IMPORTED_LOCATION ${NCCL_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${NCCL_INCLUDE_DIRS}
)
endif()
endif()

18 changes: 18 additions & 0 deletions cmake/oomph_nccl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# set all NCCL related options and values

#------------------------------------------------------------------------------
# Enable NCCL support
#------------------------------------------------------------------------------
set(OOMPH_WITH_NCCL OFF CACHE BOOL "Build with NCCL backend")

if (OOMPH_WITH_NCCL)
find_package(NCCL REQUIRED)
add_library(oomph_nccl SHARED)
add_library(oomph::nccl ALIAS oomph_nccl)
oomph_shared_lib_options(oomph_nccl)
target_link_libraries(oomph_nccl PUBLIC NCCL::nccl)
install(TARGETS oomph_nccl
EXPORT oomph-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
Loading
Loading