HAQ: Pioneering RL for Mixed-Precision Bit Allocation
The original Hessian-Aware Quantization (HAQ) framework, introduced by Wang et al. in 2018, pioneered the use of Reinforcement Learning (RL) to determine optimal bitwidth assignments for neural network layers. It leveraged Hessian-based sensitivity metrics, modeling bitwidth allocation as a sequential decision process to balance accuracy and hardware constraints.
The top 3
- HAQ's RL Agent: Actions, States, and Rewards: HAQ leverages a Deep Deterministic Policy Gradient (DDPG) reinforcement learning agent. The agent observes a layer's configuration and statistics (state), then decides the bit-width for weights and activations (action). Its reward is primarily based on the accuracy of the quantized model after a short retraining, aiming to maximize accuracy while implicitly satisfying hardware constraints through limited action space.
- Hardware Awareness: Direct Feedback vs. Proxies: Unlike conventional methods that use proxy signals like FLOPs or model size, HAQ integrates hardware accelerators or simulators into its design loop. This allows the RL agent to receive direct feedback on latency and energy consumption, enabling it to specialize quantization policies for specific hardware architectures (e.g., edge vs. cloud) and resource constraints.
- HAQ's Impact: Latency, Energy, and Accuracy Gains: Compared to fixed 8-bit quantization, HAQ can reduce latency by 1.4x to 1.95x and energy consumption by 1.9x with negligible accuracy loss. This efficiency stems from its ability to automatically determine optimal mixed-precision policies tailored to specific neural network and hardware architectures, leading to significant resource savings for DNN inference.
Sources
Open the full topic