一句话:提出 Felix,将张量程序空间可微化并用梯度下降高效搜索高性能实现。
在多种硬件上为张量程序(如深度神经网络)获得高性能实现仍很困难。现有基于搜索的优化器虽能自动发现高性能程序,但离散搜索空间庞大,往往需要数小时甚至数天。Felix 是一种新的基于梯度的张量程序编译优化框架:它对程序空间进行连续松弛,并构造可微的程序延迟估计器,从而将传统在离散、不可微目标上的搜索转化为可用梯度下降高效求解的问题。作者在六个视觉与自然语言处理深度神经网络、三个 GPU 平台上进行评估。实验表明,Felix 平均在 7 分钟搜索时间内即可超过 PyTorch、TensorFlow 和 TensorRT 的推理性能,并且找到优化程序的速度显著快于当前先进的张量程序搜索优化器 TVM Ansor。
Obtaining high-performance implementations of tensor programs such as deep neural networks on a wide range of hardware remains a challenging task. Search-based tensor program optimizers can automatically find high-performance programs on a given hardware platform, but the search process in existing tools suffer from low efficiency, requiring hours or days of time to discover good programs due to the size of the search space. We present Felix, a novel gradient-based compiler optimization framework for tensor-based programs. Felix creates a differentiable space of tensor programs that is amenable to search by gradient descent. Felix applies continuous relaxation on the space of programs and creates differentiable estimator of program latency, allowing efficient search of program candidates using gradient descent, in contrast to conventional approaches that search over a non-differentiable objective function over a discrete search space. We perform an extensive evaluation on six deep neural networks for vision and natural language processing tasks on three GPU-based platforms. Our experiments show that Felix surpasses the performance of off-the-shelf inference frameworks - PyTorch, Tensorflow, and TensorRT - within 7 minutes of search time on average. Felix also finds optimized programs significantly faster than TVM Ansor, a state-of-the-art search-based optimizer for tensor programs.