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.
翻译:对神经网络(NN)高性能和高准确性的需求从未停止。现有的张量编译和神经架构搜索技术正交地优化了两个目标,但实际上在它们的具体策略上存在许多相似之处。我们通过将两者合并为一个,为内核架构搜索(KAS)打造案例。KAS从系统层面审查NAS,并向更精细的层面缩放,生成既具有高性能又具有良好准确性的神经内核。为展示KAS的潜力,我们构建了一个端到端框架——Canvas,用于查找替换卷积的高质量内核。Canvas从丰富的微观原语中抽样,随机地和迭代地构造新内核,并根据用户指定的约束条件进行评估。Canvas支持内核内的自由可调整张量维度大小,并使用两个级别的求解器来满足结构合法性和充分利用模型预算。评估结果显示,通过在常见的NN中用生成的新内核替换标准卷积,Canvas相对于先前的最新技术实现了1.5倍的平均加速比,且具有可以接受的准确性损失和搜索效率。Canvas通过重新发现过去许多手动设计的内核并产生可能启发未来机器学习创新的新结构,验证了KAS的实用性。