pytorch floor
serves pytorch-path chapters 01 · 06 · 08 (and the xla path's collectives chapter) · streaks check themselves off · all floors
Predict the machine, then look.
Three stations, every answer measured, never invented: forty-eight view chains run on real torch, eight compile scenarios verdicted by dynamo's own counters, and five collectives captured from a real four-process gloo run. Predict before the reveal; the streaks keep score in your browser only.
Active recall, one tap
x = torch.arange(32.).reshape(4, 8) y = x.flatten()
what is y: shape, stride, contiguous?
def f(x):
return torch.sin(x) + 1
cf = torch.compile(f)
cf(torch.randn(4))
cf(torch.randn(4))what did dynamo do?
in a table
Name the collective
Four ranks, their tensors before and after one collective, captured from a real four-process gloo run on this machine. The skill is reading what moved: who ended up equal, who kept a partial, who got a slice. It serves the pytorch distributed chapter and the xla path's collectives chapter alike, because the contract does not care which framework called it.
| rank | before | after |
|---|---|---|
| 0 | [1, 10] | [10, 100] |
| 1 | [2, 20] | [10, 100] |
| 2 | [3, 30] | [10, 100] |
| 3 | [4, 40] | [10, 100] |
which collective ran?