Introduction And Machine Learning Packages Installation
1.1 Introduction
A number of machine learning and deep learning library and framework packages can be used with BCM. The packages provided make it faster and easier for organizations to install the latest state-of-the-art libraries, and gain insights from rich, complex data.
1.1.1 Associated Repository, And Support For Machine Learning Packages
The packages are distributed via a separate BCM cm-ml repository. The repository is automatically available and enabled.
The support team supports the integration of packages distributed in the dedicated cm-ml repository with BCM only if the cluster is licensed for the Data Science Add-on package.
An administrator who is upgrading a cluster that has machine learning and deep learning packages installed on it should always make sure that the dedicated BCM cm-ml repository is accessible, if required by the new NVIDIA Base Command Manager version.
1.1.2 NVIDIA Base Command Manager Versions—Supported Distributions And Architecture For Machine Learning Packages
At the time of writing of this section, October 2024, a number of different Linux distribution versions and architectures are supported, depending on the NVIDIA Base Command Manager version. For convenience, a support matrix for this is shown in table 1.1:
Table 1.1: Supported Linux distributions and architectures for BCM Machine Learning packages
An updated list of the supported Linux distributions and architectures available for the various NVIDIA Base Command Manager versions can be found at https://support.brightcomputing.com/feature-matrix/, in the section of the Feature column dedicated to machine learning.
1.2 Available Packages
An updated list of the machine learning packages available for the various NVIDIA Base Command Manager versions can be found at https://service.bcm.nvidia.com/packages-dashboard/. Most of the machine learning packages are to be found within the ml group. However, some of them are found within the cm group for legacy reasons.
At the time of writing, December 2021, the following packages were available:
Table 1.2: Machine Learning packages provided by the NVIDIA Base Command Manager repositories
Legend:
Packages are available for every distribution unless otherwise tagged.
1.2.1 Considerations
There are some considerations that the cluster administrator should be aware of with the packages.
-
Some packages may be labelled in the table 1.2 as deprecated. “Deprecated” in the software industry is not a well-defined term. Here it is used by BCM to mean a package that may no longer be offered in a future release, or for which a newer existing version is preferred.
-
Several different packages may be provided for the same machine learning library or framework. For example, TensorFlow may be provided by:
-
cm-tensorflow2-py39-cuda11.2-gcc9 -
cm-tensorflow2-py39-cuda11.7-gcc9
As is the norm with other package management systems in the software industry, the name given to a BCM package includes the most relevant dependencies required to build and use it. The dependencies commonly highlighted in this manner are:
-
Python interpreter version used (e.g.
*-py36*,*-py37*and*-py39*) -
accelerator library used (e.g.
*-cuda10.1*,*-cuda10.2*,*-cuda11.2*,*-cuda11.7*, and*-mkl*) -
compiler used (e.g.
*-gcc*,*-gcc8*and*-gcc9*)
The availability of different variants of the same package makes it easier for administrators to set up a working environment that is suited to their needs.
-
-
Machine learning packages are designed to coexist, and can therefore all be installed at the same time. This also applies to different variants of the same library or framework.
This means that administrators can install different versions of the same machine learning library or framework, simply by using different variants. For example: an older
*-py36*version of TensorFlow, as well as a more recent*-py37*version of TensorFlow, can both be installed at the same time. -
As is done with other packages provided by the BCM developers, the updates released for machine learning libraries and frameworks generally leave their major versions unchanged.
Whenever a major version for a third party machine learning library or a framework is publicly released, a new package or a set of packages is typically placed in the repository.
Such package(s) imply or contain a reference to the major version in the name. For example:
-
cm-tensorflow-*is the name used for TensorFlow major version 1 -
cm-tensorflow2-*is the name for TensorFlow major version 2
As a result, administrators can safely upgrade cluster packages without breaking backward compatibility with users’ applications.
-
-
MPI modules and libraries should not be blindly added by the cluster administrator. During module loading, warnings are typically given to suggest an MPI library (Open MPI, or an MPICH or MVAPICH implementation of Open MPI) is required. However, the exact implementation of the MPI library that can be used depends upon the hardware (GPU, interface, architecture) used and requires judgment of suitability by the cluster administrator. BCM uses the
cm-openmpi4-cuda11.2-ofed51-gcc9package in this manual as the reference MPI library implementation. This driver package corresponds with using Open MPI with Gigabit Ethernet networking, InfiniBand networking, and NVIDIA GPUs.
1.3 Requirements
The following requirements must be met before installing the preceding machine learning packages.
-
RHEL users must have access to the YUM repositories and EPEL repository.
-
There must be enough free space for the packages that are installed on the head node and compute nodes. The actual amount depends on the packages installed.
-
8 GB of RAM on the nodes is the minimum recommended amount.
-
In order to use packages built with the CUDA toolkit accelerator library version 10.2 and below (e.g.
*-cuda10.2*), the NVIDIA GPUs must be Maxwell or more recent, with compute capability 3.5 or later. CUDA compute capability 6.0 or later is recommended. -
In order to use packages built with the CUDA toolkit accelerator library version 11.0 and above (e.g.
*-cuda11.2*), the NVIDIA GPUs must be Maxwell or more recent, with compute capability 5.2 or later. CUDA compute capability 6.0 or later is recommended. -
In order to use packages built using CUDA as the accelerator (i.e.
*-cuda*), the CPU must support the AVX/AVX2, FMA, and SSE4.2 instructions. This can be checked by inspecting the CPU flags:Example
-
In order to use packages built using MKL as the accelerator (i.e.
*-mkl), the CPU must support the AVX-512 Vector Neural Network Instructions (VNNI). Examples of such CPUs are Intel Xeon Scalable processors with Deep Learning Boost.
1.4 Machine Learning Packages Installation
1.4.0.1 Head Node Installation
BCM machine learning packages are installed in the /cm/shared directory, which is by default exported over NFS. Packages installed on the head node are therefore also available to all the compute nodes by default.
The .rpm and .deb files have proper dependencies defined. This means that the cluster administrator does not need to spend time figuring out what needs to be installed to set up a working environment. Whenever a package is installed or updated, the required dependencies will be also automatically fetched, if necessary. As a result, packages can be installed with the usual package manager that is provided by the Linux distribution in the usual way (here).
For example, the administrator can install cm-pytorch-py39-cuda11.8-gcc11 as follows:
Example
The package managers also automatically install the corresponding package dependencies, such as
-
cm-cudnn8.6-cuda11.8 -
cm-ml-pythondeps-py39-cuda11.8-gcc11 -
cm-nccl2-cuda11.8-gcc11 -
cm-protobuf3-gcc11 -
cuda11.8-toolkit
Machine learning packages share several dependencies, usually providing useful Python or system libraries. For convenience, these dependencies are grouped in the cm-ml-pythondeps-* and cm-ml-distdeps-* meta-packages.
-
cm-ml-pythondeps-*: This meta-package provides the application libraries such asnumba,numpy,scikit-learn, andscipy.- If RHEL8 is being run, and
cm-ml-pythondeps-py39-cuda11.8-gcc11is being installed, then thecodeready-builder-for-rhel-8-x86_64-rpmsrepository needs to be enabled. For example using:
subscription-manager repos --enable=codeready-builder-for-rhel-8-x86_64-rpms
- If RHEL8 is being run, and
-
cm-ml-distdeps-*: This meta-package, on the other hand, provides development libraries such asblas-devel,libjpeg-develandlibpng-devel, and the utility librarygnuplot.
The appropriate meta-packages are automatically installed whenever a package installation requires it.
Administrators only need to make sure that their clusters meet the preceding hardware requirements listed at the start of section 1.3. If that is not done, then unexpected failures may occur during run time, such as segmentation faults.
Examples of common mistakes are
-
using packages requiring CUDA (e.g.
cm-pytorch-py39-cuda11.8-gcc11) on clusters without GPUs -
using packages requiring VNNI (e.g.
cm-tensorflow2-py39-cuda11.8-gcc11) on CPUs not supporting the instruction set
1.4.0.2 Compute Nodes Installation
The cm-ml-distdeps-* meta-packages must be also installed onto all compute nodes that are to run machine learning applications.
For example, if the name of the software image is gpu-image, then the administrator can install cm-ml-distdeps-cuda11.8 on RHEL 9 as follows:
Example
The preceding command must be applied to all software images that are used to run machine learning applications.
There are equivalents to the --installroot option of yum for the other distribution package managers.
For SLES the installation command equivalent is:
For Ubuntu the installation command equivalent is:
Details on using zypper and apt commands for installation to software images are given here.
The preceding command must be applied to all software images that are used to run machine learning applications.
No automatic install of cuda-driver and cuda-dcgm since cm-ml-distdeps-cuda-* v3.0.0:
The cuda-driver and cuda-dcgm packages used to be automatically installed during installation of earlier versions of the cm-ml-distdeps-cuda-* meta-package. This behavior has changed.
Version 3.0.0 onward of the package requires a manual install of the cuda-driver and cuda-dcgm packages. Installation of the cuda-driver and cuda-dcgm packages is covered in section 9.1 of the Installation Manual.
The version number of the available or installed cm-ml-distdeps-cuda* package can be found with the package manager. For example using yum info:
Example
A distribution-agnostic way to find the version is with the packages command (section 11.1.1 of the Administrator Manual):
Example
The manual installation of the cuda-driver and cuda-dcgm packages allows a wider range of NVIDIA drivers and cluster configurations to be installed. Version 3.0.0 onward now allows the administrator to install custom NVIDIA drivers, for example for special hardware such as DGX machines. It also allows the administrator to install different versions of NVIDIA drivers for different groups of compute nodes.
Just as for the cm-ml-distdeps-* meta-packages, the custom NVIDIA drivers must be installed onto all the compute nodes that are to run machine learning applications.
1.4.1 Module Loading
BCM provides environment module definitions for all the machine learning packages. The environment module files are also compatible with the Lmod software introduced in NVIDIA Base Command Manager 7.3. They can be listed once the shared module is loaded, if it has not already been loaded:
For example, after having installed the cm-tensorflow2-py39-cuda11.8-gcc11 package, the associated TensorFlow module can be loaded with:
The machine learning environment modules automatically load additional environment modules as dependencies, with the notable exception of Open MPI implementations for the reasons given in section 1.2.1.
The module dependencies are achieved via the module definition files:
Example
1.5 Machine Learning Packages Removal
Machine learning packages can be removed in the usual way with the package manager commands used by the Linux distribution. For example, the administrator can remove the cm-pytorch-py37-cuda10.2-gcc8 package with:
Example
or
or
BCM machine learning packages are installed in the /cm/shared directory, which is by default exported over NFS. Packages removed from the head node are therefore also removed from all the compute nodes by default.
The cm-ml-distdeps-* meta-packages must be also removed from all compute nodes that are to run machine learning applications. For example, if the name of the software image is gpu-image, then the images directory is /cm/images/gpu-image, and then the administrator can remove cm-ml-distdeps-cuda11.8 from the image as follows in RHEL 9:
Example
The preceding command must be applied to all software images that are used to run the machine learning applications.
The equivalents to the --installroot option of yum for the other distribution package managers are described in section 1.4.0.2.