Floating-Point Dtype Review
A dtype tells the computer how to store numbers.
Deep learning commonly uses floating-point types because model values, gradients, and losses are real-valued approximations.
The dtype affects:
- memory use
- speed
- range of representable values
- precision between nearby values
More precision is not always faster. Less precision is not always safe. Large models often use lower precision to save memory and compute time, then use stability techniques to avoid failure.
The lesson is not "always use the largest dtype." The lesson is "know what your dtype can represent."
Enter 1 if dtype affects how numbers are stored, or 2 if dtype only changes the model architecture.
Compute it first, then check your number.
Enter 1 if lower precision often uses less memory, or 2 if lower precision always uses more memory.
Compute it first, then check your number.