Compilation or Execution Problem of Operators Containing High-Level APIs Occurs When Using Cross-Version Custom Operator Packages
Symptom
- Based on CANN-7.2 or earlier, the custom operator package that contains Matmul high-level APIs is compiled, and then installed in the CANN package environment of CANN-7.3 or later. When the operator is compiled online in graph mode, the following error is reported:
1 2
res = struct.unpack_from(fmt_str, tiling_data, offset + unpack_size) struct.error: unpack_from requires a buffer of at least 52 bytes for unpacking 4 bytes at offset 48
- Based on CANN-7.2 or earlier, the sample repository operator that contains Matmul high-level APIs (such as MatmulLeakyReluCustomSample) is compiled, and then installed in the CANN package environment of CANN-7.3 or later. When single-operator APIs are called, the following error is reported:
1ERROR: acl executable run failed! please check your project!
Cause Analysis
The software version for compiling the custom operator package is out of date. You can update the CANN Toolkit version in the custom operator package compilation environment, and recompile and deploy the custom operator package.
Solution
- Check the version number of the CANN Toolkit used for compiling the custom operator package. The following is an example:
cd ${CANN package installation path} cat version.cfg # version: 1.0 runtime_running_version=[7.2.T11.0.B218:8.0.RC2.alpha001] runtime_upgrade_version=[7.2.T11.0.B218:8.0.RC2.alpha001] runtime_installed_version=[7.2.T11.0.B218:8.0.RC2.alpha001] - Recompile the custom operator package based on CANN-7.3 or later. After the custom operator package generated during compilation is deployed, the operator can be compiled and executed properly without error reported. For details about how to recompile and deploy the custom operator package, see Build and Deployment.
Parent topic: FAQ