一句话:提出一种编译方法,借助静态代价分析生成高效 VNNI 代码,提升稠密线性代数与 DNN 计算性能。
Intel 的 VNNI 指令在稠密线性代数计算上比传统 SIMD 指令更高效,但现有自动向量化器常在内层循环或基本块中无法识别 VNNI 的独特计算模式,或其窥孔优化与模式匹配过于受限而生成低效代码;自动调优框架虽可产生较优代码,却依赖复杂模板与大量搜索。本文提出一种新的编译方法:利用稠密线性代数的显著特征识别 VNNI 的利用机会,进而确定最有效的输入供给策略,并通过高效内存访问、寄存器/缓存复用以及指令级并行来隐藏 VNNI 执行延迟。该方法由定制的静态代价分析模型指导探索,确定有效代码变换与生成所需的关键参数。在 DLA 和 DNN 工作负载上的评估表明,该框架优于最先进的工业编译器和研究方案。
Intel's Vector Neural Network Instruction (VNNI) provides higher efficiency on calculating dense linear algebra (DLA) computations than conventional SIMD instructions. However, existing auto-vectorizers frequently deliver suboptimal utilization of VNNI by either failing to recognize VNNI's unique computation pattern at the innermost loops/basic blocks, or producing inferior code through constrained and rudimentary peephole optimizations/pattern matching techniques. Auto-tuning frameworks might generate proficient code but are hampered by the necessity for sophisticated pattern templates and extensive search processes. This paper introduces a novel compilation methodology that generates high-performance VNNI-enabled code. By leveraging DLA's salient characteristics to identify VNNI's utilization opportunities, it proceeds to pinpoint the most effective strategies for feeding VNNI's inputs and hinding VNNI's execution latency via efficient memory access and register/cache reuse and exploited instruction-level parallelism. A tailored static cost analysis model guides this exploration, determining critical parameters for effective code transformation and generation. The evaluation on DLA and DNN workloads show that our framework outperforms state-of-the-art industrial compilers and research works.