skills/ascendc/case-simplifier/SKILL.md
测试用例精简专家 Skill。读取 `{output_dir}` 中与算子对应的 `.json` 文件, 对其中的输入 cases(JSON Lines 格式,每行一个 `{"inputs": [...]}` 对象)进行精简, 使 case 数量尽量不超过 10 个,同时保证覆盖度。
npx skillsauth add Just-it/AscendOpGenAgent case-simplifierInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
你是一名测试用例精简专家。你的目标是读取 {output_dir} 中与算子对应的 .json 文件,对其中的输入 cases 进行精简,使 case 数量尽量不超过 10 个,同时保证覆盖度。
.json 文件路径当前 benchmark 结构下,测试用例存储在 .json 文件中(与 model.py 配套),并应在 Phase 1 被复制到 {output_dir}/ 目录中。按以下优先级确定要处理的 .json 文件:
{output_dir}/model.py,分析 get_input_groups() 函数中引用的 .json 文件名(例如 os.path.join(os.path.dirname(__file__), "xxx.json")),据此在 {output_dir} 内确定目标 .json 文件。由于 model.py 的 __file__ 解析为 model.py,get_input_groups() 通常查找的是 model.json,因此目标文件为 {output_dir}/model.json。model.py 中没有显式引用,则直接查找 {output_dir} 目录下因 Phase 1 复制而存在的 .json 文件(排除 .json.bak)作为目标。优先使用 {output_dir}/model.json(model.py 按 __file__ 查找同名 .json),同时保留 <op_name>.json 作为原始备份。如果找不到有效的 .json 文件,报错并停止。
.json 文件,不要修改 {output_dir}/model.py 中的任何内容。{output_dir}/ 目录中的文件,不要改动其他目录中的文件。在精简前,务必将目标 .json 文件备份为同名的 .json.bak(例如 model.json.bak),以便后续全量验证时恢复。如果 <op_name>.json 是独立文件(非 model.json),也需一并备份。
精简后的 cases 必须满足以下覆盖要求,按优先级从高到低:
type: "attr" 的输入,覆盖其在原 cases 中出现的不同取值类别(例如 bool 型的 True/False、正数/负数/零等边界值)。如果原始 attr 值变化很多,不要求每个值都保留,但要保留具有代表性的边界值。.json 文件:该文件为 JSON Lines 格式,每行是一个独立的 JSON 对象,结构通常为 {"inputs": [...]}。逐行解析,提取所有 case。.json 文件:将筛选后的 case 以 JSON Lines 格式写回原 .json 文件(每行一个 json.dumps(...) 对象,保持与原始格式一致),保持 model.py 不变。tools
多 Case 专用 Kernel 分裂 Skill — 在泛用 Kernel 优化完成后,针对不同 Shape/Case 特征 生成专用 Kernel,构建智能调度器,实现性能最大化。失败自动回退到泛用 Kernel。
tools
擅长在 Ascend NPU 平台上编写高效 Triton 算子的性能优化专家。 按照严格的顺序逐步优化 Triton 代码,每次只尝试一个优化点, 确保优化前后功能一致、精度一致。 ⚠️ 只能使用本 skill 规定的优化方式,禁止使用任何超出本 skill 之外的优化方式。
testing
算子代码验证 Skill — 按照标准验证流程验证生成的内核代码。 创建验证项目文件,调用 scripts/verify.py 运行验证,验证通过后 调用 scripts/benchmark.py 进行性能测试并收集结果。
tools
Triton Ascend 算子代码生成 Skill — 根据 KernelBench 格式任务描述生成高性能 Triton Ascend 内核代码。支持首次生成和基于错误反馈的迭代优化。