Skip to content

Ascend/msagent / skills/accuracy/compare-result-analyzer

compare-result-analyzer

Unverified

分析 msProbe compare 精度比对结果文件(CSV/XLSX),定位整网精度问题与数值差异。支持统计量模式,输出分析报告。支持辅助信息协助定位:辅助信息(历史结论/已知根因/已排除算子/嫌疑区域等)建议在请求中附带(不依赖交互工具)。若请求中未附带且运行环境无 AskUserQuestion,则跳过辅助信息收集、照常完成分析,报告中省略辅助信息章节并注明原因。

assets/summary_report_template.md

View on GitHub
# msProbe 精度比对综合分析总结报告

> **用途**: 本文件为 compare-result-analyzer skill 的综合分析总结报告模板。在 Step 8 单算子验证完成后,将分析报告与验证报告的核心结论整合为一份精简报告:对可疑候选的验证结果进行交叉呈现,给出最终结论与建议。
>
> **定位**: 独立文件,不替代分析报告和验证报告。后两者作为引用参考。

---

**比对文件**: `<比对结果文件路径>`
**分析报告**: `<分析报告路径>`
**验证报告**: `<验证报告路径,如无则写 "无">`
**总结时间**: `<YYYY-MM-DD HH:MM:SS>`

**核心术语**:

| 术语 | 含义 |
|------|------|
| **NRE**(归一化相对误差) | = L2 diff / Bench l2norm(原始比率,转百分比时 ×100)。主判定指标,≥ 阈值判"不可忽略" |
| **MeanBias**(整体均值偏移) | = \|Mean diff\| / Bench l2norm。NRE 未超标时的补充判定指标(α × 阈值,α=1.2) |
| **误差引入点** | 传播形态:算子**引入**新误差(干净输入 → 脏输出),精度问题引入点,优先排查 |
| **误差放大点** | 传播形态:算子**放大**上游已有误差(脏输入 → 更脏输出) |

> 详细分类判定规则见分析报告 §5 传播跳变分析。

---

## 一、结论与建议

> ⚠️ **结论性质**:本 skill 仅提供分析与建议,**不产出"已确认根因"**。下列候选均为嫌疑,仅按嫌疑优先级(高/中/低)排序;最终根因需人工结合本报告、代码与补充验证实锤。唯一可确认的是「已排除」——单算子验证通过可确认某算子实现一致、排除嫌疑。

### 待排查节点(嫌疑候选,按优先级)

> **排序规则**:先按嫌疑优先级分组(高 → 中 → 低),**同一优先级内按起始行号升序排列**。

| 序号 | 优先级 | 行号范围 | 算子 | NRE% | 嫌疑依据 | 建议 |
|------|--------|----------|------|------|----------|------|
| 1 | 高 | `<起始行~结束行>` | `<算子>` | `<值>` | `<为何选中 / 验证情况>` | `<排查建议>` |
| 2 | 高 | `<起始行~结束行>` | `<算子>` | `<值>` | `<为何选中 / 验证情况>` | `<排查建议>` |
| 3 | 中 | `<起始行~结束行>` | `<算子>` | `<值>` | `<为何选中 / 验证情况>` | `<排查建议>` |
| 4 | 低 | `<起始行~结束行>` | `<算子>` | `<值>` | `<为何选中 / 验证情况>` | `<排查建议>` |

> 同一优先级内的多条记录按起始行号升序排列(高优先级示例:行号小者在前)。

### 已排除节点(验证通过,可确认排除)

| 序号 | 行号范围 | 算子 | NRE% | 排除方式 | 说明 |
|------|----------|------|------|----------|------|
| 1 | `<起始行~结束行>` | `<算子>` | `<值>` | 单算子验证通过 | CPU vs NPU 一致,排除嫌疑 |

### 后续行动建议

1. **① 最高嫌疑候选排查**:`<建议>`
2. **② 其余嫌疑候选跟进**:`<建议>`
3. **③ 数据质量问题**:`<如有形状不一致等数据问题,说明影响>`
4. **④ 下一轮分析建议**:`<建议补充的数据或调整方向>`

---

## 二、详细发现:可疑候选与验证交叉对照

| 行号范围 | NPU Name | NRE% | 嫌疑优先级 | 分类 | 验证结论 | 综合结论 |
|----------|----------|------|-----------|------|---------|---------|
| `<起始行~结束行>` | `<算子>` | `<值>` | 高 / 中 / 低 | ROOT CAUSE / PROPAGATION | ✅ 通过 / ❌ 失败 / ⚠️ 未验证(Module 算子,无法自动验证) | 已排除 / 待排查(高/中/低) |
| `<起始行~结束行>` | `<算子>` | `<值>` | 高 / 中 / 低 | ROOT CAUSE / PROPAGATION | ✅ 通过 / ❌ 失败 / ⚠️ 未验证(Module 算子,无法自动验证) | 已排除 / 待排查(高/中/低) |

> 以上为分析报告 §3 可疑候选列表与验证报告的交叉对照。行号范围与分析报告一致,便于回溯定位。已验证算子标注验证结论,未验证算子标注原因并归入"待排查"。Module 算子无法自动验证,原因并入验证结论列。

---

## 附录:dtype 自适应容差

单算子验证使用的 atol/rtol 按算子输出 dtype 自适应选取。

| dtype | atol | rtol | max_rel_err 阈值 | 依据 |
|---|---|---|---|---|
| float64 | `1e-9` | `1e-7` | 0.00001% | 双精度,CPU/NPU 差异应极小 |
| float32 | `1e-4` | `1e-3` | 0.1% | ≈840× eps,matmul K=1024 累加误差 ≈1.2e-4 |
| float16 | `1e-3` | `1e-3` | 0.1% | ≈1× eps(9.77e-4),元素级操作可过 |
| bfloat16 | `5e-3` | `5e-3` | 0.5% | ≈0.6× eps(7.81e-3),元素级操作可过 |

> 判定公式:`passed = shape_match AND (max_diff < atol_dtype) AND (max_rel_err < rtol_dtype × 100)`

---

> **引用**: 详细分析见 `<分析报告路径>`,详细验证见 `<验证报告路径>`。
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall