ascendc-registry-to-direct-invoke

Migrates registry-based AscendC operators to direct-invoke kernel.py and ascendc_op projects.

6|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/xchang1121/op-autoresearch --skill ascendc-registry-to-direct-invoke-xchang1121
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ascendc-registry-to-direct-invoke
Source: https://github.com/xchang1121/op-autoresearch/tree/main/skills/ascendc/guides/registry-to-direct-invoke
Command: npx skills add https://github.com/xchang1121/op-autoresearch --skill ascendc-registry-to-direct-invoke-xchang1121

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Migrating an existing registry-based AscendC custom operator to a direct-invoke layout often introduces silent correctness bugs when kernel algorithms or tiling formulas are accidentally altered. This Skill defines fidelity rules so only the registration framework glue is replaced while kernel logic and tiling math stay intact. ## Core Features & Use Cases - Fidelity-Preserving Migration: Keeps kernel class layout, CopyIn/Compute/CopyOut order, loop structure, and dtype/tiling-key branches unchanged while replacing registry macros like IMPL_OP_OPTILING and REGISTER_TILING_DATA_CLASS. - Direct-Invoke Glue Generation: Guides creation of the direct launcher entry ABI, shared POD tiling struct, host launch code, PyTorch extension with torch.ops.npu registration and Meta functions, and a lazy-loading kernel.py. - Dependency Closure and Verification: Copies only the minimal symbol closure of external helpers, guards device-only code with NPU_HOST checks, and provides a checklist covering ABI consistency, tiling struct layout, and Meta shape/dtype correctness. - Use Case: You have a registry-invoke AscendC operator for Atlas A2 hardware and need it repackaged as a kernel.py plus ascendc_op/ direct-invoke project without changing its numerical behavior. ## Quick Start Migrate my registry-based AscendC operator in this workspace to a direct-invoke kernel.py and ascendc_op project while preserving the kernel algorithm and tiling formulas.

Frequently Asked Questions about ascendc-registry-to-direct-invoke

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

FAQPage Schema
How do I migrate a registry-based AscendC operator to direct-invoke?▼

Replace only the registration framework glue: swap registry macros for a direct launcher entry, a shared POD tiling struct, host launch code, and a PyTorch extension. Keep the kernel algorithm, tiling formulas, and dtype or shape branches unchanged.

What should not change when converting AscendC registry kernels to direct launch?▼

Do not modify the kernel class layout, CopyIn/Compute/CopyOut order, loop and branch structure, arithmetic expression order, or tiling formulas including alignment, tail computation, and variant branches. Merging similar tiling branches can compile fine but silently produce wrong results.

Which registry macros must be removed in a direct-invoke AscendC project?▼

Remove IMPL_OP_OPTILING, REGISTER_TILING_DATA_CLASS, runtime GET_TILING_DATA dispatch that depends on registry glue, and framework-specific OP_LOG macros. Replace logging with host-side exceptions or temporary printf debugging removed before submission.

Why does my AscendC kernel fail to compile for the host pass after migration?▼

AscendC compilation may run both host and device passes over the same source. Guard device-only MicroAPI or RegBase implementation code with #if !defined(__NPU_HOST__), but leave pure POD tiling headers unguarded since both passes use them.

How do I verify a migrated direct-invoke AscendC operator is correct?▼

Check that host declaration, generated launcher, and kernel entry ABIs match exactly, tensor pointers follow the launcher convention, tiling struct fields match in name, type, order, and size on both sides, and the PyTorch Meta function returns correct shape and dtype.