adaptive-evolve

adaptive-evolve is a skill for Claude Code, Codex from mindspore-ai/akg. It costs 23 tokens per session (1,512 once invoked), scanned A, original, Apache-2.0.

An iterative optimization workflow that creates many code candidates, tests them, keeps the better ones, and produces new variations. An evolutionary algorithm is a search method inspired by selection and mutation.

In plain words
What is it for?
Use it to optimize fused operations, performance-critical GPU code, and designs with several competing constraints through repeated testing.
Why use it?
It helps explore large or complicated design choices when a single implementation is unlikely to be the best one.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mindspore-ai/akg/adaptive-evolve
Any agent
npx skills add mindspore-ai/akg --skill adaptive-evolve
Clone the repo
git clone --depth 1 https://github.com/mindspore-ai/akg

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for adaptive-evolve

README.md
[![agentmods](https://agentmods.dev/badge/skills/mindspore-ai/akg/adaptive-evolve.svg)](https://agentmods.dev/skills/mindspore-ai/akg/adaptive-evolve)
Your own site
<a href="https://agentmods.dev/skills/mindspore-ai/akg/adaptive-evolve"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/adaptive-evolve.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,512 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01512
Opus 5 $0.00012 $0.00756
Sonnet 5 $0.00005 $0.00302
Haiku 4.5 $0.00002 $0.00151

Measured 6d ago against content hash 1a397a6b9f90, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

adaptive-evolve scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

akg_agents/examples/run_skill/skills/adaptive-evolve/SKILL.md · 196 lines

How it starts

The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.

自适应进化工作流

概述

自适应进化工作流使用进化算法(Evolutionary Algorithm)进行算子优化,适合复杂的融合算子和性能关键的场景。

核心原理

进化策略

  1. 种群初始化: Designer生成多个候选设计
  2. 个体编码: Coder将设计转换为可执行代码
  3. 适应度评估: Verifier评估性能和正确性
  4. 选择与变异: 保留优秀个体,产生新变种
  5. 迭代优化: 多轮进化直到收敛

自适应机制

  • 根据失败次数自动调整策略
  • 动态切换编码风格(iterative ↔ aggressive)
  • 智能调整种群大小

算法流程

Designer → 生成N个设计方案
    ↓
Coder → 编码为可执行代码(并发)
    ↓
Verifier → 评估适应度
    ↓
选择 → 保留前K个优秀个体
    ↓
变异 → 生成新候选
    ↓
[循环多轮] → 直到性能达标或迭代上限

配置参数

种群参数

  • population_size: 种群大小(默认:10)
  • generations: 迭代代数(默认:20)
  • elite_size: 精英数量(默认:2)

选择策略

  • selection_method: tournament, roulette, rank
  • mutation_rate: 变异概率(默认:0.3)
  • crossover_rate: 交叉概率(默认:0.7)

自适应策略

  • failure_threshold: 失败阈值,触发策略切换(默认:3)
  • adaptive_population: 动态调整种群大小
  • early_stopping: 提前停止条件

适用场景

✅ 推荐使用

  1. 融合算子: MatMul+ReLU+Bias等
  2. 性能敏感: 需要极致优化
  3. 复杂约束: 多维度优化目标
  4. 探索空间大: 设计空间广阔

❌ 不推荐使用

  1. 简单算子: 直接用standard-workflow更快
  2. 时间受限: 进化需要较长时间
  3. 确定性需求: 结果有随机性

性能对比

算子类型 Standard Adaptive-Evolve 提升
简单MatMul 5s 60s 10%
融合算子 10s 90s 45%
复杂Kernel 20s 180s 80%

结论: 复杂场景下,额外时间投入带来显著性能提升。

实现细节

Designer策略

# 初始种群生成
designs = designer.generate_initial_population(
    size=population_size,
    task_desc=task_description
)

# 变异操作
new_designs = designer.mutate(
    parent_designs=elite_designs,
    mutation_rate=0.3
)

Coder并发

# 并发编码
codes = await asyncio.gather(*[
    coder.encode(design) 
    for design in designs
])

Verifier评估

# 适应度函数
fitness = verifier.evaluate(
    code=code,
    metrics=['accuracy', 'latency', 'memory']
)
fitness_score = 0.4*accuracy + 0.4*(1/latency) + 0.2*(1/memory)

成功案例

案例1: Flash Attention优化

  • baseline: 标准实现 5.2ms
  • evolved: 进化20代后 3.1ms (40%提升)
  • 迭代: 12代收敛

案例2: 融合Conv+BN+ReLU

  • baseline: 三个独立算子 8.5ms
  • evolved: 融合优化 4.2ms (51%提升)
  • 迭代: 18代收敛

Read the full file on GitHub · 196 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 196 lines · 23 tokens per session scan A 1a397a6b9f90

Subscribe to this mod's changes

adaptive-evolve is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 26d ago), licensed Apache-2.0. It adds 23 tokens to every session and 1,512 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

development

开发语言能力索引。Python、Go、Rust、TypeScript、Java、C++、Shell。当用户提到编程、开发、代码、语言时路由到此。.

fengshao1227/ccg-workflow · 41 tokens

tencent-docs

腾讯文档(docs.qq.com)-在线云文档平台,是创建、编辑、管理文档的首选 skill。涉及"新建/创建/编辑/读取/查看/搜索文档"、"保存文件"、"云文档"、"腾讯文档"、"docs.qq.com"等操作,请优先使用本 skill。支持能力:(1) 创建各类在线文档(文档/Word/Excel/幻灯片/思维导图/流程图/智能表格/收集表)(2) 管理知识库空间(创建空间、查询空间列表)(3) 管理空间节点、文件夹结构 (4) 读取/搜索文档内容 (5) 编辑操作智能表 (6) 编辑操作在线文档 (7) 文件管理(重命名、移动、删除、复制、导入导出)(8) 网页剪藏、本地文件/文档上云。.

UnicomAI/wanwu · 209 tokens

post-build-flow

Handles workflow verification and setup after build-workflow succeeds, or when the message contains workflow-verification-follow-up or workflow-setup-required. Load after direct builds, when verificationReadiness requires action, or on orchestrator verify/setup follow-up turns.

n8n-io/n8n · 53 tokens

n8n:human-like-code-review

Reviews a GitHub pull request like a thoughtful human reviewer and writes the feedback to a markdown file. Prioritizes context, architecture fit, solution complexity, bugs, security edge cases, and missing tests. Use when given a PR URL to review, or when the user says /human-like-code-review.

n8n-io/n8n · 70 tokens

wechat-article-pro

微信公众号文章发布专业版。功能:1)联网搜索热点信息 2)AI生成微信公众号封面图 3)撰写3000-5000字深度文章 4)使用公众号AI配图功能自动生成并上传封面 5)参考刘润公众号风格写作 6)自动排版 7)不加话题标签.

UnicomAI/wanwu · 83 tokens