aog-a3-author

Generates A3 reference runner and input generation scripts for arch22-to-arch35 operator migration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? During arch22-to-arch35 operator migration, each new operator requires a manually authored A3 reference runner and input generator before the phase_o25_a3_ref pipeline can run, creating a per-op bottleneck that blocks migration progress. ## Core Features & Use Cases - Automated script authoring: Parses the upstream ops-nn operator directory's test_aclnn_{op}.cpp and {op}_proto.cpp to emit run_a3_reference.py, input_gen.py, and manifest.json into the migration workspace. - Dual emission paths: Selects a torch_npu Python wrapper path when available, or falls back to a cpp-binary wrapper path emitting a C++ runner, CMakeLists.txt, and build script for operators without torch bindings. - Validation gates and idempotence: Enforces AST parsing, byte-budget guards, and structural invariants before writing, refuses to overwrite existing scripts, and emits failure markers instead of partial output. - Use Case: When phase_o25_a3_ref detects a missing run_a3_reference.py for a port_a3_to_a5 operator, invoke this skill with the operator directory and workspace to generate the reference runner automatically. ## Quick Start Run /aog-a3-author with the absolute path to the ops-nn operator directory and the target workspace directory to generate the A3 reference scripts.

Frequently Asked Questions about aog-a3-author

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

FAQPage Schema
How do I generate an A3 reference runner for a new operator migration?

Invoke /aog-a3-author with the absolute path to the ops-nn operator directory and the target workspace. It parses test_aclnn_{op}.cpp and {op}_proto.cpp, then emits run_a3_reference.py, input_gen.py, and manifest.json into the workspace.

What happens when an operator has no torch_npu Python wrapper?

The skill falls back to Path B, emitting five artifacts including a modified C++ runner based on the upstream test file, a CMakeLists.txt linking ascendcl, nnopbase, and opapi, plus a build script. The generated run_a3_reference.py then invokes the compiled binary via subprocess.

When should the aog-a3-author skill not be used?

Do not use it for non-port_a3_to_a5 migration modes, when run_a3_reference.py already exists since the skill refuses to overwrite, or when the operator lacks an upstream test_aclnn_{op}.cpp file because no aclnn signature can be extracted.

Why does script generation fail with INVARIANT_FAILED or PARSE_FAILED?

PARSE_FAILED means the emitted Python does not pass ast.parse, while INVARIANT_FAILED means required symbols like torch_npu imports, main functions, or byte-budget guards are missing. The skill retries once with the error in the prompt, then fails without writing partial scripts.

What tensor size limits does the generated input_gen.py enforce?

The generated input_gen.py enforces a 100 MiB per-case tensor payload limit and a 1 GiB total dataset limit through executable MAX_CASE_TENSOR_BYTES and MAX_DATASET_TENSOR_BYTES guards. Representative shapes must be reduced if these canonical pre-allocation checks reject the payload.