Accelerator memory and interconnect
Quick answer
Accelerators speed up suitable numerical workloads, but device memory and data movement determine whether a model fits and whether it runs efficiently. Start by estimating peak memory before choosing hardware. Examples use small synthetic inputs and dependency-free Python. No cloud calls. ByteMind execution is unverified.
Count parameter bytes
Expected output (locally tested): 400000000 1600000000. Four bytes per weight versus sixteen for the stated training state.
How it works
CPUs offer flexible control flow and large host memory; GPUs expose massive parallel arithmetic; TPUs and other specialized accelerators require compatible operators, compilers and runtimes. A tensor with N elements and b bytes per element needs N*b bytes before allocator overhead. Training also needs gradients, optimizer state, activations, temporary buffers and possibly master weights. An illustrative FP32 Adam budget is 16 bytes per trainable parameter (weights, gradients, two moment arrays); mixed precision and sharding change this. Use GiB = 2**30 bytes, not decimal GB. Estimate activation and workspace peaks separately, then reserve margin. GPU memory is normally per device: two 16 GiB devices do not automatically provide a contiguous 32 GiB allocation. Data parallelism replicates state unless explicitly sharded. PCIe connects host/device on many systems; NVLink or other fabrics can increase peer bandwidth, while cross-node network bandwidth and topology influence collective cost. Transfer lower bound is bytes/effective bytes per second, not a measured runtime. Validate actual accelerator availability, supported dtypes, kernels and peak allocation on approved hardware.
Check per-device capacity
capacity=8*2**30need=1_600_000_000+3*2**30print(need <= capacity*0.8)Expected output (locally tested): True. The estimate fits below an 80% utilization limit.
Common mistakes
Do not count only model weights, assume memory pools across GPUs, or use theoretical bandwidth as observed throughput. A fitting estimate is not a guarantee because allocator fragmentation and activation peaks vary.
Practice and next steps
Estimate memory for 100 million FP32 Adam parameters, then add 2 GiB activations and 1 GiB workspace. Compare a 4 GiB device with an 8 GiB device after a margin. See storage and checkpoint bandwidth next.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Accelerator memory and interconnect — knowledge check
Apply accelerator memory and interconnect to small examples and debugging scenarios.
Which state contributes to training memory?
What is one GiB?
Do two 16 GiB data-parallel GPUs automatically fit a 24 GiB replica?
What limits a cross-node collective?
Why reserve memory margin?