A GPU can be correctly installed and still deliver unusable performance when software components disagree. Multiple CUDA Toolkit versions once caused PyTorch to select an incompatible version, turning expected model training into an estimated three-year job. section 5.1.2
The CUDA Toolkit provides the software layer that lets deep-learning frameworks communicate with NVIDIA GPUs. In practice, its surrounding stack also supports load balancing, quantization, parallelization, and efficient movement of matrix computations. section 5.1.2
Treat CUDA Toolkit configuration as an operational dependency:
- Configure the toolkit before installing DeepSpeed or other GPU-oriented libraries, and install a stable, non-nightly PyTorch version first. section 5.1.2
- Track which CUDA installation PyTorch and build tools actually select; having several versions installed can silently produce incompatibility or severe slowdowns. section 5.1.2
- Expect Linux configuration to require patience, especially when pairing the toolkit with NVIDIA drivers; virtual environments, Docker, and cloud computing belong in the same operational toolkit. section 5.4.5
Selecting CUDA for llama.cpp
When building llama.cpp on Ubuntu for GPU acceleration, CMake can identify the intended toolkit and compiler explicitly, enable cuBLAS, and target a specific CUDA architecture. This avoids relying on whichever installation Make or the environment discovers by default. section 11.1.3
Table 5.1 Comparison of optimization packages for ML
|
Library
|
Faster training or inference
|
Code integration
|
Lower accuracy
|
Many GPUs
|
Quantization
|
Optimizations
|
|---|---|---|---|---|---|---|
|
DeepSpeed
|
Both
|
CLI
|
Depends
|
Yes
|
Supports
|
Caching, gradient checkpointing, memory management, scaling
|
|
Accelerate
|
Both
|
CLI and Code
|
Depends
|
Yes
|
Supports
|
Automation, compiling, parallelization
|
|
BitsandBytes
|
Both
|
Code
|
Always
|
NA
|
Yes but only
|
Quantization, quantized optimizers
|
|
xFormers
|
Training
|
Code
|
Depends
|
NA
|
Yes and more
|
Efficient attention, memory management
|
Compare the optimization libraries that sit alongside CUDA-enabled training and inference stacks, including their integration style, quantization support, and multi-GPU behavior. section 5.1.2
