Dynamic Shape Handling: Top 3 Compiler Strategy Impacts
Compilers balance various dynamic shape strategies like basic padding for fixed sizes, constrained dynamic shapes for higher throughput (e.g., up to 23x prefill boost), and advanced techniques like dynamic batching or runtime specialization, each with distinct latency and resource trade-offs.
The top 3
- Constrained Dynamic Shapes: Up to 23x Prefill Throughput Boost: Compiler strategies, including input-level padding and symbolic shape propagation, have shown to deliver up to a 23x prefill throughput boost for Large Language Models with constrained dynamic input lengths.
- Symbolic Shape Propagation: Unlocking Flexible LLM Compilations: Compilers leverage symbolic shape propagation to dynamically track and deduce tensor shapes, enabling more flexible and efficient code generation for LLMs with varied input sizes without requiring full recompilation.
- Cross-Layer Optimization: Unifying Dynamic Shape Strategies: TVM Unity's cross-layer optimization approach unifies dynamic shape handling across various compiler stages, allowing for holistic performance improvements by enabling interactions and automated optimization beyond isolated techniques.
Sources
Open the full topic