Skip to content

Commit

Permalink
Relax NCCL version constraints
Browse files Browse the repository at this point in the history
Instead of requiring exact NCCL version,
relax constraints to the standard ABI versioning rules, namely
found_version >= major.minor && found_version < major + 1,
where major and minor are from the NCCL headers we use.
  • Loading branch information
sogartar authored and powderluv committed Aug 15, 2023
1 parent f0a5156 commit 3f1e5e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions runtime/src/iree/hal/drivers/cuda/cuda_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ static iree_status_t iree_hal_cuda_device_create_channel(
if (!device->context_wrapper.syms->nccl_library) {
return iree_make_status(
IREE_STATUS_UNAVAILABLE,
"NCCL runtime library (%d.%d.%d) not available; ensure installed and "
"the shared library is on your PATH/LD_LIBRARY_PATH "
"(nccl.dll/libnccl.so)",
NCCL_MAJOR, NCCL_MINOR, NCCL_PATCH);
"NCCL runtime library version %d.%d and greater not available; "
" ensure installed and the shared library (nccl.dll/libnccl.so) "
"is on your PATH/LD_LIBRARY_PATH.",
NCCL_MAJOR, NCCL_MINOR);
}

// Today we only allow a single logical device per channel.
Expand Down
15 changes: 8 additions & 7 deletions runtime/src/iree/hal/drivers/cuda/dynamic_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ static iree_status_t iree_hal_cuda_nccl_check_version(
minor = (nccl_version % 10000) / 100;
}
patch = nccl_version % 100;
if (major != NCCL_MAJOR || minor != NCCL_MINOR || patch != NCCL_PATCH) {
int required_minimum_version = NCCL_VERSION(NCCL_MAJOR, NCCL_MINOR, 0);
if (major != NCCL_MAJOR || nccl_version < required_minimum_version) {
return iree_make_status(
IREE_STATUS_UNAVAILABLE,
"NCCL version is %d.%d.%d, but %d.%d.%d is required", major, minor,
patch, NCCL_MAJOR, NCCL_MINOR, NCCL_PATCH);
"NCCL version is %d.%d.%d, but >=%d.%d and <%d is required", major,
minor, patch, NCCL_MAJOR, NCCL_MINOR, NCCL_MAJOR + 1);
}

return iree_ok_status();
Expand Down Expand Up @@ -174,10 +175,10 @@ iree_status_t iree_hal_cuda_nccl_dynamic_symbols_initialize(
iree_status_ignore(status);
status = iree_make_status(
IREE_STATUS_UNAVAILABLE,
"NCCL runtime library (%d.%d.%d) not available; ensure installed and "
"the shared library is on your PATH/LD_LIBRARY_PATH "
"(nccl.dll/libnccl.so)",
NCCL_MAJOR, NCCL_MINOR, NCCL_PATCH);
"NCCL runtime library version %d.%d and greater not available; "
" ensure installed and the shared library (nccl.dll/libnccl.so) "
"is on your PATH/LD_LIBRARY_PATH.",
NCCL_MAJOR, NCCL_MINOR);
}

if (iree_status_is_ok(status)) {
Expand Down

0 comments on commit 3f1e5e7

Please sign in to comment.