Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

design-cute-dsl-kernel设计可爱的 DSL 内核

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

523

周安装

22

GitHub Stars

公开资料未说明

下载量

183
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:design-cute-dsl-kernel(设计可爱的 DSL 内核)
来源仓库:https://github.com/pepperu96/hyper-mla
仓库路径:skills/design-cute-dsl-kernel
安装命令:
npx skills add https://github.com/pepperu96/hyper-mla --skill design-cute-dsl-kernel
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pepperu96/hyper-mla --skill design-cute-dsl-kernel

简介

为CuTe DSL提供Python内核支持的高级设计工具。

  • 适用于需要线程级控制或显存优化的复杂场景。design-cute-dsl-kernel 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 支持显式控制线程、warp和warpgroup的执行分配。
  • 提供比cuTile公共接口更底层的硬件控制能力。
  • 需配合/design-kernel共享命名规范和版本管理使用。

SKILL.md

CuTe Python DSL Kernel Design

Always also load /design-kernel for shared naming, versioning, and workflow. Also load /cute-dsl-ref for API reference, execution model, and architecture operations.

When To Use CuTe Python DSL

Use CuTe Python DSL (cute-dsl) when cuTile's public control surface is no longer sufficient, but a Python-authored kernel workflow is still appropriate.

Suitability Gate

CuTe DSL is the right choice when the next optimization requires any of these controls that cuTile does not expose:

  • Thread/warp/warpgroup identity -- explicit control over which threads do what
  • Intra-CTA synchronization -- barriers, named barriers, arrive/wait patterns
  • Warpgroup scheduling -- producer/consumer warpgroup roles, persistent warpgroup loops
  • TMA pipeline control -- explicit multi-stage async copy pipelines with barrier synchronization
  • Cluster programming -- cross-CTA shared memory access, distributed shared memory
  • Register-level data movement -- explicit register-to-register shuffles, warp-level primitives
  • Custom epilogues -- fused post-processing with fine-grained control

When to stay in cuTile instead

If the optimization is still expressible through tile sizes, CTA remapping, occupancy/num_ctas hints, latency hints, or allow_tma flags, stay in cuTile. CuTe DSL adds complexity -- use it only when that complexity is load-bearing.

Hard design constraint

When profiling shows 1 CTA/SM, low eligible warps, and the fix requires explicit warpgroup or barrier scheduling, cuTile cannot close the gap. This is the canonical trigger to switch to CuTe DSL.

Naming And Layout

  • Public language key: cute-dsl
  • Python package path: cute_python
  • Kernel layout: src/mla_var3/kernel/cute_python/<layer>/<design>/<design>[_vN]/
  • Module: <design>[_vN].py
  • Wrapper: CuteKernel

CuteKernel Runtime Pattern

The runtime wrapper lives at src/mla_var3/runtime/cute_kernel.py.

CuTe DSL kernels use a two-level host/device pattern:

  1. A @cute.jit host function sets up TMA descriptors, computes the grid, and launches the kernel
  2. A @cute.kernel device function contains the GPU code

The CuteKernel dataclass wraps this pattern:

from mla_var3.runtime.cute_kernel import CuteKernel

# In KernelPlan.plan():
def plan(self, *inputs):
    # Build a closure that captures inputs and calls the host function
    def launch_fn(tiling):
        # Convert tensors, set up TMA descriptors, compute grid
        host_fn(tiling, *converted_inputs)

    return CuteKernel(
        kernel_fn=device_kernel,       # The @cute.kernel function (for naming)
        launch_fn=launch_fn,           # Closure: (tiling) -> launches kernel
        input_tensors=list(inputs),
        output_tensors=[output],
        tiling=self.tiling,
        autotune_configs=self._autotune_configs(),
        algorithmic_flops_bytes_fn=self._algorithmic_flops_bytes,
    )

Key differences from CtKernel

AspectCtKernel (cuTile)CuteKernel (CuTe DSL)
Launch mechanismgrid_fn + args_fn + cuTile compilerlaunch_fn closure wrapping @cute.jit host
CompilationcuTile bytecode + MLIRCuTe DSL JIT (cached automatically)
Autotuningautotune_launch() from cuda.tile_experimentaltriton.testing.do_bench_cudagraph per config
Grid setupgrid_fn(cfg) -> (x, y, z)Inside launch_fn / host function
TMA descriptorsImplicit (cuTile handles)Explicit setup in host function

Autotuning

CuteKernel iterates over autotune_configs, benchmarks each via do_bench_cudagraph, and selects the fastest. Failed configs are caught and skipped.

Compile

CuTe DSL JIT caches artifacts automatically. The compile() method creates the output directory but does not extract explicit artifacts (can be extended per-kernel).

Tiling Dataclass Guidance

CuTe DSL tilings typically include fields that cuTile tilings do not:

@dataclass
class Tiling:
    # Standard tile dimensions
    tile_m: int
    tile_n: int
    tile_k: int

    # CuTe DSL-specific fields
    num_warpgroups: int          # Warpgroups per CTA (typically 2-4)
    num_pipeline_stages: int     # Async copy pipeline depth
    num_tma_buffers: int         # TMA double/triple buffering
    cluster_m: int = 1           # Cluster shape (M dimension)
    cluster_n: int = 1           # Cluster shape (N dimension)

    def validate(self, pd) -> bool:
        # Validate against problem dimensions and device limits
        ...

The exact fields depend on the kernel design. The validate method should check that tile dimensions divide evenly into problem dimensions and that resource usage (registers, SMEM) stays within device limits.

Architecture Compatibility Check

Kernels may target architecture-specific instructions that require a specific SM version. The "Blackwell" marketing name spans multiple SM versions with different instruction sets:

  • SM100 (B200, B300) — datacenter GPUs, supports tcgen05 MMA, TMEM, full cluster features
  • SM120 (GeForce RTX 5090, RTX 5080) — consumer Blackwell, uses sm_120a, does not support tcgen05 ops

A kernel using tcgen05 ops requires SM100 and will not run on an RTX 5090 (SM120) despite both being "Blackwell".

Before running, compiling, or profiling a CuTe DSL kernel, always verify the available device:

nvidia-smi --query-gpu=name --format=csv,noheader

Then match the GPU name to its SM version. If the kernel's target SM version does not match, skip the run/profiling step. Do not attempt execution — it will either fail at compile time or produce misleading results. Record the architecture requirement in the kernel's devlog and note the skip.

Common Pitfalls

  • Never hallucinate CuTe DSL APIs -- verify against the /cute-dsl-ref skill, docs/cute-dsl/ documentation, or CUTLASS example kernels
  • @cute.kernel function name MUST match the module filename (same rule as cuTile)
  • TMA descriptor setup is host-side only -- do not attempt TMA operations inside @cute.kernel without proper @cute.jit host setup
  • Register budget: 255 max/thread, validate against the active device's SM limits via docs/devices/ and src/mla_var3/conf/devices.json
  • Shared memory varies by SM version: SM100 (B200/B300): up to 228 KB/SM, 227 KB/block opt-in; SM120 (RTX 5090): 96 KB -- do not assume "Blackwell" means datacenter SMEM limits
  • Pipeline stage count affects SMEM usage (each stage needs its own buffer) -- validate total SMEM before increasing stages
  • Barrier synchronization errors are silent and cause incorrect results, not crashes -- always test with --check
  • Cluster programming requires the launch to use cluster-compatible grid dimensions

Reference Resources

  • API reference: Load /cute-dsl-ref for the core API table, execution model, and architecture operations
  • Official documentation: docs/cute-dsl/ (CuTe Python DSL) and docs/cutlass-cpp/cute/ (CuTe C++ concepts)
  • Example kernels and learning paths: Load /learn-cute-dsl for a categorized index of CUTLASS example kernels

Knowledge Links

  • Shared optimization knowledge: docs/knowledge/optimizations/
  • Shared anti-patterns: docs/knowledge/anti-patterns/
  • CuTe Python DSL overlays: docs/knowledge/languages/cute-dsl/

Development Log Entry

Use docs/kernels/<kernel>.md and record the implementation location using the Python package path form:

src/mla_var3/kernel/cute_python/mla/<kernel>/<kernel>[_vN]/

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.17%
按下载量换算64

Claude

28.68%
按下载量换算52

Cursor

19.78%
按下载量换算36

Gemini CLI

9.66%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills