Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

design-cutile-dsl-kernel设计 cutile dsl 内核

Agent Skill

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

总安装

544

周安装

22

GitHub Stars

公开资料未说明

下载量

171
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

专为cuTile Python DSL设计的运行时模式指导工具。

  • 适用于tile尺寸选择和张量布局优化等高级场景。
  • 提供CTA重映射和工作分区等专业控制功能。
  • 支持编译器引导和性能调优参数配置。design-cutile-dsl-kernel 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 需先加载/design-kernel获取基础架构支持。

SKILL.md

cuTile Python DSL — Language-Specific Guidance

Prerequisite: Load /design-kernel for shared naming, versioning, KernelPlan structure, composition patterns, clone workflow, devlog template, and designer output contract. This skill covers only cuTile-specific runtime patterns and constraints.

When To Use cuTile Python DSL

Stay in cuTile Python DSL (cutile-dsl) when the next optimization is still expressible through:

  • tile sizes and tensor layout choices,
  • CTA remapping and work partitioning via ct.bid() / ct.num_blocks(),
  • occupancy and cluster-size hints (num_ctas, occupancy),
  • compiler guidance such as latency / allow_tma hints,
  • multi-stage composition through KernelPipeline / ConcurrentKernels.

Suitability Gate

Do not expect cuTile to express explicit intra-CTA scheduling. The public execution model does not expose thread, warp, or warpgroup identity, and does not allow explicit synchronization or communication within a block. Likewise, num_ctas does not give you a public cluster programming model: there is no exposed cluster rank, cluster barrier, DSM primitive, or cluster memory scope.

This becomes a hard design constraint when profiling shows the kernel is pinned to one CTA per SM. In that regime, the usual recovery path in state-of-the-art kernels is explicit scheduling inside the CTA: warpgroup seesaw schedules, producer/consumer pipelines, barrier choreography, or cluster-cooperative overlap. If the optimization you need falls in that category, stop iterating inside cuTile and switch to CuTe DSL (/design-cute-dsl-kernel).

The FlashMLA devlog (docs/kernels/flash-mla.md) is the concrete example: the official FlashMLA design remains productive at one resident block per SM because it uses explicit scheduling; cuTile FlashMLA versions cannot reproduce that behavior.

Naming And Layout

  • Public language key: cutile-dsl
  • Python package path: cutile
  • Kernel layout: src/mla_var3/kernel/cutile/<layer>/<design>/<design>[_vN]/
  • Module file: <design>[_vN].py
  • Main runtime wrapper: CtKernel

CtKernel Runtime Pattern

CtKernel(Kernel) wraps cuTile kernels with grid_fn and args_fn callables:

from mla_var3.runtime import CtKernel, KernelPlan, Tiling, ConstInt, ConstBool

@ct.kernel
def my_kernel(Tensor, ..., Bm: ConstInt, Bn: ConstInt, EVEN_N: ConstBool):
  bid_x = ct.bid(0)
  # block-level operations: ct.load, ct.mma, ct.store, ct.reshape, ...

@dataclass
class CtMyKernel(KernelPlan):
  b: int = 64; s: int = 1; t: int = 4096
  tiling: MyTiling = field(default_factory=MyTiling)

  def plan(self, *inputs) -> CtKernel:
    Out = torch.empty_like(inputs[0])

    def grid_fn(cfg):
      return (math.ceil(s / cfg.Bm), math.ceil(h / cfg.Bh), b)

    def args_fn(cfg):
      return (inputs[0], Out, cfg.Bm, cfg.Bn, (t % cfg.Bn) == 0)

    return CtKernel(
      input_tensors=inputs,
      output_tensors=(Out,),
      kernel_fn=my_kernel,
      grid_fn=grid_fn,
      args_fn=args_fn,
      tiling=self.tiling,
      autotune_configs=self._autotune_configs(),
      algorithmic_flops_bytes_fn=self._algorithmic_flops_bytes,
    )

Key fields on CtKernel:

FieldTypePurpose
kernel_fn@ct.kernel functionThe cuTile kernel function
grid_fnCallable[[Tiling], tuple]Maps tiling config to 3D grid dimensions
args_fnCallable[[Tiling], tuple]Maps tiling config to kernel arguments
input_tensorstuple[torch.Tensor]For autotuning cache key
output_tensorstuple[torch.Tensor]Returned by __call__
tilingTilingCurrent tiling config
autotune_configslist[Tiling]Search space for autotuning
algorithmic_flops_bytes_fnCallableFor roofline analysis

Autotuning

CtKernel autotuning uses autotune_launch() from cuda.tile_experimental, which handles occupancy/num_ctas hints automatically. The _apply_hints() method re-applies hints after tuning.

Compilation

CtKernel.compile() uses compile_tile() to emit .bytecode and optionally translates to .mlir via cuda-tile-translate.

Tiling Dataclass

cuTile tilings typically include tile dimensions plus optional compiler hints:

@dataclass
class MyTiling(Tiling):
  Bm: int = 16       # query tile size
  Bn: int = 64       # KV tile size
  Bh: int = 8        # heads per block
  num_ctas: int = None   # CGA size (None = auto)
  occupancy: int = None  # occupancy hint (None = auto)

  def validate(self, pd: "CtMyKernel") -> bool:
    return self.Bm <= pd.s and self.Bn <= pd.t and self.Bh <= pd.h

cuTile Constant Types

from mla_var3.runtime import ConstInt, ConstBool, ConstFloat, INV_LOG_2
  • ConstInt = ct.Constant[int] — compile-time integer
  • ConstBool = ct.Constant[bool] — compile-time boolean
  • ConstFloat = ct.Constant[float] — compile-time float

Common Pitfalls

  • Never hallucinate cuTile APIs — always verify with /cutile-dsl-ref or the official docs
  • @ct.kernel function name MUST match the module filename
  • Register budget: 255 max/thread, aim <128 for good occupancy (validate against the active device's SM limits via docs/devices/ and src/mla_var3/conf/devices.json)
  • Shared memory: 48KB/block default, 99KB opt-in, 100KB/SM total
  • When reducing tile sizes for occupancy, verify compute efficiency doesn't degrade
  • Do not assume num_ctas unlocks explicit cluster-cooperative algorithms; in cuTile it is a hint, not a cluster programming interface
  • If NCU shows one CTA per SM, low eligible warps, and the missing fix is explicit warpgroup or barrier scheduling, further cuTile-only tuning is unlikely to close the gap

Knowledge Links

  • Shared optimization knowledge: docs/knowledge/optimizations/
  • Shared anti-patterns: docs/knowledge/anti-patterns/
  • cuTile-specific optimization overlays: docs/knowledge/languages/cutile-dsl/
  • cuTile-specific optimization catalog: load /optimization-catalog-cutile-dsl

References

  • Runtime API details: See the /design-kernel skill's runtime-api reference for the complete CtKernel API documentation
  • Kernel templates: See the /design-kernel skill's kernel-templates reference for copyable template code
  • FlashMLA scheduling limit: See docs/kernels/flash-mla.md for the diagnosis comparing cuTile FlashMLA with the official explicitly scheduled implementation

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.2%
按下载量换算64

Claude

28.58%
按下载量换算49

Cursor

18.74%
按下载量换算32

Gemini CLI

9.94%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills