2019-05-16 16:16:18 +00:00
#!/bin/bash
2023-05-25 16:08:54 -06:00
# Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
2019-05-16 16:16:18 +00:00
2023-06-22 14:30:44 -06:00
# #################################################
# global variables
# #################################################
ROCM_PATH = ${ ROCM_PATH := "/opt/rocm" }
# Default values
build_address_sanitizer = false
2023-09-22 13:05:11 +00:00
build_bfd = false
2023-08-22 09:14:49 -04:00
build_freorg_bkwdcomp = false
2023-06-22 14:30:44 -06:00
build_local_gpu_only = false
2024-01-09 13:29:47 -06:00
build_amdgpu_targets = ""
2023-06-22 14:30:44 -06:00
build_package = false
build_release = true
build_static = false
build_tests = false
2024-05-31 17:58:34 -05:00
build_verbose = false
2023-06-22 14:30:44 -06:00
clean_build = true
collective_trace = true
2025-09-23 10:11:32 -07:00
dump_asm = false
2025-06-10 12:12:36 -05:00
enable_code_coverage = false
2023-06-22 14:30:44 -06:00
enable_ninja = ""
install_dependencies = false
install_library = false
2024-05-31 17:58:34 -05:00
install_prefix = " ${ ROCM_PATH } "
2025-01-31 12:35:39 -05:00
log_trace = false
2026-01-20 13:01:49 -06:00
msccl_kernel_enabled = false
2025-08-28 09:52:12 -05:00
mscclpp_enabled = false
2025-04-30 16:42:28 -05:00
enable_mscclpp_clip = false
2024-01-18 15:07:16 -07:00
num_parallel_jobs = $( nproc)
2023-06-22 14:30:44 -06:00
npkit_enabled = false
2024-07-04 09:34:38 -06:00
openmp_test_enabled = false
2025-10-13 09:12:10 -07:00
kernel_resource_use = false
2025-01-29 11:29:46 -05:00
roctx_enabled = true
2023-06-22 14:30:44 -06:00
run_tests = false
run_tests_all = false
time_trace = false
2025-07-25 10:57:05 -04:00
force_reduce_pipeline = false
2025-09-15 12:19:35 -04:00
generate_sym_kernels = false
2025-12-11 19:04:35 -05:00
warp_speed_enabled = true # note that this flag will be overridden to false for non MI350/MI300 platforms
2025-11-16 22:35:06 -08:00
quiet_warnings = false
2026-01-09 14:04:54 -06:00
build_rocshmem_support = false
2023-06-22 14:30:44 -06:00
2019-05-16 16:16:18 +00:00
# #################################################
# helper functions
# #################################################
function display_help()
{
echo "RCCL build & installation helper script"
2023-06-22 14:30:44 -06:00
echo " Options:"
2023-05-25 16:08:54 -06:00
echo " --address-sanitizer Build with address sanitizer enabled"
2025-08-01 14:19:27 -05:00
echo " -c|--enable-code-coverage Enable code coverage"
2024-11-27 15:34:26 -05:00
echo " -d|--dependencies Install RCCL dependencies"
2023-05-25 16:08:54 -06:00
echo " --debug Build debug library"
2023-09-22 13:05:11 +00:00
echo " --enable_backtrace Build with custom backtrace support"
2023-06-21 16:16:09 -04:00
echo " --disable-colltrace Build without collective trace"
2026-01-20 13:01:49 -06:00
echo " --enable-msccl-kernel Build with MSCCL kernels"
2025-09-23 10:11:32 -07:00
echo " --dump-asm Disassemble code and dump assembly with inline code"
2025-08-28 09:52:12 -05:00
echo " --enable-mscclpp Build with MSCCL++ support"
2025-04-30 16:42:28 -05:00
echo " --enable-mscclpp-clip Build MSCCL++ with clip wrapper on bfloat16 and half addition routines"
2025-01-29 11:29:46 -05:00
echo " --disable-roctx Build without ROCTX logging"
2023-06-22 14:30:44 -06:00
echo " -f|--fast Quick-build RCCL (local gpu arch only, no backtrace, and collective trace support)"
2023-05-25 16:08:54 -06:00
echo " -h|--help Prints this help message"
echo " -i|--install Install RCCL library (see --prefix argument below)"
2023-06-22 14:30:44 -06:00
echo " -j|--jobs Specify how many parallel compilation jobs to run ( $num_parallel_jobs by default)"
2025-10-13 09:12:10 -07:00
echo " --kernel-resource-use Dump GPU kernel resource usage (e.g., VGPRs, scratch, spill) at link stage"
2023-06-22 14:30:44 -06:00
echo " -l|--local_gpu_only Only compile for local GPU architecture"
2024-11-27 15:34:26 -05:00
echo " --amdgpu_targets Only compile for specified GPU architecture(s). For multiple targets, separate by ';' (builds for all supported GPU architectures by default)"
2023-05-25 16:08:54 -06:00
echo " --no_clean Don't delete files if they already exist"
echo " --npkit-enable Compile with npkit enabled"
2025-01-31 12:35:39 -05:00
echo " --log-trace Build with log trace enabled (i.e. NCCL_DEBUG=TRACE)"
2024-07-04 09:34:38 -06:00
echo " --openmp-test-enable Enable OpenMP in rccl unit tests"
2023-05-25 16:08:54 -06:00
echo " -p|--package_build Build RCCL package"
2024-05-31 17:58:34 -05:00
echo " --prefix Specify custom directory to install RCCL to (default: \`/opt/rocm\`)"
2023-05-25 16:08:54 -06:00
echo " --run_tests_all Run all rccl unit tests (must be built already)"
echo " -r|--run_tests_quick Run small subset of rccl unit tests (must be built already)"
echo " --static Build RCCL as a static library instead of shared library"
echo " -t|--tests_build Build rccl unit tests, but do not run"
2024-05-31 17:58:34 -05:00
echo " --time-trace Plot the build time of RCCL (requires \`ninja-build\` package installed on the system)"
2023-05-25 16:08:54 -06:00
echo " --verbose Show compile commands"
2025-07-25 10:57:05 -04:00
echo " --force-reduce-pipeline Force reduce_copy sw pipeline to be used for every reduce-based collectives and datatypes"
2025-09-15 12:19:35 -04:00
echo " --generate-sym-kernels Generate symmetric memory kernels"
2025-11-16 22:35:06 -08:00
echo " -q|--quiet-warnings Suppress majority of compiler warnings (not recommended)"
2026-01-09 14:04:54 -06:00
echo " --rocshmem Build with rocSHMEM support"
2019-05-16 16:16:18 +00:00
}
# #################################################
# Parameter parsing
# #################################################
# check if we have a modern version of getopt that can handle whitespace and long parameters
getopt -T
2024-05-31 17:58:34 -05:00
if [[ " $? " -eq 4 ]] ; then
2026-01-09 14:04:54 -06:00
GETOPT_PARSE = $( getopt --name " ${ 0 } " --options cdfhij:lprtq --longoptions address-sanitizer,dependencies,debug,dump-asm,enable-code-coverage,enable_backtrace,disable-colltrace,disable-msccl-kernel,enable-mscclpp,fast,help,install,jobs:,kernel-resource-use,local_gpu_only,amdgpu_targets:,no_clean,npkit-enable,log-trace,openmp-test-enable,roctx-enable,package_build,prefix:,rm-legacy-include-dir,run_tests_all,run_tests_quick,static,tests_build,time-trace,force-reduce-pipeline,generate-sym-kernels,quiet-warnings,disable-warp-speed,verbose,rocshmem -- " $@ " )
2019-05-16 16:16:18 +00:00
else
echo "Need a new version of getopt"
exit 1
fi
2024-05-31 17:58:34 -05:00
if [[ " $? " -ne 0 ]] ; then
2019-05-16 16:16:18 +00:00
echo "getopt invocation failed; could not parse the command line" ;
exit 1
fi
eval set -- " ${ GETOPT_PARSE } "
while true; do
case " ${ 1 } " in
2023-08-02 09:45:18 -06:00
--address-sanitizer) build_address_sanitizer = true; shift ;;
2025-06-10 12:12:36 -05:00
-c | --enable-code-coverage) enable_code_coverage = true; shift ;;
2023-08-02 09:45:18 -06:00
-d | --dependencies) install_dependencies = true; shift ;;
--debug) build_release = false; shift ;;
2023-10-19 16:35:10 -06:00
--enable_backtrace) build_bfd = true; shift ;;
2023-08-02 09:45:18 -06:00
--disable-colltrace) collective_trace = false; shift ;;
--disable-msccl-kernel) msccl_kernel_enabled = false; shift ;;
2025-09-23 10:11:32 -07:00
--dump-asm) dump_asm = true; shift ;;
2025-08-28 09:52:12 -05:00
--enable-mscclpp) mscclpp_enabled = true; shift ;;
2025-04-30 16:42:28 -05:00
--enable-mscclpp-clip) enable_mscclpp_clip = true; shift ;;
2025-01-29 11:29:46 -05:00
--disable-roctx) roctx_enabled = false; shift ;;
2023-10-19 16:35:10 -06:00
-f | --fast) build_local_gpu_only = true; collective_trace = false; msccl_kernel_enabled = false; shift ;;
2023-08-02 09:45:18 -06:00
-h | --help) display_help; exit 0 ;;
-i | --install) install_library = true; shift ;;
-j | --jobs) num_parallel_jobs = ${ 2 } ; shift 2 ;;
2025-10-13 09:12:10 -07:00
--kernel-resource-use) kernel_resource_use = true; shift ;;
2023-08-02 09:45:18 -06:00
-l | --local_gpu_only) build_local_gpu_only = true; shift ;;
2024-01-09 13:29:47 -06:00
--amdgpu_targets) build_amdgpu_targets = ${ 2 } ; shift 2 ;;
2023-08-02 09:45:18 -06:00
--no_clean) clean_build = false; shift ;;
--npkit-enable) npkit_enabled = true; shift ;;
2025-01-31 12:35:39 -05:00
--log-trace) log_trace = true; shift ;;
2024-07-04 09:34:38 -06:00
--openmp-test-enable) openmp_test_enabled = true; shift ;;
2023-08-02 09:45:18 -06:00
-p | --package_build) build_package = true; shift ;;
2024-05-31 17:58:34 -05:00
--prefix) install_library = true; install_prefix = ${ 2 } ; shift 2 ;;
2023-08-02 09:45:18 -06:00
-r | --run_tests_quick) run_tests = true; shift ;;
--run_tests_all) run_tests = true; run_tests_all = true; shift ;;
--static) build_static = true; shift ;;
-t | --tests_build) build_tests = true; shift ;;
--time-trace) time_trace = true; shift ;;
2024-05-31 17:58:34 -05:00
--verbose) build_verbose = true; shift ;;
2025-09-15 12:19:35 -04:00
--force-reduce-pipeline) force_reduce_pipeline = true; shift ;;
--generate-sym-kernels) generate_sym_kernels = true; shift ;;
2025-12-11 19:04:35 -05:00
--disable-warp-speed) warp_speed_enabled = false; shift ;;
2025-11-16 22:35:06 -08:00
-q | --quiet-warnings) quiet_warnings = true; shift ;;
2026-01-09 14:04:54 -06:00
--rocshmem) build_rocshmem_support = true; shift ;;
2019-06-25 17:25:21 -06:00
--) shift ; break ;;
*) echo "Unexpected command line parameter received; aborting" ;
exit 1
;;
2019-05-16 16:16:18 +00:00
esac
2023-05-25 16:08:54 -06:00
done
2019-05-16 16:16:18 +00:00
2020-06-05 11:04:03 -06:00
# /etc/*-release files describe the system
if [[ -e "/etc/os-release" ]] ; then
source /etc/os-release
elif [[ -e "/etc/centos-release" ]] ; then
OS_ID = $( cat /etc/centos-release | awk '{print tolower($1)}' )
VERSION_ID = $( cat /etc/centos-release | grep -oP '(?<=release )[^ ]*' | cut -d "." -f1)
else
echo "This script depends on the /etc/*-release files"
exit 2
fi
2024-05-31 17:58:34 -05:00
# CMake executable
cmake_executable = cmake
time_trace_ninja_msg = "apt-get install ninja-build"
case " ${ OS_ID } " in
centos| rhel)
cmake_executable = cmake3
time_trace_ninja_msg = "dnf install ninja-build"
;;
esac
# CMake build options; starts with toolchain info
cmake_common_options = "--toolchain=toolchain-linux.cmake"
2020-06-04 11:58:27 -06:00
# throw error code after running a command in the install script
check_exit_code( )
{
2024-05-31 17:58:34 -05:00
if (( $1 != 0 )) ; then
exit " $1 "
fi
2020-06-04 11:58:27 -06:00
}
2024-05-31 17:58:34 -05:00
# set RCCL-UnitTests path
if [[ " ${ build_release } " == true ]] ; then
2022-12-13 21:45:57 +00:00
unit_test_path = "./build/release/test/rccl-UnitTests"
2021-06-04 09:46:04 -06:00
else
2022-12-13 21:45:57 +00:00
unit_test_path = "./build/debug/test/rccl-UnitTests"
2021-06-04 09:46:04 -06:00
fi
2024-05-31 17:58:34 -05:00
if [[ " ${ run_tests } " == true ]] && [[ -f " ${ unit_test_path } " ]] ; then
if [[ " ${ build_tests } " == false ]] ; then
2021-06-04 09:46:04 -06:00
clean_build = false
fi
fi
2019-05-22 15:32:32 -06:00
# #################################################
# prep
# #################################################
# ensure a clean build environment
2024-05-31 17:58:34 -05:00
if [[ " ${ clean_build } " == true ]] ; then
2020-07-21 12:19:47 -06:00
if [[ " ${ build_release } " == true ]] ; then
rm -rf build/release
else
rm -rf build/debug
fi
2019-05-20 16:51:14 +00:00
fi
2019-05-16 16:16:18 +00:00
2019-05-22 15:32:32 -06:00
# Create and go to the build directory.
mkdir -p build; cd build
2024-05-31 17:58:34 -05:00
# Create and go to build type directory
if [[ " ${ build_release } " == true ]] ; then
2019-05-22 15:32:32 -06:00
mkdir -p release; cd release
else
mkdir -p debug; cd debug
fi
# build type
if [[ " ${ build_release } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DCMAKE_BUILD_TYPE=Release"
else
cmake_common_options = " ${ cmake_common_options } -DCMAKE_BUILD_TYPE=Debug"
fi
2023-05-25 16:08:54 -06:00
# Address sanitizer
if [[ " ${ build_address_sanitizer } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DBUILD_ADDRESS_SANITIZER=ON"
2020-08-06 11:19:43 -06:00
fi
2025-06-10 12:12:36 -05:00
# Enable code coverage
if [[ " ${ enable_code_coverage } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DENABLE_CODE_COVERAGE=ON"
fi
2023-05-25 16:08:54 -06:00
# Backtrace support
2023-09-22 13:05:11 +00:00
if [[ " ${ build_bfd } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DBUILD_BFD=ON"
2023-05-25 16:08:54 -06:00
fi
# Build local GPU arch only
2024-05-31 17:58:34 -05:00
if [[ " ${ build_local_gpu_only } " == true ]] ; then
2023-05-25 16:08:54 -06:00
cmake_common_options = " ${ cmake_common_options } -DBUILD_LOCAL_GPU_TARGET_ONLY=ON"
fi
2024-01-09 13:29:47 -06:00
# Build for specified GPU target(s) only
2024-05-31 17:58:34 -05:00
if [[ ! -z " ${ build_amdgpu_targets } " ]] ; then
2024-12-12 12:09:30 -07:00
cmake_common_options = " ${ cmake_common_options } -DGPU_TARGETS= ${ build_amdgpu_targets } "
2024-01-09 13:29:47 -06:00
fi
2023-05-25 16:08:54 -06:00
# shared vs static
if [[ " ${ build_static } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DBUILD_SHARED_LIBS=OFF"
2019-08-23 22:02:42 +00:00
fi
2023-06-21 16:16:09 -04:00
# Disable collective trace
if [[ " ${ collective_trace } " == false ]] ; then
cmake_common_options = " ${ cmake_common_options } -DCOLLTRACE=OFF"
fi
2020-06-05 11:04:03 -06:00
2024-05-31 17:58:34 -05:00
# Disable msccl kernel
2023-08-02 09:45:18 -06:00
if [[ " ${ msccl_kernel_enabled } " == false ]] ; then
cmake_common_options = " ${ cmake_common_options } -DENABLE_MSCCL_KERNEL=OFF"
fi
2025-08-28 09:52:12 -05:00
if [[ " ${ mscclpp_enabled } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DENABLE_MSCCLPP=ON"
2024-07-12 15:32:58 -06:00
fi
2025-04-30 16:42:28 -05:00
if [[ " ${ enable_mscclpp_clip } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DENABLE_MSCCLPP_CLIP=ON"
fi
2023-05-25 16:08:54 -06:00
# Install dependencies
2024-05-31 17:58:34 -05:00
if [[ " ${ install_dependencies } " == true ]] ; then
2020-09-10 17:27:22 -06:00
cmake_common_options = " ${ cmake_common_options } -DINSTALL_DEPENDENCIES=ON"
2019-08-23 22:02:42 +00:00
fi
2020-09-10 17:27:22 -06:00
2024-05-31 17:58:34 -05:00
# Install RCCL library
if [[ " ${ install_library } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DCMAKE_INSTALL_PREFIX= ${ install_prefix } "
fi
2025-10-13 09:12:10 -07:00
if [[ " ${ kernel_resource_use } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DREPORT_KERNEL_RESOURCE_USE=ON"
fi
2025-01-31 12:35:39 -05:00
# Enable trace debug level
if [[ " ${ log_trace } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DTRACE=ON"
fi
2025-01-29 11:29:46 -05:00
# Disable ROCTX
if [[ " ${ roctx_enabled } " == false ]] ; then
cmake_common_options = " ${ cmake_common_options } -DROCTX=OFF"
2024-02-08 14:08:24 -07:00
fi
2025-09-23 10:11:32 -07:00
# Dump ASM files from GPU compilation
if [[ " ${ dump_asm } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DDUMP_ASM=ON"
fi
2024-07-04 09:34:38 -06:00
# Enable OpenMP in unit tests
if [[ " ${ openmp_test_enabled } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DOPENMP_TESTS_ENABLED=ON"
fi
2025-07-25 10:57:05 -04:00
# Force Reduce pipeline
if [[ " ${ force_reduce_pipeline } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DFORCE_REDUCE_PIPELINING=ON"
fi
2025-09-15 12:19:35 -04:00
# Generate symmetric memory kernels
if [[ " ${ generate_sym_kernels } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DGENERATE_SYM_KERNELS=ON"
fi
2024-05-31 17:58:34 -05:00
# Enable NPKit
if [[ " ${ npkit_enabled } " == true ]] ; then
2025-06-23 21:51:49 -05:00
cmake_common_options = " ${ cmake_common_options } -DENABLE_NPKIT=ON"
2023-04-05 08:05:23 -06:00
fi
2025-12-11 19:04:35 -05:00
# Enable WARP_SPEED only on MI350/MI300 platforms
if [[ " ${ warp_speed_enabled } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DENABLE_WARP_SPEED=ON"
fi
2025-11-16 22:35:06 -08:00
# Suppress Warnings
if [[ " ${ quiet_warnings } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DQUIET_WARNINGS=ON"
fi
2026-01-09 14:04:54 -06:00
# Enable rocSHMEM support
if [[ " ${ build_rocshmem_support } " == true ]] ; then
cmake_common_options = " ${ cmake_common_options } -DENABLE_ROCSHMEM=ON"
cmake_common_options = " ${ cmake_common_options } -DROCSHMEM_INSTALL_DIR= ${ ROCSHMEM_INSTALL_DIR } "
else
cmake_common_options = " ${ cmake_common_options } -DENABLE_ROCSHMEM=OFF"
fi
2020-06-04 11:58:27 -06:00
check_exit_code " $? "
2019-08-23 22:02:42 +00:00
2024-05-31 17:58:34 -05:00
# Enable ninja build for time tracing
if [[ " ${ time_trace } " == true ]] ; then
if ! hash ninja & >/dev/null ; then
echo "ninja could not be found"
echo "Use \" ${ time_trace_ninja_msg } \" to install ninja"
exit 1
fi
2023-06-14 09:17:51 -06:00
build_system = "ninja"
enable_ninja = "-GNinja"
else
build_system = "make"
fi
2024-05-31 17:58:34 -05:00
# Add common CMake options
2024-09-18 17:25:36 -06:00
cmake_common_options = " ${ cmake_common_options } -DROCM_PATH= ${ ROCM_PATH } ${ enable_ninja } "
2024-05-31 17:58:34 -05:00
# Build RCCL-UnitTests, if enabled
if [[ " ${ build_tests } " == true ]] || ([[ " ${ run_tests } " == true ]] && [[ ! -x ./test/rccl-UnitTests ]]) ; then
cmake_common_options = " ${ cmake_common_options } -DBUILD_TESTS=ON"
2019-05-22 15:32:32 -06:00
fi
2024-05-31 17:58:34 -05:00
2025-07-31 11:00:49 -05:00
# Add build directory to RPATH for packaging dependency resolution
cmake_common_options = " ${ cmake_common_options } -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath, ${ PWD } \""
2024-05-31 17:58:34 -05:00
# Initiate RCCL CMake
2025-06-23 21:51:49 -05:00
# Passing ONLY_FUNCS separately (not as part of ${cmake_common_options}) as
# ${ONLY_FUNCS} is a debug-only feature
${ cmake_executable } ${ cmake_common_options } -DONLY_FUNCS= " ${ ONLY_FUNCS } " ../../.
2020-06-04 11:58:27 -06:00
check_exit_code " $? "
2019-05-22 15:32:32 -06:00
2024-05-31 17:58:34 -05:00
# Enable verbose output from Makefile
if [[ " ${ build_verbose } " == true ]] ; then
build_system = " ${ build_system } VERBOSE=1"
fi
# Initiate RCCL build (and install)
if [[ " ${ install_library } " == true ]] ; then
${ build_system } -j ${ num_parallel_jobs } install
2019-06-25 17:25:21 -06:00
else
2024-05-31 17:58:34 -05:00
${ build_system } -j ${ num_parallel_jobs }
2019-06-25 17:25:21 -06:00
fi
2020-06-04 11:58:27 -06:00
check_exit_code " $? "
2019-05-22 15:32:32 -06:00
2024-05-31 17:58:34 -05:00
# Initiate package build with `make package`, if enabled
if [[ " ${ build_package } " == true ]] ; then
2019-06-25 17:25:21 -06:00
make package
2020-06-04 11:58:27 -06:00
check_exit_code " $? "
2019-06-25 17:25:21 -06:00
fi
2019-05-22 15:32:32 -06:00
2024-05-31 17:58:34 -05:00
# Optionally, run RCCL-UnitTests, if they're enabled.
if [[ " ${ run_tests } " == true ]] ; then
2025-07-17 11:20:49 -05:00
if [[ ! -x "./test/rccl-UnitTests" ]] ; then
echo "RCCL-UnitTests have not been built yet; Please re-run script with \"-t\" to build the binary."
exit 1
fi
if [[ " ${ build_release } " == false && ! -x "./test/rccl-UnitTestsFixtures" ]] ; then
echo "RCCL-UnitTestsFixtures have not been built yet; Please re-run script with \"-t\" to build the binary."
exit 1
fi
if [[ " ${ run_tests_all } " == true ]] ; then
if [[ -x "./test/rccl-UnitTests" ]] ; then
2022-12-13 21:45:57 +00:00
./test/rccl-UnitTests
2025-07-17 11:20:49 -05:00
fi
if [[ " ${ build_release } " == false && -x "./test/rccl-UnitTestsFixtures" ]] ; then
./test/rccl-UnitTestsFixtures
2020-07-21 12:19:47 -06:00
fi
2019-05-22 15:32:32 -06:00
else
2025-07-17 11:20:49 -05:00
if [[ -x "./test/rccl-UnitTests" ]] ; then
./test/rccl-UnitTests --gtest_filter= "AllReduce.*"
fi
2019-05-22 15:32:32 -06:00
fi
2019-05-16 16:16:18 +00:00
fi
2023-06-14 09:17:51 -06:00
2024-05-31 17:58:34 -05:00
# Generate time trace for RCCL build using tools/time-trace
if [[ " ${ time_trace } " == true ]] ; then
search_dir = "../../tools"
time_trace_dir = $( find " ${ search_dir } " -type d -name "time-trace" -print -quit)
2023-06-21 16:16:09 -04:00
2024-05-31 17:58:34 -05:00
if [[ -n " ${ time_trace_dir } " ]] ; then
time_trace_script = " ${ time_trace_dir } /rccl-TimeTrace.sh"
if [[ -x " ${ time_trace_script } " ]] ; then
2023-06-21 16:16:09 -04:00
echo "Generating RCCL-compile-timeline.html..."
2024-05-31 17:58:34 -05:00
( cd " ${ time_trace_dir } " && ./rccl-TimeTrace.sh)
2023-06-21 16:16:09 -04:00
else
2024-05-31 17:58:34 -05:00
echo "Error: Unable to execute ${ time_trace_script } . Make sure the file has the correct permissions."
2023-06-21 16:16:09 -04:00
fi
else
2024-05-31 17:58:34 -05:00
echo "Error: time-trace folder not found in ${ search_dir } ."
2023-06-21 16:16:09 -04:00
fi
2023-06-22 14:30:44 -06:00
fi