By restricting LLM input shapes to hardware-friendly ranges, constrained dynamic shapes enable compilers to generate specialized, efficient kernels. This avoids the costly runtime overheads of JIT compilation or generic kernels required for fully unconstrained inputs, yielding up to 23x prefill speedups on devices like GPUs and NPUs.