kernel-verifier

kernel-verifier is a skill for Claude Code, OpenCode from mindspore-ai/akg. It costs 88 tokens per session (1,204 once invoked), scanned A, original, Apache-2.0.

A verification tool for generated computational-operator code. It first checks the code without running expensive tests, then compares its outputs with the framework implementation.

In plain words
What is it for?
It performs static checks and precision comparisons for operator code using PyTorch or MindSpore on CUDA, Ascend, or CPU backends.
Why use it?
It catches syntax, compilation, import, and DSL-usage problems early, reducing wasted verification runs and identifying incorrect results afterward.

Skill for Claude CodeOpenCode

Written for Claude Code and OpenCode: argument-hint in frontmatter, but also installed under .opencode/.

Good fit It performs static checks and precision comparisons for operator code using PyTorch or MindSpore on CUDA, Ascend, or CPU backends.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mindspore-ai/akg/kernel-verifier
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.

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

Made for: Claude Code, OpenCode.

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 kernel-verifier

README.md
[![agentmods](https://agentmods.dev/badge/skills/mindspore-ai/akg/kernel-verifier/github.svg)](https://agentmods.dev/skills/mindspore-ai/akg/kernel-verifier)
Your own site
<a href="https://agentmods.dev/skills/mindspore-ai/akg/kernel-verifier"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/kernel-verifier/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kernel-verifier

Your own site · 80×15
<a href="https://agentmods.dev/skills/mindspore-ai/akg/kernel-verifier"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/kernel-verifier.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,204 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00088 $0.01204
Opus 5 $0.00044 $0.00602
Sonnet 5 $0.00018 $0.00241
Haiku 4.5 $0.00009 $0.00120

Measured 9d ago against content hash 599c4d994306, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

kernel-verifier 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 9d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/code_check.py, scripts/verify.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/workspace/.opencode/skills/kernel-verifier/SKILL.md · 104 lines

How it starts

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

Kernel Verifier Skill

验证流程

Step 1 静态代码检查 ├─ 失败 → 结束 └─ 成功 → Step 2 创建验证项目 → Step 3 执行精度验证 → Step 4 收集结果

本 skill 加载后,<base_url> 标签提供 skill 目录路径(记为 $SD)。所有验证相关脚本路径基于 $SD/scripts/

Step 1: 静态代码检查(快速预检)

在创建验证项目前,先对生成代码进行静态检查,快速拦截明显错误,避免浪费验证资源。

使用 bash 工具调用本 skill 的 scripts/code_check.py(使用命令模板包裹):

python3 $SD/scripts/code_check.py \
    --code_file <生成代码文件路径> \
    --backend <backend> \
    --dsl <dsl>
参数 必填 说明
--code_file 待检查的代码文件路径
--backend 后端(cuda / ascend / cpu
--dsl DSL(如 triton_cudatriton_ascend,triton 系列会做 DSL 合规性检测)

检查内容(纯静态分析,不调用 LLM,零额外成本):

检查项 说明
语法检查 ast.parse 检测括号不匹配、缩进错误、关键字拼写等
编译检查 py_compile 捕获额外编译问题
import 可用性 检测代码中引用的模块是否在当前环境可用
中文文本混入 检测代码 token 中连续 ≥3 汉字(注释和字符串除外)
DSL 合规性 仅 triton 系列:检测是否定义了 @triton.jit kernel、是否通过 kernel[grid](...) 调用、forward() 是否使用了 torch 高层 API 替代 kernel

路由决策

结果 判断 动作
通过 stdout 包含 "静态检查通过",退出码 0 继续 Step 2
失败 stdout 输出检查报告,退出码 1 不进入 Step 2,将报告作为 verifier_error 反馈给代码生成步骤

Step 2: 创建验证项目

在验证目录(如 {output-path}/logs/iteration_{n}/verify/)下创建两个文件:

  • {op_name}_{framework}.py:复制任务文件完整内容(包含 Model, get_inputs, get_init_inputs
  • {op_name}_{dsl}_impl.py:复制生成代码完整内容(包含 ModelNew

Step 3: 执行精度验证

必须使用 bash 工具调用本 skill 的 scripts/verify.py(使用命令模板包裹):

python3 $SD/scripts/verify.py \
    --op_name <算子名> \
    --dsl <dsl> \
    --backend <backend> \
    --framework <framework> \
    --device_id <device_id> \
    --verify_dir <验证目录> \
    --timeout 300
参数 必填 说明
--op_name 算子名称
--dsl DSL(如 triton_cudatriton_ascend
--backend 后端(cuda / ascend / cpu
--framework 框架(默认 torch
--device_id 设备 ID(默认 0-1 自动选择)
--verify_dir 验证目录(默认当前目录)
--timeout 超时秒数(默认 300)

Read the full file on GitHub · 104 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 104 lines · 88 tokens per session scan A 599c4d994306

Subscribe to this mod's changes

kernel-verifier is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 88 tokens to every session and 1,204 once invoked, about $0.0004 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-09-03.