liveBook · Manning

GPU

As explained in Hugging Face in Action

A graphics processing unit is a massively parallel processor designed to accelerate computation, including machine learning workloads.

A graphics processing unit (GPU) accelerates machine-learning computation through massively parallel processing. PyTorch uses CUDA to move tensor operations onto supported NVIDIA GPUs, speeding training and inference; it can also distribute large models across multiple GPUs. section 2.2.1

Run a Transformers pipeline on CUDA

from transformers import pipeline classifier = pipeline( model="distilbert/distilbert-base-uncased-finetuned-sst-2-english", device="cuda") classifier("The service was excellent and the food was memorable.") Setting device="cuda" allocates the pipeline to a CUDA-compliant GPU; the default device is "cpu". The pipeline returns a sentiment label and confidence score. section 3.2.4

How Hugging Face in Action covers it

How deep it goes
Explains CUDA integration, memory movement, device checks, monitoring, and multi-GPU model parallelism without deriving GPU internals.
Examples
Demonstrates CUDA availability checks, GPU property inspection, GPUtil monitoring, and sentiment classification on a CUDA pipeline.
What it assumes
Assumes basic Python and machine-learning workflow familiarity while showing installation and device validation from the start.
What you can do after
Operate/configure PyTorch and Transformers workflows to detect GPUs, inspect devices, and place inference on CUDA.
How it connects
Connects GPUs with PyTorch, CUDA, Transformers pipelines, TensorFlow, CPU execution, and model parallelism.

Also explained in

Compare how 14 books explain GPU →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hugging Face in Action. The section links point to the parts of the book it draws on.