From bf7c1306313c080fbb82bbe9753faeb4a88a5055 Mon Sep 17 00:00:00 2001 From: Jeffrey Novotny Date: Wed, 27 Nov 2024 15:34:26 -0500 Subject: [PATCH] Refactor RCCL install guide into several pages (#1427) * Refactor RCCL install guide into several pages * Changes from code review and new docker guide * Add missing entries to ToC * Minor fixes * Fix help strings * Edits after review and remove extra white space --- README.md | 41 -------- docs/how-to/rccl-usage-tips.rst | 103 +++++++++++++++++++ docs/index.rst | 16 ++- docs/install/building-installing.rst | 102 +++++++++++++++++++ docs/install/docker-install.rst | 45 ++++++++ docs/install/installation.rst | 147 ++++++--------------------- docs/sphinx/_toc.yml.in | 13 +++ install.sh | 4 +- 8 files changed, 309 insertions(+), 162 deletions(-) create mode 100644 docs/how-to/rccl-usage-tips.rst create mode 100644 docs/install/building-installing.rst create mode 100644 docs/install/docker-install.rst diff --git a/README.md b/README.md index b266ab96a..8783dd2f7 100644 --- a/README.md +++ b/README.md @@ -127,11 +127,6 @@ $ mpirun --allow-run-as-root -np 8 --mca pml ucx --mca btl ^openib -x NCCL_DEBUG For more information on rccl-tests options, refer to the [Usage](https://github.com/ROCm/rccl-tests#usage) section of rccl-tests. - -## Enabling peer-to-peer transport - -In order to enable peer-to-peer access on machines with PCIe-connected GPUs, the HSA environment variable `HSA_FORCE_FINE_GRAIN_PCIE=1` is required to be set, on top of requiring GPUs that support peer-to-peer access and proper large BAR addressing support. - ## Tests There are rccl unit tests implemented with the Googletest framework in RCCL. The rccl unit tests require Googletest 1.10 or higher to build and execute properly (installed with the -d option to install.sh). @@ -152,31 +147,6 @@ will run only AllReduce correctness tests with float16 datatype. A list of avail There are also other performance and error-checking tests for RCCL. These are maintained separately at https://github.com/ROCm/rccl-tests. See the rccl-tests README for more information on how to build and run those tests. -## NPKit - -RCCL integrates [NPKit](https://github.com/microsoft/npkit), a profiler framework that enables collecting fine-grained trace events in RCCL components, especially in giant collective GPU kernels. - -Please check [NPKit sample workflow for RCCL](https://github.com/microsoft/NPKit/tree/main/rccl_samples) as a fully automated usage example. It also provides good templates for the following manual instructions. - -To manually build RCCL with NPKit enabled, pass `-DNPKIT_FLAGS="-DENABLE_NPKIT -DENABLE_NPKIT_...(other NPKit compile-time switches)"` with cmake command. All NPKit compile-time switches are declared in the RCCL code base as macros with prefix `ENABLE_NPKIT_`, and they control which information will be collected. Also note that currently NPKit only supports collecting non-overlapped events on GPU, and `-DNPKIT_FLAGS` should follow this rule. - -To manually run RCCL with NPKit enabled, environment variable `NPKIT_DUMP_DIR` needs to be set as the NPKit event dump directory. Also note that currently NPKit only supports 1 GPU per process. - -To manually analyze NPKit dump results, please leverage [npkit_trace_generator.py](https://github.com/microsoft/NPKit/blob/main/rccl_samples/npkit_trace_generator.py). - -## MSCCL/MSCCL++ -RCCL integrates [MSCCL](https://github.com/Azure/msccl) and [MSCCL++](https://github.com/microsoft/mscclpp) to leverage the highly efficient GPU-GPU communication primitives for collective operations. Thanks to Microsoft Corporation for collaborating with us in this project. - -MSCCL uses XMLs for different collective algorithms on different architectures. RCCL collectives can leverage those algorithms once the corresponding XML has been provided by the user. The XML files contain the sequence of send-recv and reduction operations to be executed by the kernel. On MI300X, MSCCL is enabled by default. On other platforms, the users may have to enable this by setting `RCCL_MSCCL_FORCE_ENABLE=1`. By default, MSCCL will only be used if every rank belongs to a unique process; to disable this restriction for multi-threaded or single-threaded configurations, set `RCCL_MSCCL_ENABLE_SINGLE_PROCESS=1`. - -On the other hand, RCCL allreduce and allgather collectives can leverage the efficient MSCCL++ communication kernels for certain message sizes. MSCCL++ support is available whenever MSCCL support is available. Users need to set the RCCL environment variable `RCCL_MSCCLPP_ENABLE=1` to run RCCL workload with MSCCL++ support. It is also possible to set the message size threshold for using MSCCL++ by using the environment variable `RCCL_MSCCLPP_THRESHOLD`. Once `RCCL_MSCCLPP_THRESHOLD` (the default value is 1MB) is set, RCCL will invoke MSCCL++ kernels for all message sizes less than or equal to the specified threshold. - -If some restrictions are not met, it will fall back to MSCCL or RCCL. The following are restrictions on using MSCCL++: -- Message size must be a non-zero multiple of 32 bytes -- Does not support `hipMallocManaged` buffers -- Allreduce only supports `float16`, `int32`, `uint32`, `float32`, and `bfloat16` data types -- Allreduce only supports the `sum` op - ## Library and API Documentation Please refer to the [RCCL Documentation Site](https://rocm.docs.amd.com/projects/rccl/en/latest/) for current documentation. @@ -191,17 +161,6 @@ pip3 install -r sphinx/requirements.txt python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html ``` -### Improving performance on MI300 when using less than 8 GPUs - -On a system with 8\*MI300X GPUs, each pair of GPUs are connected with dedicated XGMI links in a fully-connected topology. So, for collective operations, one can achieve good performance when all 8 GPUs (and all XGMI links) are used. When using less than 8 GPUs, one can only achieve a fraction of the potential bandwidth on the system. - -But, if your workload warrants using less than 8 MI300 GPUs on a system, you can set the run-time variable `NCCL_MIN_NCHANNELS` to increase the number of channels.\ -E.g.: `export NCCL_MIN_NCHANNELS=32` - -Increasing the number of channels can be beneficial to performance, but it also increases GPU utilization for collective operations. - -Additionally, we have pre-defined higher number of channels when using only 2 GPUs or 4 GPUs on a 8\*MI300 system. Here, RCCL will use **32 channels** for the 2 MI300 GPUs scenario and **24 channels** for the 4 MI300 GPUs scenario. - ## Copyright All source code and accompanying documentation is copyright (c) 2015-2022, NVIDIA CORPORATION. All rights reserved. diff --git a/docs/how-to/rccl-usage-tips.rst b/docs/how-to/rccl-usage-tips.rst new file mode 100644 index 000000000..59abd32c6 --- /dev/null +++ b/docs/how-to/rccl-usage-tips.rst @@ -0,0 +1,103 @@ +.. meta:: + :description: Usage tips for the RCCL library of collective communication primitives + :keywords: RCCL, ROCm, library, API, peer-to-peer, transport + +.. _rccl-usage-tips: + + +***************************************** +RCCL usage tips +***************************************** + +This topic describes some of the more common RCCL extensions, such as NPKit and MSCCL, and provides tips on how to +configure and customize the application. + +NPKit +===== + +RCCL integrates `NPKit `_, a profiler framework that +enables the collection of fine-grained trace events in RCCL components, especially in giant collective GPU kernels. +See the `NPKit sample workflow for RCCL `_ for +a fully-automated usage example. It also provides useful templates for the following manual instructions. + +To manually build RCCL with NPKit enabled, pass ``-DNPKIT_FLAGS="-DENABLE_NPKIT -DENABLE_NPKIT_...(other NPKit compile-time switches)"`` to the ``cmake`` command. +All NPKit compile-time switches are declared in the RCCL code base as macros with the prefix ``ENABLE_NPKIT_``. +These switches control the information that is collected. + +.. note:: + + NPKit only supports the collection of non-overlapped events on the GPU. + The ``-DNPKIT_FLAGS`` settings must follow this rule. + +To manually run RCCL with NPKit enabled, set the environment variable ``NPKIT_DUMP_DIR`` +to the NPKit event dump directory. NPKit only supports one GPU per process. +To manually analyze the NPKit dump results, use `npkit_trace_generator.py `_. + +MSCCL/MSCCL++ +============= + +RCCL integrates `MSCCL `_ and `MSCCL++ `_ to +leverage these highly efficient GPU-GPU communication primitives for collective operations. +Microsoft Corporation collaborated with AMD for this project. + +MSCCL uses XMLs for different collective algorithms on different architectures. +RCCL collectives can leverage these algorithms after the user provides the corresponding XML. +The XML files contain sequences of send-recv and reduction operations for the kernel to run. + +MSCCL is enabled by default on the AMD Instinctâ„¢ MI300X accelerator. On other platforms, users might have to enable it +using the setting ``RCCL_MSCCL_FORCE_ENABLE=1``. By default, MSCCL is only used if every rank belongs +to a unique process. To disable this restriction for multi-threaded or single-threaded configurations, +use the setting ``RCCL_MSCCL_ENABLE_SINGLE_PROCESS=1``. + +RCCL allreduce and allgather collectives can leverage the efficient MSCCL++ communication kernels +for certain message sizes. MSCCL++ support is available whenever MSCCL support is available. +To run a RCCL workload with MSCCL++ support, set the following RCCL environment variable: + +.. code-block:: shell + + RCCL_MSCCLPP_ENABLE=1 + +To set the message size threshold for using MSCCL++, use the environment variable ``RCCL_MSCCLPP_THRESHOLD``, +which has a default value of 1MB. After ``RCCL_MSCCLPP_THRESHOLD`` has been set, +RCCL invokes MSCCL++ kernels for all message sizes less than or equal to the specified threshold. + +The following restrictions apply when using MSCCL++. If these restrictions are not met, +operations fall back to using MSCCL or RCCL. + +* The message size must be a non-zero multiple of 32 bytes +* It does not support ``hipMallocManaged`` buffers +* Allreduce only supports the ``float16``, ``int32``, ``uint32``, ``float32``, and ``bfloat16`` data types +* Allreduce only supports the sum operation + +Enabling peer-to-peer transport +=============================== + +To enable peer-to-peer access on machines with PCIe-connected GPUs, +set the HSA environment variable as follows: + +.. code-block:: shell + + HSA_FORCE_FINE_GRAIN_PCIE=1 + +This feature requires GPUs that support peer-to-peer access along with +proper large BAR addressing support. + +Improving performance on the MI300X accelerator when using fewer than 8 GPUs +============================================================================ + +On a system with 8\*MI300X accelerators, each pair of accelerators is connected with dedicated XGMI links +in a fully-connected topology. For collective operations, this can achieve good performance when +all 8 accelerators (and all XGMI links) are used. When fewer than 8 GPUs are used, however, this can only achieve a fraction +of the potential bandwidth on the system. +However, if your workload warrants using fewer than 8 MI300X accelerators on a system, +you can set the run-time variable ``NCCL_MIN_NCHANNELS`` to increase the number of channels. For example: + +.. code-block:: shell + + export NCCL_MIN_NCHANNELS=32 + +Increasing the number of channels can benefit performance, but it also increases +GPU utilization for collective operations. +Additionally, RCCL pre-defines a higher number of channels when only 2 or +4 accelerators are in use on a 8\*MI300X system. In this situation, RCCL uses 32 channels with two MI300X accelerators +and 24 channels for four MI300X accelerators. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 34125e180..f679db303 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,14 +20,20 @@ The RCCL public repository is located at ``_. .. grid-item-card:: Install - * :ref:`RCCL installation guide ` - -.. grid:: 2 - :gutter: 3 + * :doc:`Installing RCCL using the install script <./install/installation>` + * :doc:`Running RCCL using Docker <./install/docker-install>` + * :doc:`Building and installing RCCL from source code <./install/building-installing>` .. grid-item-card:: How to - * :ref:`using-nccl` + * :doc:`Using the NCCL Net plugin <./how-to/using-nccl>` + * :doc:`RCCL usage tips <./how-to/rccl-usage-tips>` + + + .. grid-item-card:: Examples + + * `RCCL Tuner plugin examples `_ + * `NCCL Net plugin examples `_ .. grid-item-card:: API reference diff --git a/docs/install/building-installing.rst b/docs/install/building-installing.rst new file mode 100644 index 000000000..4ab6fea50 --- /dev/null +++ b/docs/install/building-installing.rst @@ -0,0 +1,102 @@ +.. meta:: + :description: Information on how to build the RCCL library from source code + :keywords: RCCL, ROCm, library, API, build, install + +.. _building-from-source: + +********************************************* +Building and installing RCCL from source code +********************************************* + +To build RCCL directly from the source code, follow these steps. This guide also includes +instructions explaining how to test the build. +For information on using the quick start install script to build RCCL, see :doc:`installation`. + +Requirements +============ + +The following prerequisites are required to build RCCL: + +1. ROCm-supported GPUs +2. Having the ROCm stack installed on the system, including the :doc:`HIP runtime ` and the HIP-Clang compiler. + +Building the library using CMake: +--------------------------------- + +To build the library from source, follow these steps: + +.. code-block:: shell + + git clone --recursive https://github.com/ROCm/rccl.git + cd rccl + mkdir build + cd build + cmake .. + make -j 16 # Or some other suitable number of parallel jobs + +If you have already cloned the repository, you can checkout the external submodules manually. + +.. code-block:: shell + + git submodule update --init --recursive --depth=1 + +You can substitute a different installation path by providing the path as a parameter +to ``CMAKE_INSTALL_PREFIX``, for example: + +.. code-block:: shell + + cmake -DCMAKE_INSTALL_PREFIX=$PWD/rccl-install .. + +.. note:: + + Ensure ROCm CMake is installed using the command ``apt install rocm-cmake``. + + +Building the RCCL package and install package: +---------------------------------------------- + +After you have cloned the repository and built the library as described in the previous section, +use this command to build the package: + +.. code-block:: shell + + cd rccl/build + make package + sudo dpkg -i *.deb + +.. note:: + + The RCCL package install process requires ``sudo`` or root access because it creates a directory + named ``rccl`` in ``/opt/rocm/``. This is an optional step. RCCL can be used directly by including the path containing ``librccl.so``. + +Testing RCCL +============ + +The RCCL unit tests are implemented using the Googletest framework in RCCL. These unit tests require Googletest 1.10 +or higher to build and run (this dependency can be installed using the ``-d`` option for ``install.sh``). +To run the RCCL unit tests, go to the ``build`` folder and the ``test`` subfolder, +then run the appropriate RCCL unit test executables. + +The RCCL unit test names follow this format: + +.. code-block:: shell + + CollectiveCall.[Type of test] + +Filtering of the RCCL unit tests can be done using environment variables +and by passing the ``--gtest_filter`` command line flag: + +.. code-block:: shell + + UT_DATATYPES=ncclBfloat16 UT_REDOPS=prod ./rccl-UnitTests --gtest_filter="AllReduce.C*" + +This command runs only the ``AllReduce`` correctness tests with the ``float16`` datatype. +A list of the available environment variables for filtering appears at the top of every run. +See the `Googletest documentation `_ +for more information on how to form advanced filters. + +There are also other performance and error-checking tests for RCCL. They are maintained separately at ``_. + +.. note:: + + For more information on how to build and run rccl-tests, see the `rccl-tests README file `_ . diff --git a/docs/install/docker-install.rst b/docs/install/docker-install.rst new file mode 100644 index 000000000..3b0c780bb --- /dev/null +++ b/docs/install/docker-install.rst @@ -0,0 +1,45 @@ +.. meta:: + :description: Instruction on how to install the RCCL library for collective communication primitives using Docker + :keywords: RCCL, ROCm, library, API, install, Docker + +.. _install-docker: + +***************************************** +Running RCCL using Docker +***************************************** + +To use Docker to run RCCL, Docker must already be installed on the system. +To build the Docker image and run the container, follow these steps. + +#. Build the Docker image + + By default, the Dockerfile uses ``docker.io/rocm/dev-ubuntu-22.04:latest`` as the base Docker image. + It then installs RCCL and rccl-tests (in both cases, it uses the version from the RCCL ``develop`` branch). + + Use this command to build the Docker image: + + .. code-block:: shell + + docker build -t rccl-tests -f Dockerfile.ubuntu --pull . + + The base Docker image, rccl repository, and rccl-tests repository can be modified + by using ``--build-args`` in the ``docker build`` command above. For example, to use a different base Docker image, + use this command: + + .. code-block:: shell + + docker build -t rccl-tests -f Dockerfile.ubuntu --build-arg="ROCM_IMAGE_NAME=rocm/dev-ubuntu-20.04" --build-arg="ROCM_IMAGE_TAG=6.2" --pull . + +#. Launch an interactive Docker container on a system with AMD GPUs: + + .. code-block:: shell + + docker run -it --rm --device=/dev/kfd --device=/dev/dri --group-add video --ipc=host --network=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined rccl-tests /bin/bash + +To run, for example, the ``all_reduce_perf`` test from rccl-tests on 8 AMD GPUs from inside the Docker container, use this command: + +.. code-block:: shell + + mpirun --allow-run-as-root -np 8 --mca pml ucx --mca btl ^openib -x NCCL_DEBUG=VERSION /workspace/rccl-tests/build/all_reduce_perf -b 1 -e 16G -f 2 -g 1 + +For more information on the rccl-tests options, see the `Usage guidelines `_ in the GitHub repository. \ No newline at end of file diff --git a/docs/install/installation.rst b/docs/install/installation.rst index 8ce01b379..ce613c344 100644 --- a/docs/install/installation.rst +++ b/docs/install/installation.rst @@ -1,45 +1,58 @@ .. meta:: - :description: RCCL is a stand-alone library that provides multi-GPU and multi-node collective communication primitives optimized for AMD GPUs - :keywords: RCCL, ROCm, library, API + :description: Instruction on how to install the RCCL library for collective communication primitives using the quick start install script + :keywords: RCCL, ROCm, library, API, install .. _install: -*************** -Installing RCCL -*************** +***************************************** +Installing RCCL using the install script +***************************************** + +To quickly install RCCL using the install script, follow these steps. +For instructions on building RCCL from the source code, see :doc:`building-installing`. +For additional tips, see :doc:`../how-to/rccl-usage-tips`. Requirements ============ -1. ROCm supported GPUs -2. ROCm stack installed on the system (HIP runtime & HIP-Clang) +The following prerequisites are required to use RCCL: + +1. ROCm-supported GPUs +2. The ROCm stack must be installed on the system, including the :doc:`HIP runtime ` and the HIP-Clang compiler. + +Quick start RCCL build +====================== -Quickstart RCCL Build -===================== +RCCL directly depends on the HIP runtime plus the HIP-Clang compiler, which are part of the ROCm software stack. +For ROCm installation instructions, see :doc:`rocm-install-on-linux:install/native-install/index`. -RCCL directly depends on HIP runtime plus the HIP-Clang compiler, which are part of the ROCm software stack. -For ROCm installation instructions, see https://github.com/ROCm/ROCm. -The root of this repository has a helper script ``install.sh`` to build and install RCCL with a single command. It hard-codes configurations that can be specified through invoking cmake directly, but it's a great way to get started quickly and can serve as an example of how to build/install RCCL. +Use the `install.sh helper script `_, +located in the root directory of the RCCL repository, +to build and install RCCL with a single command. It uses hard-coded configurations that can be specified directly +when using cmake. However, it's a great way to get started quickly and provides an +example of how to build and install RCCL. -To build the library using the install script: +Building the library using the install script: ---------------------------------------------- +To build the library using the install script, use this command: + .. code-block:: shell ./install.sh -For more info on build options/flags when using the install script, use the following: +For more information on the build options and flags for the install script, run the following command: .. code-block:: shell ./install.sh --help -RCCL build & installation helper script options: +The RCCL build and installation helper script options are as follows: .. code-block:: shell --address-sanitizer Build with address sanitizer enabled - -d|--dependencies Install RCCL depdencencies + -d|--dependencies Install RCCL dependencies --debug Build debug library --enable_backtrace Build with custom backtrace support --disable-colltrace Build without collective trace @@ -50,7 +63,7 @@ RCCL build & installation helper script options: -i|--install Install RCCL library (see --prefix argument below) -j|--jobs Specify how many parallel compilation jobs to run ($nproc by default) -l|--local_gpu_only Only compile for local GPU architecture - --amdgpu_targets Only compile for specified GPU architecture(s). For multiple targets, seperate by ';' (builds for all supported GPU architectures by default) + --amdgpu_targets Only compile for specified GPU architecture(s). For multiple targets, separate by ';' (builds for all supported GPU architectures by default) --no_clean Don't delete files if they already exist --npkit-enable Compile with npkit enabled --openmp-test-enable Enable OpenMP in rccl unit tests @@ -66,101 +79,7 @@ RCCL build & installation helper script options: --verbose Show compile commands .. tip:: - By default, RCCL builds for all GPU targets defined in ``DEFAULT_GPUS`` in `CMakeLists.txt `_. To target specific GPU(s), and potentially reduce build time, use ``--amdgpu_targets`` as a ``;`` separated string listing GPU(s) to target. - -Manual build -============ - -To build the library using CMake: ---------------------------------- - -.. code-block:: shell - - $ git clone https://github.com/ROCm/rccl.git - $ cd rccl - $ mkdir build - $ cd build - $ cmake .. - $ make -j 16 # Or some other suitable number of parallel jobs - -You may substitute an installation path of your own choosing by passing ``CMAKE_INSTALL_PREFIX``. For example: - -.. code-block:: shell - - $ cmake -DCMAKE_INSTALL_PREFIX=$PWD/rccl-install .. - -.. note:: - Ensure rocm-cmake is installed, ``apt install rocm-cmake``. - - -To build the RCCL package and install package: ----------------------------------------------- - -Assuming you have already cloned this repository and built the library as shown in the previous section: - -.. code-block:: shell - - $ cd rccl/build - $ make package - $ sudo dpkg -i *.deb - -RCCL package install requires sudo/root access because it creates a directory called "rccl" under ``/opt/rocm/``. This is an optional step and RCCL can be used directly by including the path containing ``librccl.so``. - -Enabling peer-to-peer transport -=============================== - -In order to enable peer-to-peer access on machines with PCIe-connected GPUs, the HSA environment variable ``HSA_FORCE_FINE_GRAIN_PCIE=1`` is required to be set, on top of requiring GPUs that support peer-to-peer access and proper large BAR addressing support. - -Testing RCCL -============ - -There are rccl unit tests implemented with the Googletest framework in RCCL. The rccl unit tests require Googletest 1.10 or higher to build and execute properly (installed with the ``-d`` option to ``install.sh``). -To invoke the rccl unit tests, go to the build folder, then the test subfolder, and execute the appropriate rccl unit test executable(s). - -rccl unit test names are now of the format: - -.. code-block:: shell - - CollectiveCall.[Type of test] - -Filtering of rccl unit tests should be done with environment variable and by passing the ``--gtest_filter`` command line flag: - -.. code-block:: shell - - UT_DATATYPES=ncclBfloat16 UT_REDOPS=prod ./rccl-UnitTests --gtest_filter="AllReduce.C*" - -This will run only ``AllReduce`` correctness tests with float16 datatype. A list of available filtering environment variables appears at the top of every run. See https://google.github.io/googletest/advanced.html#running-a-subset-of-the-tests for more information on how to form more advanced filters. - -There are also other performance and error-checking tests for RCCL. These are maintained separately at https://github.com/ROCm/rccl-tests. - -.. note:: - See the `rccl-tests/README `_ for more information on how to build and run those tests. - -NPKit -===== - -RCCL integrates `NPKit `_, a profiler framework that enables collecting fine-grained trace events in RCCL components, especially in giant collective GPU kernels. -Please check `NPKit sample workflow for RCCL `_ as a fully automated usage example. It also provides good templates for the following manual instructions. -To manually build RCCL with NPKit enabled, pass ``-DNPKIT_FLAGS="-DENABLE_NPKIT -DENABLE_NPKIT_...(other NPKit compile-time switches)"`` with ``cmake`` command. All NPKit compile-time switches are declared in the RCCL code base as macros with prefix ``ENABLE_NPKIT_``, and they control which information will be collected. Also note that currently NPKit only supports collecting non-overlapped events on GPU, and ``-DNPKIT_FLAGS`` should follow this rule. - -To manually run RCCL with NPKit enabled, environment variable ``NPKIT_DUMP_DIR`` needs to be set as the NPKit event dump directory. Also note that currently NPKit only supports 1 GPU per process. -To manually analyze NPKit dump results, please leverage `npkit_trace_generator.py `_. - -MSCCL/MSCCL++ -============= - -RCCL integrates `MSCCL `_ and `MSCCL++ `_ to leverage the highly efficient GPU-GPU communication primitives for collective operations. Thanks to Microsoft Corporation for collaborating with us in this project. - -MSCCL uses XMLs for different collective algorithms on different architectures. RCCL collectives can leverage those algorithms once the corresponding XML has been provided by the user. The XML files contain the sequence of send-recv and reduction operations to be executed by the kernel. On MI300X, MSCCL is enabled by default. On other platforms, the users may have to enable this by setting ``RCCL_MSCCL_FORCE_ENABLE=1``. -On the other hand, RCCL allreduce and allgather collectives can leverage the efficient MSCCL++ communication kernels for certain message sizes. MSCCL++ support is available whenever MSCCL support is available. Users need to set the RCCL environment variable ``RCCL_ENABLE_MSCCLPP=1`` to run RCCL workload with MSCCL++ support. It is also possible to set the message size threshold for using MSCCL++ by using the environment variable ``RCCL_MSCCLPP_THRESHOLD``. Once ``RCCL_MSCCLPP_THRESHOLD`` (the default value is 1MB) is set, RCCL will invoke MSCCL++ kernels for all message sizes less than or equal to the specified threshold. - -Improving performance on MI300 when using less than 8 GPUs -========================================================== - -On a system with 8\*MI300X GPUs, each pair of GPUs are connected with dedicated XGMI links in a fully-connected topology. So, for collective operations, one can achieve good performance when all 8 GPUs (and all XGMI links) are used. When using less than 8 GPUs, one can only achieve a fraction of the potential bandwidth on the system. -But, if your workload warrants using less than 8 MI300 GPUs on a system, you can set the run-time variable `NCCL_MIN_NCHANNELS` to increase the number of channels. - -For example: ``export NCCL_MIN_NCHANNELS=32`` -Increasing the number of channels can be beneficial to performance, but it also increases GPU utilization for collective operations. -Additionally, we have pre-defined higher number of channels when using only 2 GPUs or 4 GPUs on a 8\*MI300 system. Here, RCCL will use **32 channels** for the 2 MI300 GPUs scenario and **24 channels** for the 4 MI300 GPUs scenario. + By default, the RCCL install script builds all the GPU targets that are defined in ``DEFAULT_GPUS`` in `CMakeLists.txt `_. + To target specific GPUs and potentially reduce the build time, use ``--amdgpu_targets`` along with + a semicolon (``;``) separated string list of the GPU targets. diff --git a/docs/sphinx/_toc.yml.in b/docs/sphinx/_toc.yml.in index 7d991867e..e95be1fb3 100644 --- a/docs/sphinx/_toc.yml.in +++ b/docs/sphinx/_toc.yml.in @@ -9,10 +9,23 @@ subtrees: entries: - file: install/installation title: Installation guide + - file: install/docker-install + title: Running RCCL using Docker + - file: install/building-installing + title: Building and installing from source - caption: How to entries: - file: how-to/using-nccl + title: Using the NCCL Net plugin + - file: how-to/rccl-usage-tips + +- caption: Examples + entries: + - url: https://github.com/ROCm/rccl/tree/develop/ext-tuner/example + title: RCCL Tuner plugin examples + - url: https://github.com/ROCm/rccl/tree/develop/ext-net/example + title: NCCL Net plugin examples - caption: API reference entries: diff --git a/install.sh b/install.sh index 892f2bbee..ab57e0e2e 100755 --- a/install.sh +++ b/install.sh @@ -41,7 +41,7 @@ function display_help() echo "RCCL build & installation helper script" echo " Options:" echo " --address-sanitizer Build with address sanitizer enabled" - echo " -d|--dependencies Install RCCL depdencencies" + echo " -d|--dependencies Install RCCL dependencies" echo " --debug Build debug library" echo " --enable_backtrace Build with custom backtrace support" echo " --disable-colltrace Build without collective trace" @@ -52,7 +52,7 @@ function display_help() echo " -i|--install Install RCCL library (see --prefix argument below)" echo " -j|--jobs Specify how many parallel compilation jobs to run ($num_parallel_jobs by default)" echo " -l|--local_gpu_only Only compile for local GPU architecture" - echo " --amdgpu_targets Only compile for specified GPU architecture(s). For multiple targets, seperate by ';' (builds for all supported GPU architectures by default)" + echo " --amdgpu_targets Only compile for specified GPU architecture(s). For multiple targets, separate by ';' (builds for all supported GPU architectures by default)" echo " --no_clean Don't delete files if they already exist" echo " --npkit-enable Compile with npkit enabled" echo " --openmp-test-enable Enable OpenMP in rccl unit tests"