Infinite impulse response (IIR) filters are essential building blocks in many audio applications, due to their strong modelling capability with low computational cost. However, this efficiency advantage is not immediately apparent when IIR is incorporated into common non-compiled deep learning frameworks, such as PyTorch, for end-to-end learning. Since PyTorch lacks a low-level automatic differentiation function for recursion, such as IIR, a naive implementation will result in a significant number of function and memory allocation calls, thereby slowing down the process. Tackling this issue is crucial for developing real-time systems that combine neural networks and audio filters.
This talk aims to showcase how PhilTorch, a PyTorch package that facilitates efficient gradient optimisations of filters, implement automatic differentiation for IIR using custom kernels. We will see that automatic differentiations in IIR filters also involve IIR filters. By wrapping IIR filters in custom functions, any low-level filter realisation outside PyTorch can be used to accelerate both filtering and gradient computations. In addition, we will investigate techniques that can significantly accelerate filter computation on GPUs, including diagonalised state-space models and parallel associative scan, and benchmark them against naive implementations.
