TensoriumInterview preparation
← Home

Core concepts · 62 topics

A guided path through the ideas behind modern LLMs.

Read the stages in order: how text becomes a prediction, what happens inside the Transformer block, how a model learns, then serving, scale, and post-training. Every topic names what to know first, then gives the intuition, the math with concrete numbers, the common misconception, and a self-check. Already comfortable with the basics? Switch to By area and jump straight to a topic.

New to machine learning? Start here instead.

These topics work best as a refresher; they assume ideas like probability and loss. Begin with three short beginner lessons (tokens, embeddings, next-token prediction), then the visual walkthrough for attention and the Transformer.

Finish line: You can explain how text becomes a prediction and what training does to improve that prediction.

Topic 37 of 62 · Training at scale

Collectives and their communication cost

Hard

Which collective does each parallelism strategy use, and how do you estimate its time?

Why this mattersTranslating parallelism strategies into all-reduce, all-gather, reduce-scatter, and all-to-all byte counts lets you spot network bottlenecks before launching a job.

1 · Start with the intuition

Distributed training is a few communication patterns repeated millions of times. Data parallelism averages gradients with all-reduce. Sharded training splits that into reduce-scatter and all-gather. Tensor parallelism all-reduces or all-gathers activations inside every layer. Mixture-of-experts shuffles tokens with all-to-all. Estimating time means counting bytes and dividing by the bandwidth of the slowest link they cross.

2 · How the mechanism works

Mechanism step 1 of 3 · no question to answer

Name the collective

all-reduce, reduce-scatter, all-gather, all-to-all, broadcast, or point-to-point send/recv.

Next, we will look at: Count the bytes. Move on when this operation makes sense.

Visualizing the behavior

What each collective leaves on 4 ranks

Input
1rank 02rank 13rank 24rank 3
All-reduce (sum)
10rank 010rank 110rank 210rank 3
All-gather
1,2,3,4rank 01,2,3,4rank 11,2,3,4rank 21,2,3,4rank 3
Reduce-scatter
Σ c0rank 0Σ c1rank 1Σ c2rank 2Σ c3rank 3
Reduce-scatter assumes each rank starts with a 4-chunk vector and ends with the sum of one chunk. Reduce-scatter followed by all-gather equals all-reduce, which is how ZeRO keeps DDP-like traffic while sharding.

Same 2 GB all-reduce, different link speeds (bandwidth term only)

Derived
8 GPUs · 100 GB/s intra-node
35 ms
64 GPUs · 25 GB/s inter-node
≈ 158 ms
Bandwidths are assumptions for illustration. Measure your fabric with nccl-tests before planning.