CANN/catlass小形状矩阵乘法示例

📅 2026/6/24 6:36:07
CANN/catlass小形状矩阵乘法示例
SmallMatmul Example Readme【免费下载链接】catlass本项目是CANN的算子模板库提供NPU上高性能矩阵乘及其相关融合类算子模板样例。项目地址: https://gitcode.com/cann/catlassCode Organization├── 31_small_matmul │ ├── CMakeLists.txt # CMake build file │ ├── README.md │ └── small_matmul.cpp # Main fileFunctionThis operator reduces unnecessary scalar computation overheads based on basic_matmul in the small-shape scenarios.The number of basic blocks to be tiled cannot exceed the number of cube cores, that is,ceilDiv(m, L1TileShape::M) × ceilDiv(n, L1TileShape::N) ≤ aicCoreNum.The k axis cannot exceedL1TileShape::K.ExampleAfter obtaining the code, compile the operator executable file. For details, see Template Library Quick Start.Execute the operator.# Compile a specified test case. bash scripts/build.sh 31_small_matmul cd output/bin # Executable file name | Matrix M-axis | N-axis | K-axis | Device ID # The device ID is optional. The default value is 0. ./31_small_matmul 256 1024 256 0If the following result is displayed, precision verification is successful.Compare success.【免费下载链接】catlass本项目是CANN的算子模板库提供NPU上高性能矩阵乘及其相关融合类算子模板样例。项目地址: https://gitcode.com/cann/catlass创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考