Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/mindspore-ai/akg --skill hint-mode명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
矩阵乘法矩阵乘法 A[M, K] @ B[K, N] = C[M, N]中,大K维度矩阵乘法(K>>M,N)优化:针对M/N较小但K极大(如M=N=256,K=131072)的场景,Split-K切分K维度并行化、Workspace+Reduce替代全局同步,实现显著性能提升
Triton Ascend hard API restrictions and forbidden syntax. MUST-follow rules that apply to every kernel: forbidden control flow (return/break/continue/lambda/while), tensor slice/index restrictions, scalar conversion rules, BLOCK_SIZE upper bound. Violating any of these produces a compile or runtime error on Ascend.
Triton Ascend 性能优化通用策略: BLOCK_SIZE 选择 (1024-2048 for elementwise, must be <65536), grid configuration (use VEC_CORE_NUM / CUBE_CORE_NUM, 2D/3D grid for matmul / conv / reduce, 1D grid + inner loop for elementwise / pointwise), 256B alignment for memory transfers, autotune block-size patterns, fp16 / fp32 precision conversion. Bind via keywords like matmul, elementwise, reduce, block_size, grid, autotune, alignment, fp16, fp32, tile, interleaved-loop, cube-core, vec-core.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | hint-mode |
| description | Sketch 设计中 Hint 模式参数空间配置指南,用于从任务描述中提取参数范围并生成可调优的参数空间配置 |
| category | guide |
| version | 1.0.0 |
| metadata | {"role":"designer"} |
Hint 模式用于从任务描述中识别参数范围约束,生成参数空间配置(space_config),支持后续的自动调优。
# @hint: param in [val1, val2, ...] → type='choice', values=[...]
# @hint: param in range(min, max, step=N) → type='range', min=..., max=..., step=...
# @hint: param = value → type='fixed', value=...
# @hint: param in pow2(min_pow, max_pow) → type='power_of_2', min_pow=..., max_pow=...
# @hint: param in pow of 2 → type='power_of_2'
# @range_hint("param", start=min, end=max) → type='range', min=..., max=...
# @elemwise_hint("param", [val1, val2]) → type='choice', values=[...]
# @elem_hint("param", [val1, val2]) → type='choice', values=[...]
# @hint: batch_size in pow of 2 → {'type': 'power_of_2', 'min_pow': 3, 'max_pow': 6} # [8, 16, 32, 64]
# @hint: dim in range(16, 65536) → {'type': 'range', 'min': 16, 'max': 65536, 'step': 1}
# @hint: BLOCK_M in [64, 128, 256] → {'type': 'choice', 'values': [64, 128, 256]}
# @range_hint),都应识别并提取@range_hint("param", st=8, ed=64))→ 提取括号内信息# @hint: param in range(16, 65536))→ 提取冒号后声明SPACE_CONFIG 字典格式"""参数空间配置"""
import torch # 或 import mindspore as ms
# ===== 参数空间定义 =====
SPACE_CONFIG = {
'param1': {'type': 'choice', 'values': [val1, val2, ...]},
'param2': {'type': 'range', 'min': min_val, 'max': max_val, 'step': step_val},
'param3': {'type': 'power_of_2', 'min_pow': min_exp, 'max_pow': max_exp},
# ... 根据 hint 提取的所有参数
}
# ===== 元信息 =====
META_INFO = {
'op_name': 'op_name',
'framework': 'torch', # 或 'mindspore'
'param_names': ['param1', 'param2', ...] # 参数名列表,保持顺序!
}
# ===== 输入构造函数 =====
def create_inputs(param1, param2, ...):
"""
根据参数生成输入
参数顺序必须与 META_INFO['param_names'] 一致
"""
...
return [tensor1, tensor2, ...]
# ===== 初始化输入函数(可选)=====
def get_init_inputs():
"""如果原始代码有此函数,完整复制"""
return [] # 或 ["auto"]
使用 mask,支持任意 shapeM % 64 == 0(不使用 mask)在草图中必须添加"设计适用范围"注释:
# 设计适用范围:
# - 参数范围:M in [128, 2048], N in [128, 4096]
# - 边界处理:使用 mask / 不使用 mask(需整除)
# - BLOCK_SIZE 配置:[64, 128, 256]
# - 约束条件:如不使用 mask,M % 64 == 0
重要: