numerics
Inference interview questions tagged numerics, across every topic.
11 questions · 4 unlocked for you
Concepts behind "numerics"
Concept pages for the mechanisms these questions lean on.
Foundational
The Online Softmax RecurrenceOnline softmax keeps a running max, a running normalizer and an unnormalized output, and rescales them when the max grows. The merge rule is exact and associative, which is what lets FlashAttention tile over keys and Flash-Decoding split one long context across thread blocks.🔦 Attention Kernels
Foundational
Number Formats for Inference: BF16, FP8, INT4, FP4Inference formats differ in three ways that matter: bytes per element, which sets decode speed and memory; exponent bits versus mantissa bits, which sets range and precision; and whether the GPU has tensor cores that multiply them natively. Llama 3.3 70B is 141 GB in BF16, 71 GB in FP8 and about 40 GB in NVFP4.🔢 Quantization & Numerics
Advanced
Nondeterminism and Batch InvarianceWhy an LLM endpoint gives different outputs at temperature 0: floating-point addition is not associative, kernels pick their reduction strategy (split-K, split reductions, split-KV) from the batch shape, and server load sets the batch. What atomics do and do not explain, what batch-invariant kernels change, and what they cost.🩺 Performance Debugging🔒 Premium
Advanced
Property-Testing Engine ComponentsHow to test serving-engine code the way graders do: state invariants, generate random operation sequences, compare against a slow reference within a tolerance derived from the number format, and shrink failures to a minimal repro. Includes a runnable stateful test for a KV block pool.⌨️ Implementation Patterns🔒 Premium