SparseMatmulTla Example Readme【免费下载链接】catlass本项目是CANN的算子模板库提供NPU上高性能矩阵乘及其相关融合类算子模板样例。项目地址: https://gitcode.com/cann/catlassCode Organization├── 41_sparse_matmul_tla │ ├── CMakeLists.txt #CMake build file │ ├── README.md │ ├── sparse_gen_data.py │ └── sparse_matmul_tla.cpp # Main fileExampleAfter obtaining the code, compile the operator executable file. For details, see Template Library Quick Start.Runsparse_gen_data.pyto generate a test sample. The test sample needs to be input from the command line. After the command is executed, theinputandoutputdirectories are generated in the specified path, including the input data of the operator and the golden data used for precision verification.Then, execute the operator. Note that the input shape of the operator must match the shape of the data generated in the first step. In addition, this sample supports only theint8_tdata type for the input of matrix A or B.The following is a complete shell script example (run in the project directory):m160 n320 k64 device0 function build() { bash scripts/build.sh 41_sparse_matmul_tla } function gen_data() { cd examples/41_sparse_matmul_tla python3 sparse_gen_data.py $m $n $k echo Data gen finished } function run_kernel { echo Case: m $m k $k n $n cd ../../output/bin/ cp -r ../../examples/41_sparse_matmul_tla/input . cp -r ../../examples/41_sparse_matmul_tla/output . ./41_sparse_matmul_tla $m $n $k $device } build gen_data run_kernelIf the following result is displayed, precision verification is successful.Compare success.【免费下载链接】catlass本项目是CANN的算子模板库提供NPU上高性能矩阵乘及其相关融合类算子模板样例。项目地址: https://gitcode.com/cann/catlass创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
CANN/catlass稀疏矩阵乘法示例
发布时间:2026/6/24 14:11:08
SparseMatmulTla Example Readme【免费下载链接】catlass本项目是CANN的算子模板库提供NPU上高性能矩阵乘及其相关融合类算子模板样例。项目地址: https://gitcode.com/cann/catlassCode Organization├── 41_sparse_matmul_tla │ ├── CMakeLists.txt #CMake build file │ ├── README.md │ ├── sparse_gen_data.py │ └── sparse_matmul_tla.cpp # Main fileExampleAfter obtaining the code, compile the operator executable file. For details, see Template Library Quick Start.Runsparse_gen_data.pyto generate a test sample. The test sample needs to be input from the command line. After the command is executed, theinputandoutputdirectories are generated in the specified path, including the input data of the operator and the golden data used for precision verification.Then, execute the operator. Note that the input shape of the operator must match the shape of the data generated in the first step. In addition, this sample supports only theint8_tdata type for the input of matrix A or B.The following is a complete shell script example (run in the project directory):m160 n320 k64 device0 function build() { bash scripts/build.sh 41_sparse_matmul_tla } function gen_data() { cd examples/41_sparse_matmul_tla python3 sparse_gen_data.py $m $n $k echo Data gen finished } function run_kernel { echo Case: m $m k $k n $n cd ../../output/bin/ cp -r ../../examples/41_sparse_matmul_tla/input . cp -r ../../examples/41_sparse_matmul_tla/output . ./41_sparse_matmul_tla $m $n $k $device } build gen_data run_kernelIf the following result is displayed, precision verification is successful.Compare success.【免费下载链接】catlass本项目是CANN的算子模板库提供NPU上高性能矩阵乘及其相关融合类算子模板样例。项目地址: https://gitcode.com/cann/catlass创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考