Skip to content
Agentmart
Submit a tool

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

IndexedMulanPSL-2.0★ 52
Write a review

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.

We use your email only for this newsletter. Privacy

About

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.

Use cases: documents, spreadsheets, data

No 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

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
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Ascend

Cite this page

ascend-profiling-anomaly skill. Agent Mart. https://agentmart.dev/skills/ascend-ascend-profiling-anomaly (last updated 2026-10-24)