tilelang-cuda-patterns

Generate TileLang CUDA kernels from elementwise, reduction, matmul, and GEMV templates.

258|48|Updated Jun 22, 2020
One-click install
npx skills add https://github.com/mindspore-ai/akg --skill tilelang-cuda-patterns-mindspore-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tilelang-cuda-patterns
Source: https://github.com/mindspore-ai/akg/tree/main/akg_agents/python/akg_agents/op/resources/skills/tilelang-cuda/guides/tilelang-cuda-patterns
Command: npx skills add https://github.com/mindspore-ai/akg --skill tilelang-cuda-patterns-mindspore-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This pattern library standardizes CUDA kernel development for TileLang, enabling rapid and reliable implementation of common kernel structures with ready-to-use templates.

Core Features & Use Cases

  • Elementwise: per-element computations with straightforward memory access patterns.
  • Reduction: built-in reduction strategies for aggregations like sum and max.
  • MatMul/GEMV: tiled matrix operations using shared memory and efficient memory access.
  • Use Case: quickly scaffold a new kernel by selecting a pattern and adapting to problem size.

Quick Start

Use a predefined TileLang CUDA pattern to scaffold a kernel by selecting elementwise, reduction, matmul, or gemv and adapting block/grid sizes.

Frequently Asked Questions about tilelang-cuda-patterns

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

FAQPage Schema
How do I implement CUDA kernels for matmul and GEMV using TileLang?

You can implement CUDA kernels for matmul and GEMV using TileLang by selecting a predefined template from this pattern library and adapting the block and grid sizes to your problem dimensions. These templates leverage shared memory and efficient memory access strategies.

What ready-to-use CUDA kernel templates are available for TileLang?

Available CUDA kernel templates for TileLang include elementwise computations, reduction aggregations, matmul, and GEMV. They provide ready-to-use structures for memory tiling and shared memory strategies to standardize and accelerate kernel development.

Do I need a specific CUDA runtime to use TileLang kernel patterns?

Yes, you need a CUDA runtime and the TileLang CUDA DSL to use these kernel patterns. The patterns map computations directly to grid, block, and memory primitives, requiring this specific environment to generate and execute the kernels correctly.

What's the best way to scaffold a reduction kernel in TileLang?

The best way to scaffold a reduction kernel in TileLang is to select the built-in reduction pattern provided here, which offers built-in strategies for aggregations like sum and max, and then adapt the block and grid configurations to fit your data size.

How does memory tiling work in TileLang CUDA patterns?

Memory tiling in TileLang CUDA patterns works by mapping computations to grid, block, and memory primitives. It utilizes shared memory strategies within the provided matmul and GEMV templates to ensure efficient memory access during kernel execution.