Function

Currently, some operators in the open source repository use the project template provided by msOpGen. However, operator calling based on this template is complex, and it is difficult to implement lightweight operator debugging. To solve such problems, you can use the mskpp.tiling_func and mskpp.get_kernel_from_binary APIs provided by msKPP to directly call the tiling function in the msOpGen project and the user-defined kernel function.

  • When this function is used, the operator input and output support only numpy.Tensor and torch.Tensor.
  • If an operator of the same type (op_type) has been deployed in CANN, and you have modified the tiling function and recompiled the operator, you need to redeploy the operator in the CANN environment.
  • When the mskpp.tiling_func and mskpp.get_kernel_from_binary APIs are called, the system generates the following intermediate files in the mindstudio_mskpp_gen folder in the current directory. The files are used only for locating by developers. Users do not need to pay attention to the files. Do not modify the content of the folder and its subfiles. Otherwise, the tool functions may be abnormal.
    (p39) root@ubuntu:~/project/add_custom/CustomOp$ ll mindstudio_mskpp_gen/
    total 388
    drwxr-x---  2 root root    314 Jul 24 09:40 ./
    drwxr-x--- 10 root root   4096 Jul 24 09:40 ../
    -rw-------  1 root root  13042 Jul 24 09:40 _mskpp_gen_binary_launch.1.cpp
    -rw-------  1 root root  13231 Jul 24 09:40 _mskpp_gen_binary_launch.2.cpp
    -rw-------  1 root root  26640 Jul 24 09:40 _mskpp_gen_binary_module.1.so
    -rw-------  1 root root  26640 Jul 24 09:40 _mskpp_gen_binary_module.2.so
    -rw-------  1 root root   4878 Jul 24 09:40 _mskpp_gen_tiling.1.cpp
    -rw-------  1 root root 141432 Jul 24 09:40 _mskpp_gen_tiling.1.so
    -rw-------  1 root root   5127 Jul 24 09:40 _mskpp_gen_tiling.2.cpp
    -rw-------  1 root root 141432 Jul 24 09:40 _mskpp_gen_tiling.2.so