liveBook · Manning

Parallelism

As explained in Learn Generative AI with PyTorch

A training approach that computes multiple sequence elements simultaneously rather than strictly sequentially.

Parallelism computes multiple sequence elements simultaneously instead of processing one element at a time. In Transformer training, this reduces training time and supports large datasets. section 1.1.1 section 1.3

Compare parallelism with sequential processing:

  • RNNs and LSTMs process sequence elements sequentially, limiting training speed and preventing efficient training on huge datasets. section 1.3
  • Transformers process input sequences in parallel and use self-attention to capture relationships across long distances. section 9.0
  • Parallel processing does not automatically preserve sequence order, so Transformers add positional encodings to input embeddings. section 10.5

Translation with a Transformer

For English-to-French translation, a Transformer processes the input sentence in parallel, while its decoder generates French tokens autoregressively from BOS until EOS. section 10.5

How Learn Generative AI with PyTorch covers it

How deep it goes
Explains simultaneous versus sequential processing and positional encodings, but stops short of device-level implementation details.
Examples
Uses Transformer language translation and contrasts it with sequential RNN processing.
What you can do after
Evaluate why Transformers train faster than RNNs and why positional encodings accompany parallel input processing.
How it connects
Connects parallelism to Transformers, self-attention, RNNs, LSTMs, positional encodings, and large language models.

Also explained in

Compare how 38 books explain parallelism →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Generative AI with PyTorch. The section links point to the parts of the book it draws on.