kernel-generator

Generate operator kernels across multiple DSLs and backends.

258|48|Updated Jun 22, 2020
One-click install
npx skills add https://github.com/mindspore-ai/akg --skill kernel-generator-mindspore-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kernel-generator
Source: https://github.com/mindspore-ai/akg/tree/main/akg_agents/workspace/.opencode/skills/kernel-generator
Command: npx skills add https://github.com/mindspore-ai/akg --skill kernel-generator-mindspore-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill coordinates end-to-end operator kernel generation by providing a structured workflow to discuss strategies, generate code, and iterate based on feedback.

Core Features & Use Cases

  • Supports multiple DSL backends (triton_cuda, triton_ascend, cpp, cuda_c, tilelang_cuda, pypto) for kernel code generation.
  • Handles modes: first generation, repair generation, and pure modification, ensuring code changes are generated by the skill and not edited externally.
  • Use Case: A software engineer uses this skill to produce a complete ModelNew class for a given operator with correct inputs and shapes.

Quick Start

Provide a complete kernel-generation task: load references, analyze the operator, and emit a ModelNew implementation.

Frequently Asked Questions about kernel-generator

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

FAQPage Schema
How do I automate operator kernel generation from a DSL specification?

Automating operator kernel generation requires orchestrating DSL-driven plan and code emission, which this skill handles by validating inputs like op_name, framework, backend, arch, and dsl to produce a complete ModelNew class.

Can I generate kernel code for both CUDA and Ascend backends?

Yes, you can generate kernel code for CUDA and Ascend backends using supported DSLs like triton_cuda, triton_ascend, cpp, cuda_c, tilelang_cuda, and pypto across CPU, GPU, and NPU hardware architectures.

How do I fix or modify an existing operator kernel implementation?

To fix or modify an existing operator kernel, you use the repair generation or pure modification modes provided by the kernel generation workflow to iterate based on feedback without externally editing the code.

What inputs do I need to provide to generate a ModelNew class for a custom operator?

Generating a ModelNew class requires providing op_name, task_desc, framework, backend, arch, and dsl parameters, which are then validated against references to ensure correct operator implementation and shapes.

Does this kernel generation workflow support the TileLang DSL for GPU targets?

Yes, the kernel generation workflow supports the tilelang_cuda DSL to automate plan and code emission specifically for GPU targets, alongside other supported domain-specific languages.

What is the difference between initial generation and fix-generation modes for kernel code?

Initial generation creates the first kernel code draft from a DSL spec, whereas fix-generation iteratively repairs and modifies the existing ModelNew class implementation based on validation feedback.