The demands for higher performance and accuracy in neural networks (NNs) never end. Existing tensor compilation and Neural Architecture Search (NAS) techniques orthogonally optimize the two goals but actually share many similarities in their concrete strategies. We exploit such opportunities by combining the two into one and make a case for Kernel Architecture Search (KAS). KAS reviews NAS from a system perspective and zooms into a more fine-grained level to generate neural kernels with both high performance and good accuracy. To demonstrate the potential of KAS, we build an end-to-end framework, Canvas, to find high-quality kernels as convolution replacements. Canvas samples from a rich set of fine-grained primitives to stochastically and iteratively construct new kernels and evaluate them according to user-specified constraints. Canvas supports freely adjustable tensor dimension sizes inside the kernel and uses two levels of solvers to satisfy structural legality and fully utilize model budgets. The evaluation shows that by replacing standard convolutions with generated new kernels in common NNs, Canvas achieves average 1.5x speedups compared to the previous state-of-the-art with acceptable accuracy loss and search efficiency. Canvas verifies the practicability of KAS by rediscovering many manually designed kernels in the past and producing new structures that may inspire future machine learning innovations. For source code and implementation, we open-sourced Canvas at https://github.com/tsinghua-ideal/Canvas.
翻译:神经网络(NN)在性能和准确性方面的需求永远不会停止。现有的张量编译和神经结构搜索(NAS)技术在优化这两个目标方面具有正交性,但实际上在具体的策略上有很多相似之处。我们通过将两者结合成一个框架并为核架构搜索(KAS)提供依据,利用这些机会。KAS 从系统角度审视 NAS 并缩放到更细粒度的级别,以生成具有高性能和良好准确性的神经核。为了展示 KAS 的潜力,我们构建了一个端到端的框架 Canvas,用于查找高质量的卷积替代核。Canvas 从丰富的细粒度原语中进行抽样,以随机和迭代的方式构建新的核,并根据用户指定的约束条件进行评估。Canvas 支持内核内的自由调整张量维度大小,并使用两个层次的求解器来满足结构的合法性和充分利用预算。评估结果显示,通过将常见神经网络中的标准卷积替换为生成的新核,Canvas 相对于先前的最新技术实现了平均 1.5 倍的加速,并具有可接受的准确性损失和搜索效率。Canvas 通过重新发现遗产核并生成可能带来未来机器学习创新的新结构来验证 KAS 的实用性。有关源代码和实现,我们将 Canvas 开源在 https://github.com/tsinghua-ideal/Canvas。