Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/mindspore-ai/akg --skill adaptive-evolve명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? 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 | adaptive-evolve |
| description | 自适应进化工作流,使用进化算法进行多轮迭代优化 |
| category | workflow |
| version | 1.2.0 |
| license | MIT |
| structure | {"child_skills":["designer-agent","coder-agent","verifier-agent"],"default_children":["designer-agent","coder-agent"],"exclusive_groups":[["coder-iterative","coder-aggressive"]]} |
自适应进化工作流使用进化算法(Evolutionary Algorithm)进行算子优化,适合复杂的融合算子和性能关键的场景。
Designer → 生成N个设计方案
↓
Coder → 编码为可执行代码(并发)
↓
Verifier → 评估适应度
↓
选择 → 保留前K个优秀个体
↓
变异 → 生成新候选
↓
[循环多轮] → 直到性能达标或迭代上限
population_size: 种群大小(默认:10)generations: 迭代代数(默认:20)elite_size: 精英数量(默认:2)selection_method: tournament, roulette, rankmutation_rate: 变异概率(默认:0.3)crossover_rate: 交叉概率(默认:0.7)failure_threshold: 失败阈值,触发策略切换(默认:3)adaptive_population: 动态调整种群大小early_stopping: 提前停止条件| 算子类型 | Standard | Adaptive-Evolve | 提升 |
|---|---|---|---|
| 简单MatMul | 5s | 60s | 10% |
| 融合算子 | 10s | 90s | 45% |
| 复杂Kernel | 20s | 180s | 80% |
结论: 复杂场景下,额外时间投入带来显著性能提升。
# 初始种群生成
designs = designer.generate_initial_population(
size=population_size,
task_desc=task_description
)
# 变异操作
new_designs = designer.mutate(
parent_designs=elite_designs,
mutation_rate=0.3
)
# 并发编码
codes = await asyncio.gather(*[
coder.encode(design)
for design in designs
])
# 适应度函数
fitness = verifier.evaluate(
code=code,
metrics=['accuracy', 'latency', 'memory']
)
fitness_score = 0.4*accuracy + 0.4*(1/latency) + 0.2*(1/memory)
# 记录每代最优个体
history = {
'generation': [],
'best_fitness': [],
'avg_fitness': []
}
# 绘制进化曲线
plot_evolution_curve(history)
# 失败个体分析
failed_designs = [d for d in designs if d.fitness < threshold]
analyze_failure_patterns(failed_designs)