Training machine learning models is spend up greatly by the parallel processing of GPUs. To take advantage of the parallel processing of GPUs in machine learning tool kits such as Pytorch we need to use versions compiled with CUDA. Anaconda Python installs prerequisite CUDA drivers with Pytorch versions simplifying installation.
We can search for packages versions in Anaconda Python channels as below:
/opt/anaconda3/bin/conda search -c pytorch pytorch pytorch 1.8.1 py3.8_cuda10.2_cudnn7.6.5_0 pytorch pytorch 1.8.1 py3.8_cuda11.1_cudnn8.0.5_0 pytorch pytorch 1.8.1 py3.9_cpu_0 pytorch pytorch 1.8.1 py3.9_cuda10.1_cudnn7.6.3_0 pytorch pytorch 1.8.1 py3.9_cuda10.2_cudnn7.6.5_0 pytorch pytorch 1.8.1 py3.9_cuda11.1_cudnn8.0.5_0 pytorch
The LearnIoTAI machine learning model training environment installs machine learning packages through Anaconda Python to get the matching CUDA version and specifies Anacoda Python channel to get recent versions of packages.
Conda YML environment
# YML file can specify channel for package # pytorch Conda channel has latest Pytorch versions # channel search /opt/anaconda3/bin/conda search -c pytorch torch - pytorch::pytorch - pytorch::torchvision - pytorch::torchtext # Conda installs cudatoolkit to active GPU for ML packages # Prefix must match base miniconda installation directory # Loading environment into base so no activation required for simpler use prefix: /opt/miniconda
Anaconda Python manages both the CUDA and Python package libraries simplifying management and the Anaconda Python environment can be installed inside a Docker container for a portable machine learning environment.