Benchmarks single operator latency on Ascend NPU by detecting CANN version, torch_npu environment, and running user-provided or generated demo scripts. Does not install or fix environments.
Ships in npu-op-benchmark. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
这个 Skill 用于在昇腾 NPU 环境中对单个算子做可复现的延迟测试。
无 时,再按 cann 检索常见路径并判断当前版本布局:
CANN < 8.5 常见路径:/usr/local/Ascend/ascend-toolkit/latestCANN >= 8.5 常见路径:/usr/local/Ascend/cann/latestconda 环境名 和 docker 容器名 都是 无,则先查 conda 候选环境;用户不接受 conda 时再查容器候选环境。demo 方案 只接受两种值:我生成 或 我提供。如果使用者选择 我提供,优先使用使用者提供的 demo 或算子补充信息。assets/config_template.yaml、scripts/bench_repeat_interleave.py 和 scripts/bench_op.py 中 repeat_interleave 相关内容只是示例,不代表这个 Skill 只支持测试 repeat_interleave。torch 和 torch_npu,不要重复安装。torch_npu 不可用、或算子执行报环境错误,立即停止,不修环境;直接要求使用者提供新的可用环境。返回内容至少包括:
CANN 版本torch 版本torch_npu 版本测试环境环境名称(conda 名或容器名)测试方法目标算子tensor shapedemo 代码性能数据如果环境不满足或算子执行失败,统一按下面模板返回:
环境不满足,已停止当前测试。请提供新的可用环境。
torch 版本:
<torch_version 或 unknown>
torch_npu 版本:
<torch_npu_version 或 unknown>
当前引用的 CANN 版本:
<根据用户提供目录或常见路径判断出的版本;若无法确定则写 unknown,并附 `latest` 布局和候选目录信息>
demo.py 内容:
<实际执行的 demo 代码;优先使用使用者提供的 demo,否则使用 AI 生成的 demo>
input/output tensor shape:
<实际测试使用的输入 shape,以及必要时的输出 shape>
执行失败报错:
<原始错误摘要或关键报错>
scripts/cann_detect.shscripts/find_docker_cann.shscripts/bench_op.pyscripts/bench_repeat_interleave.py更多说明见:
assets/config_template.yaml (opens in a new tab)references/cann.md (opens in a new tab)references/conda.md (opens in a new tab)references/docker.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/usage.md (opens in a new tab)scripts/bench_op.py (opens in a new tab)scripts/bench_repeat_interleave.py (opens in a new tab)scripts/cann_detect.sh (opens in a new tab)scripts/find_docker_cann.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/npu-op-benchmark:npu-op-benchmarkfrom npu-op-benchmark
npx claudepluginhub ascend-ai-coding/awesome-ascend-skills --plugin npu-op-benchmarkOther plugins' skills for the same job