Get Started with Intel® oneAPI Collective Communications Library
Intel® oneAPI Collective Communications Library (oneCCL) is a scalable and high-performance communication library for Deep Learning (DL) and Machine Learning (ML) workloads. It develops the ideas originated in Intel(R) Machine Learning Scaling Library and expands the design and API to encompass new features and use cases.
System Requirements
Refer to the oneCCL System Requirements page.
Install
See Intel® oneAPI Toolkits Installation Guide for Linux* OS to learn about oneCCL installation.
Before You Begin
After installing oneCCL, set the environment variables:
To load oneCCL package, run:
To load all installed oneAPI components, run:
You can also modify the oneCCL setup by using two flags when sourcing the vars.sh script:
ccl-configuration=[cpu_gpu_dpcpp/cpu] - allows to choose between a SYCL-based version represented by cpu_gpu_dpcpp (default) and a CPU version, which does not require SYCL runtime libraries.
ccl-bundled-mpi=[yes|no] - controls if Intel(R) MPI is used or not. Default value is yes.
To use Intel(R) MPI, run:
oneCCL uses bundled IMPI implementation, possibly overriding a user-supplied setup.
To use MPI implementation different from Intel(R) MPI, such as MPICH, run:
For more information about setvars.sh, see Use the setvars and oneapi-vars Scripts with Linux*.
Sample Application
The sample code below shows how to use oneCCL API to perform allreduce communication for SYCL USM memory.
Prerequisites
oneCCL with SYCL support is installed and oneCCL environment is set up (see installation instructions)
Intel® MPI Library is installed and MPI environment is set up
Run the Sample
Use the C++ driver with the -fsycl option to build the sample:
Run the sample:
Where <parameters> represents optional mpiexec parameters, such as node count, processes per node, hosts, and so on.
Compile and Build Applications with pkg-config
The pkg-config tool is widely used to simplify building software with library dependencies. It provides command line options for compiling and linking applications to a library. Intel® oneAPI Collective Communications Library provides pkg-config metadata files for this tool starting with the oneCCL 2021.4 release.
The oneCCL pkg-config metadata files cover both configurations of oneCCL: with and without SYCL support.
Compile
To compile a test sample.cpp program with oneCCL, run:
--cflags provides the include path to the API directory:
The output:
--libs provides the oneCCL library name, all other dependencies (such as SYCL and MPI), and the search path to find it:
The output:
Notices and Disclaimers
Intel technologies may require enabled hardware, software or service activation.
No product or component can be absolutely secure.
Your costs and results may vary.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.
The products described may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.
Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.