Catlass Operator Code Gen logo

Catlass Operator Code Gen

Organization
Ascend
catlass-operator-code-gen

根据CATLASS算子设计文档生成算子工程交付件

Overview

PublisherAscend
Repositoryagent-skills
Skill namecatlass-operator-code-gen
Stars
54
Forks
4
Bundled files
10
LicenseMulanPSL-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Ascend on GitHub. Read the source before you install it.

Installation

Install the Catlass Operator Code Gen AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Ascend/agent-skills/tree/master/skills/catlass-operator-code-gen
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Ascend/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/catlass-operator-code-gen .claude/skills/catlass-operator-code-gen
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Catlass Operator Code Gen in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Catlass Operator Code Gen on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Catlass Operator Code Gen is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Catlass 算子代码生成

核心工作流

设计文档解析 → Catlass 实现参考选型 → op_host 生成 → op_kernel 生成 → test_aclnn 生成 → 质量验证

设计文档遵守规范(CRITICAL)

设计文档是代码生成的唯一依据,须 100% 遵守。

章节必须遵守内容验证方式
算子名含 catlass 子串,snake_case 目录名与 CamelCase 类名一致目录、OpDef、test_aclnn 命名一致
I/O 与 dtype输入输出 shape、dtype、formatOpDef 与 test_aclnn tensor 一致
核心组件ArchTag、BlockMmad、BlockEpilogue、BlockScheduler、Kernel 类型op_kernel 与 custom-epilogue.md 一致
参考 example指定的 catlass example 路径与选型理由实现与选型一致(非整份粘贴)
TilingKey各分支对应 dtype/转置等Host SetTilingKey 与 TILING_KEY_IS 一一对应
Workspace固定写法见 kernel-rules.md

前置条件

检查项说明
设计文档含算子名、I/O、dtype、转置、参考 example、Kernel/Block/Epilogue
工程OPS_PROJECT_ROOT 已定,含 build.sh、ops/
Catlass<OPS_PROJECT_ROOT>/catlass/ 含 include/、examples/;缺则在工程根克隆

条件不明时追问用户。


Catlass 实现参考选型

在 catlass/examples/ 中按设计文档选定实现参考(读结构、抄组件组合思路,不是把 example 当 ops/ 迁移源):

  1. 找与算子形态最接近的示例
  2. 确定可复用的 Kernel/Block/Epilogue;算子工程 op_kernel 须 Device 调用
  3. 将 tiling 常量、Workspace、TILING_KEY_IS 分支与 Host 侧对齐

端到端步骤

Step 0:生成骨架(强制)

在 OPS_PROJECT_ROOT:bash build.sh --genop=ops/<op_name>

Step 1:清理模板、配置编译选项

删无用模板;按 compile-options.md 配置 ascendc_config.json

Step 2:对照设计文档列清单

算子名、I/O、dtype、转置、参考路径、Kernel/Block/Epilogue、Workspace、TilingKey 分支

Step 3:锁定实现参考

同上文「Catlass 实现参考选型」

Step 4:写 op_host

生成 3 类 4 个文件:

Step 5:写 op_kernel

按 kernel-rules.md:GET_TILING_DATA、TILING_KEY_IS、Device 调用、#define K_MAX_SHAPE_DIM 0、勿 #include tiling.h

Step 6:写 test_aclnn

按 example-rules.md 覆盖 examples/test_aclnn_<op_name>.cpp

Step 7:验证


常见陷阱

NEVER:跳过 --genop;tiling/infershape 并进 def;漏 IMPL_OP_* 注册;def 里 SetTiling/SetInferShape;目录名无 catlass;Kernel 内用 if 代替 TilingKey;op_kernel 用 DeviceGemm;op_kernel #include tiling.h;对 Gemm 仅用 shape 推断转置;忘记在 ascendc_config.json 中配置 Catlass 编译选项

ALWAYS:先 opgen 再覆盖;三文件分文件注册;严格按设计文档组件选型;在 ascendc_config.json 中配置 Catlass 编译选项;改算子后 --pkg 安装再跑示例


references 索引

文件内容
compile-options.md编译选项配置
code-structure.md目录树、文件职责索引
example-rules.mdtest_aclnn 写法
tiling-rules.mdtiling.h / tiling.cpp
def-rules.mddef.cpp
infershape-rules.mdinfershape.cpp
kernel-rules.mdCatlass 依赖与 Device 调用
custom-epilogue.md自定义 Tile Epilogue

参考资料

文档/目录用途
catlass/examples/advanced/basic_matmul_aclnn工程化 op_host / op_kernel / 测试组织对照
catlass/examples/03_matmul_addMatmulEpilogue + BlockEpilogue 组合参考
ascendc-operator-compile-debug编译、安装、跑示例
catlass-operator-design设计文档

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Catlass Operator Code Gen AI skill do?

根据CATLASS算子设计文档生成算子工程交付件

Why use Catlass Operator Code Gen on TypingMind?

Because you install it once and use it with any model. Catlass Operator Code Gen is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Catlass Operator Code Gen in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Ascend/agent-skills/tree/master/skills/catlass-operator-code-gen. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Catlass Operator Code Gen?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Catlass Operator Code Gen?

As many as you like. As long as a model supports skills, you can use Catlass Operator Code Gen with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Catlass Operator Code Gen AI skill free?

Yes. It is published on GitHub by Ascend under the MulanPSL-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇