ascendc-runtime-debug

Diagnose Ascend C operator runtime errors using error codes and plog logs.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill ascendc-runtime-debug-wangwindow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ascendc-runtime-debug
Source: https://github.com/WangWindow/CANN-BatchMatMulMaxsum/tree/main/.agents/skills/ascendc-runtime-debug
Command: npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill ascendc-runtime-debug-wangwindow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Ascend C operator developers often hit opaque runtime failures—aclnn error codes like 161xxx, 361xxx, 561xxx, or vector core exception 507035—without a clear path to root cause. This Skill provides a systematic debugging workflow that maps error codes to concrete root causes and remediation steps. ## Core Features & Use Cases - Error Code Triage: Classifies aclnn return codes (161xxx parameter errors, 361xxx runtime errors, 561xxx internal errors, 507035 vector core exceptions) and routes each to targeted diagnostic flows covering Tiling faults, kernel lookup failures, and environment misconfiguration. - Kernel Binary Debugging: Diagnoses build-system issues such as stale compile caches, TilingKey/SEL mismatches, missing dtype entries, multi-version vendor package conflicts, and opParaSize mismatches. - plog Log Parsing: Ships a parse_plog.py script that extracts and classifies ERROR/WARN entries from Ascend plog logs to accelerate root-cause analysis. - Use Case: Your custom operator returns 561003 (kernel not found) after installation. The Skill walks you through checking the installed .so under $ASCEND_OPP_PATH, verifying vendor_name and SOC consistency, and validating ASCEND_OPP_PATH and LD_LIBRARY_PATH environment variables. ## Quick Start Ask the assistant to diagnose the Ascend C operator runtime error code you received, for example by pasting the aclnn return code and error message.

Frequently Asked Questions about ascendc-runtime-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug Ascend C operator runtime error codes?

First call aclGetRecentErrMsg() after a non-zero aclnn return code, then classify by prefix: 161xxx indicates parameter errors, 361xxx runtime errors, and 561xxx internal errors such as Tiling or kernel lookup failures. Each class has a dedicated diagnostic flow with concrete checks.

What does error code 507035 mean on Ascend NPU?

507035 is a vector core exception reported via aclrtStreamSynchronize(), most commonly caused by DataCopyPad parameters not being 32-byte aligned or UB buffer overflow. Check blockLen alignment, UB sub-tensor offsets, and tmpBuf sizing using the official GetReduceMaxMaxMinTmpSize API.

How do I fix aclnn error 561003 kernel not found?

561003 means the runtime cannot find the operator kernel binary. Verify the .so exists under $ASCEND_OPP_PATH/vendors/<vendor_name>, confirm vendor_name and SOC match the build flags, check ASCEND_OPP_PATH and LD_LIBRARY_PATH, and rule out multi-version vendor package conflicts.

How do I parse Ascend plog logs for runtime errors?

Run python3 scripts/parse_plog.py with a plog file path, or without arguments to use the latest log under ~/ascend/log/debug/plog. The script extracts ERROR and WARN lines and classifies errors by type such as parameter, Tiling, or kernel lookup errors.

Why does my Ascend operator output stay unchanged after editing kernel code?

Stale build artifacts are the usual cause: the opc compiler cache or an old installed package may still be loaded. Clean build/ and $HOME/atc_data/kernel_cache/, compare sha256 of built versus installed binaries, and remove old vendor package directories before reinstalling.

Can Tiling errors be debugged without an NPU device?

Yes. Errors like 561002 (Tiling exception) and 161xxx parameter errors can be reproduced in host-side UT tests without NPU hardware. If the UT fails, the TilingFunc logic is at fault; if it passes, investigate the ST environment or kernel side.