precision-pass

Diagnose PyPTO Pass precision failures using PreCheck/PostCheck verification and pass_compare Op-level comparison.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? When a PyPTO operator on Ascend NPU produces wrong results, developers struggle to determine whether the fault lies in the frontend, a compiler Pass, codegen, or on-device execution. This Skill provides a structured workflow to enable full-chain Pass verification, interpret verification error codes, and pinpoint the exact failing Pass and Op. ## Core Features & Use Cases - Full-chain Pass verification: Configure verify_options and tile_fwk_config.json with PreCheck/PostCheck to validate every compiler Pass, using CodegenPreproc as the authoritative pass/fail criterion. - Op-level fault localization: Run pass_compare.py between a failing Pass and its golden predecessor to generate a CSV of per-Op PASS/FAIL results, then analyze failures by opcode and symbol. - Sync and VF fusion debugging: Detect pipeline synchronization races via enableDebug and binary PIPE_ALL insertion (binary_pipeall_sync.py), then map problem CCE lines back to frontend source with locate_source_line.py. - Use Case: A PyPTO operator fails precision with error 0xB4001U. Enable PreCheck/PostCheck, find CodegenPreproc FAIL, run pass_compare against the previous passing Pass, and identify the exact failing Op to fix. ## Quick Start Ask the assistant to diagnose a PyPTO Pass precision failure by enabling PreCheck/PostCheck verification and running pass_compare to locate the failing Op.

Frequently Asked Questions about precision-pass

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

FAQPage Schema
How do I locate a failing Pass in PyPTO precision verification?

Enable PreCheck and PostCheck in tile_fwk_config.json plus verify_options with enable_pass_verify, then rerun the operator. Only the final CodegenPreproc Pass result matters; if it fails, run pass_compare.py against the previous passing Pass to find the failing Op.

What does PyPTO error code 0xB4001U mean?

Error 0xB4001U is VERIFY_RESULT_MISMATCH, indicating a frontend or Pass-level precision mismatch. If it appears at tensor_graph stage it is a frontend issue; if tied to a specific Pass, use PreCheck/PostCheck verification and pass_compare to localize it.

How do I use pass_compare.py to find the problem Op?

Run pass_compare.py with --p specifying the failed Pass and the golden Pass, plus --verify_path pointing to the verification data directory. It outputs a CSV with per-Op PASS/FAIL results that you can aggregate by opcode and symbol to identify the failing Op.

Why does precision still fail when all PyPTO Passes pass?

If CodegenPreproc passes but precision is still wrong, the cause is likely a pipeline synchronization race or VF fusion issue. Enable enableDebug in insert_sync.h to confirm, then use binary_pipeall_sync.py to bisect CCE files and lines for missing pipe_barrier calls.

What environment variables are required for PyPTO Pass verification?

Set ASCEND_WORK_PATH for log output, ASCEND_GLOBAL_LOG_LEVEL to 0 for debug logs, and TILE_FWK_DEVICE_ID when running on NPU. Verification also requires torch version 2.1.0 or higher, otherwise error 0xB0001U occurs.

When should intermediate Pass failures be ignored in PyPTO verification?

Intermediate Passes such as ReplaceTensor or ProcessAtomic may report VERIFY_RESULT_MISMATCH as false positives. Only the final CodegenPreproc Pass result is authoritative; if it passes, the Pass layer is precision-correct and no further Pass debugging is needed.