ascend-profiling-anomaly
Analyze Huawei Ascend NPU profiling data to discover hidden performance anomalies and produce a detailed model architecture report reverse-engineered from…
Skill by Ascend
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ascend-ascend-profiling-anomaly
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, spreadsheets, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/ascend-profiling-anomaly
What's inside
- Skill name
ascend-profiling-anomaly- Description
- Analyze Huawei Ascend NPU profiling data to discover hidden performance anomalies and produce a detailed model architecture report reverse-engineered from profiling. Trigger on Ascend profiling traces, NPU bottlenecks, device idle gaps, host-device issues, kernel_details.csv / trace_view.json / op_summary / communication.json. Also trigger on "profiling", "step time", "device bubble", "underfeed", "host bound", "device bound", "AICPU", "wait anchor", "kernel gap", "Ascend performance", "model architecture", "layer structure", "forward pass", "model structure". Runs anomaly discovery (bubble detection, wait-anchor, AICPU exposure) alongside model architecture analysis (layer classification, per-layer sub-structure, communication pipeline). Outputs a separate Markdown architecture report alongside anomaly analysis.
- License
- MulanPSL-2.0
- Instructions
- 404 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (6)
- SKILL.md
- architecture_report_template.md · references/
- kernel_data_guide.md · references/
- rulebook.md · references/
- schema.json · references/
- reference_host_gap_branch.py · scripts/
SKILL.md (first lines)
# Ascend Profiling Anomaly Discovery Skill
## Purpose
Analyze Ascend NPU profiling data through three parallel pipelines:
1. **Structure breakdown**: step → structure (layer) → block / side → op → PMU judgement — answers *where the time goes*.
2. **Anomaly discovery**: step → device busy union → bubble detection → anomaly tags → soft attribution — answers *what looks unnatural and where hidden issues may lurk*.
3. **Model architecture analysis**: FIA timeline → pass boundaries → layer classification → per-layer sub-structure → communication pipeline → architecture summary — answers *what is this model and how does each component execute*. **Produces a separate Markdown report file.**
The core philosophy is **separation of concerns**: "anomaly exists" is a hard fact derived from device intervals; "why it exists" is a soft attribution that may require additional evidence. Even under weak profiling configurations (no stacks, no shapes, sparse host events), the skill must still reliably surface device idle bubbles and risk labels.
## Reference Files — When to Read
Read these before starting analysis:
| File | When to read | What it contains |
|---|---|---|
| `references/kernel_data_guide.md` | **Always — read first** | Raw data column schemas for kernel_details.csv, op_summary, trace_view.json; the step → structure → block/side → op hierarchy; how to parse, filter, assign kernels at each level; multi-stream handling; per-level timing aggregation |
| `references/rulebook.md` | Always | Anomaly thresholds, tagging rules, decision tables, soft attribution rules, AICPU classification, wait-anchor rules |
| `references/architecture_report_template.md` | **Always — read before producing the architecture report** | Full template for the standalone Markdown architecture report: required sections, formatting rules, analysis techniques for layer classification, communication overlap measurement, per-layer timing breakdowns |
| `references/schema.json` | When producing structured JSON output | Full JSON schema for the `anomaly_discovery` output object |
| `scripts/reference_host_gap_branch.py` | When writing analysis scripts | Reference Python implementation for interval merging, bubble metrics, soft attribution, wait-anchor scoring |
## Pipeline Overview
The full state machine:
```
INGEST → INVENTORY → FACT_EXTRACTION → CANDIDATE_STEP_DETECTION →
STEP_GROUPING → MACRO_STEP_RESOLUTION → SEGMENTATION →
CLOCK_ACCOUNTING → ANOMALY_DISCOVERY → PERF_JUDGEMENT →
RECOMMENDATION → RENDER → DONE
↘
ARCHITECTURE_ANALYSIS → ARCH_REPORT_RENDER → ARCH_REPORT_SAVE
```
`ANOMALY_DISCOVERY` sits after `CLOCK_ACCOUNTING` and before `PERF_JUDGEMENT`. It receives already-segmented steps and structures, and runs the bubble detection pipeline on top of them.
`ARCHITECTURE_ANALYSIS` runs in parallel with `PERF_JUDGEMENT`, using the same segmented data from `CLOCK_ACCOUNTING` plus FIA timeline analysis. It produces a **separate Markdown report file** saved alongside the profiling data.
---
## Data Hierarchy: Step → Structure → Block/Side → Op
Understanding how raw kernel data maps to each level is essential. Read `references/kernel_data_guide.md` for the full column schemas and parsing details. Here is the conceptual overview:
### Level 0: Raw Kernels
Each row in `kernel_details.csv` represents a single device kernel execution — one invocation of an AI Core task, an AI CPU task, or an HCCL communication task. Key fields: `Name`, `Task Type`, `Start Time(us)`, `Duration(us)`, `Wait Time(us)`, `Accelerator Core`, `Stream ID`, `Input Shapes`, `Output Shapes`.
### Level 1: Step
A step is one training/inference iteration. Steps are identified by `ProfilerStep#N` user annotations or `Iteration#N` markers in `trace_view.json`. Each step defines a **service window** `[S_i, S_{i+1})`. All kernels whose start time falls within this window belong to step `i`.
At step level, compute:
- Total service time, device busy union, underfeed ratio
- Prelaunch gap, tail gap, internal bubbles
- Per-step anomaly tags and soft root-cause labels
### Level 2: Structure (Layer)
Within a step, kernels form repeating **structures** — typically corresponding to model layers (e.g., transformer blocks, attention layers, MLP blocks). Segmentation identifies these by:
1. Repeating name-pattern sequences in the kernel timeline
2. Significant time gaps between kernel groups
3. User annotations marking layer boundaries (if present)
Each structure contains a contiguous span of kernels within the step window.
At structure level, compute:
- Structure wall time, device busy union within structure span
- Structure share of total step time
- Per-structure bubble metrics (is the bubble inside this structure or between structures?)
### Level 3: Block / Side
Within each structure, kernels split into:
- **Block (main compute path)**: The dominant chain of AI Core kernels forming the forward or backward pass of this layer. These execute on the main compute stream.
- **Side (auxiliary ops)**: Everything else — small element-wise ops, communication (HCCL), AI CPU fallback ops, memory copies, synchronization events. These may execute on separate streams.
At block/side level, maintain **four timing perspectives** simultaneously:
- `wall_ms` — wall-clock time from first kernel start to last kernel end
- `busy_union_ms` — merged device-busy time (accounts for multi-stream overlap)
- `kernel_sum_ms` — arithmetic sum of all kernel durations (ignores overlap)
- `total_cost_ms` — sum of `duration + wait` for all kernels
Conclusions based on only one metric are incomplete. A block appearing heavy in `kernel_sum` but light in `wall` means high stream parallelism. A side appearing heavy in `total_cost` but light in `duration` means wait-anchor false hotspot risk.
### Level 4: Op (individual operator)
The finest grain. Each op may produce one or many device kernels. Op-level analysis handles:
- Top ops by total cost vs. top ops by kernel duration (these rankings often differ)
- Wait-anchor detection: ops with `wait_ratio > 0.95` and tiny `duration` but high `total_cost`
- AICPU classification: ops running on AI CPU instead of AI Core, classified by `masked_ratio`
- Small-op initial judgement: whether small individual ops are real inefficiencies or noise
---
## Anomaly Discovery Pipeline (Detail)
### Phase 1: BUILD_DEVICE_INTERVALS
For each step, collect all device kernel intervals from `kernel_details.csv`:
```
device_intervals = []
for each kernel row where Start_Time_us is within step window:
s = max(step_start_us, row.Start_Time_us)
e = min(step_end_us, row.Start_Time_us + row.Duration_us)
if e > s:
device_intervals.append(Interval(s, e))
```
Key rules:
- Clip kernel intervals to the step window boundary
- Apply communication dedup rules BEFORE interval statistics (see `references/kernel_data_guide.md` section on comm dedup)
- Include AI_CORE, AI_CPU, and HCCL tasks — all count as "device busy"From Ascend/agent-skills, MulanPSL-2.0.
More from Ascend/agent-skills
- 0.573score
ascendc-operator-design
Ascend
完成AscendC算子设计 - 帮助用户完成算子的架构设计、接口定义和性能规划。当用户提到算子设计、算子开发、tiling策略、内存规划、AscendC kernel设计、两级tiling、核间切分、核内切分时,使用此skill。
SkillCFreshness: C★ 52Claude Code +9 - 0.573score
ascendc-operator-performance-optim
Ascend
排查并优化 Ascend C 算子性能。当用户开发、审查或优化 Ascend C kernel 算子时使用,或当用户提及 Ascend C 性能优化、算子优化、tiling、流水、搬运、 内存优化、NPU/昇腾等关键词时触发。
SkillCFreshness: C★ 52Claude Code +9 - 0.571score
ascend-transformer-boost
ascend-transformer-boost-team + Claude + Claude Code + deepseek-v4-pro
昇腾 Transformer 加速库(ATB)核心技能集索引(Index Skill)。 整合 8 大核心技能:CANN 安装部署、ATB 测试框架编译、 ATB→ACLNN 算子替换设计文档生成、ATB→ACLNN 算子迁移,覆盖昇腾 NPU 开发全链路。
SkillCFreshness: C★ 52Claude Code +9 - 0.570score
k8s-check-fix
Ascend
Kubernetes 集群健康检查与安全修复 — 诊断问题,用户确认后执行修复
SkillCFreshness: C★ 52Claude Code +9 - 0.567score
cann-nnal-installer
Ascend
昇腾NPU CANN Toolkit+Kernels+NNAL安装部署技能。支持从官网下载run包安装和从Docker镜像提取两种方式,覆盖驱动检查、包下载、安装、环境变量配置与验证全流程。当用户需要安装CANN全套组件或指定版本CANN到自定义路径时调用。
SkillCFreshness: C★ 52Claude Code +9 - 0.522score
ascendc-operator-code-gen
Ascend
No description from the publisher yet.
SkillCFreshness: C★ 52Claude Code +9 - 0.514score
ascendc-operator-code-review
Ascend
Ascend C 代码检视技能。基于假设检验方法论对代码进行安全规范检视。调用时必须明确提供:代码片段和检视规则描述。TRIGGER when: 用户要求代码检视、代码review、询问代码安全问题、检查编码规范、或需要检查特定代码问题(如内存泄漏、整数溢出、空指针等)。关键词:Ascend…
SkillDFreshness: D★ 52Claude Code +9 - 0.514score
ascendc-operator-performance-eval
Ascend
在 ascend-kernel 的 csrc/ops/<op>/test 下维护仅含 JSONL 的 profiler 性能用例,使用 torch_npu.profiler(固定 warmup=5、active=5)采集,汇总 ASCEND_PROFILER_OUTPUT/op_statistic.csv 的…
SkillDFreshness: D★ 52Claude Code +9 - 0.514score
megatron-migration-generator
Ascend
Generate migration deliverables for bringing relevant Megatron changes into MindSpeed after branch alignment and impact mapping are complete.
SkillDFreshness: D★ 52Claude Code +9 - 0.514score
ascend-docker
Ascend
Create Docker containers for Huawei Ascend NPU development with proper device mappings and volume mounts.
SkillDFreshness: D★ 52Claude Code +9 - 0.514score
hccl-test
Ascend
HCCL (Huawei Collective Communication Library) performance testing for Ascend NPU clusters.
SkillDFreshness: D★ 52Claude Code +9 - 0.511score
ascendc-operator-precision-debug
Ascend
AscendC 算子精度问题调试与根因定位。当算子精度测试失败(allclose 不通过、结果偏差、输出全零/NaN 等)时使用。流程:误差分布分析 → 代码易错点审查 → 实验隔离 → printf/DumpTensor 插桩 → 修复验证。关键词:精度调试、精度问题、结果不一致、误差定位、allclose…
SkillDFreshness: D★ 52Claude Code +9
Signals
- Stars
- 52
- Forks
- 3
- Open issues
- 2
- Last commit (this folder)
- Mar 17, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MulanPSL-2.0
- Repository
- github.com/Ascend/agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Ascend
- 0.573score
ascendc-operator-performance-optim
Ascend
排查并优化 Ascend C 算子性能。当用户开发、审查或优化 Ascend C kernel 算子时使用,或当用户提及 Ascend C 性能优化、算子优化、tiling、流水、搬运、 内存优化、NPU/昇腾等关键词时触发。
SkillCFreshness: C★ 52Claude Code +9 - 0.573score
ascendc-operator-design
Ascend
完成AscendC算子设计 - 帮助用户完成算子的架构设计、接口定义和性能规划。当用户提到算子设计、算子开发、tiling策略、内存规划、AscendC kernel设计、两级tiling、核间切分、核内切分时,使用此skill。
SkillCFreshness: C★ 52Claude Code +9 - 0.570score
k8s-check-fix
Ascend
Kubernetes 集群健康检查与安全修复 — 诊断问题,用户确认后执行修复
SkillCFreshness: C★ 52Claude Code +9 - 0.567score
cann-nnal-installer
Ascend
昇腾NPU CANN Toolkit+Kernels+NNAL安装部署技能。支持从官网下载run包安装和从Docker镜像提取两种方式,覆盖驱动检查、包下载、安装、环境变量配置与验证全流程。当用户需要安装CANN全套组件或指定版本CANN到自定义路径时调用。
SkillCFreshness: C★ 52Claude Code +9 - 0.522score
ascendc-operator-code-gen
Ascend
No description from the publisher yet.
SkillCFreshness: C★ 52Claude Code +9 - 0.514score
ascend-docker
Ascend
Create Docker containers for Huawei Ascend NPU development with proper device mappings and volume mounts.
SkillDFreshness: D★ 52Claude Code +9
Cite this page
ascend-profiling-anomaly skill. Agent Mart. https://agentmart.dev/skills/ascend-ascend-profiling-anomaly (last updated 2026-10-24)