op-desc-generation

Generate operator description JSON files from API specifications for Ascend operator development.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? It converts operator API descriptions or user specifications into structured operator description JSON files, providing the standardized input required by the first step of the Ascend operator generation pipeline. ## Core Features & Use Cases - Structured JSON Generation: Produces op_desc JSON with op_name, category, description, shape_info, attributes, and test_cases fields based on a template. - Test Case Extraction: Parses test case tables from api_description.md and embeds all cases into the output JSON. - Pipeline Preparation: Copies api_description.md into the downstream work_dir via a helper script so later pipeline stages can locate it. - Use Case: Given a PyTorch-style API description for an operator like LayerNorm, generate output/{op_name}/{op_name}_op_desc.json with representative shapes, dtypes, attributes, and all test cases for downstream kernel development. ## Quick Start Ask the agent to generate an operator description JSON from the provided api_description.md for your target operator.

Frequently Asked Questions about op-desc-generation

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

FAQPage Schema
How do I generate an operator description JSON for Ascend operator development?

Provide an API description or specification, and the skill extracts the operator name, category, math description, tensor shapes, dtypes, and attributes, then writes output/{op_name}/{op_name}_op_desc.json following the bundled template.

What fields does the operator description JSON contain?

The JSON contains op_name, category, description, shape_info with input and output shapes and dtypes, attributes for non-tensor parameters, and test_cases listing all cases from the api_description.md test table.

Does the skill require an api_description.md file to work?

No, api_description.md is optional. When present, its test case table must be included in the output JSON; when absent, the test_cases field may be omitted and shapes are inferred from the user specification or PyTorch API definitions.

How does the skill prepare files for downstream pipeline steps?

It runs scripts/prepare_api_desc.py with --work-dir and --api-desc arguments to copy the API description into work_dir/api_description.md, which downstream evaluation stages look up by convention.

What operator categories are supported in the description JSON?

The category field must be chosen from pooling, activation, convolution, reduction, normalization, matmul, loss, optimizer, or math, matching the classification used by the operator generation pipeline.