ascendc-perf-optimize

Diagnoses Ascend C kernel bottleneck types and routes to targeted optimization strategies.

6|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/xchang1121/op-autoresearch --skill ascendc-perf-optimize-xchang1121
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ascendc-perf-optimize
Source: https://github.com/xchang1121/op-autoresearch/tree/main/skills/ascendc/guides/ascendc-perf-optimize
Command: npx skills add https://github.com/xchang1121/op-autoresearch --skill ascendc-perf-optimize-xchang1121

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Ascend C operator kernels often underperform without a clear reason, and blindly tweaking tile sizes wastes time. This Skill classifies the kernel's bottleneck from profiling or simulation traces (VEC bound, memory bound, scalar bound, or no bound) and loads the matching optimization playbook, plus a structured tiling parameter-space analysis method. ## Core Features & Use Cases - Bound-type routing: Maps profiling/simulation evidence to one of four bottleneck categories, each with severity grading, trace signatures, and concrete fixes such as DoubleBuffer, Cast reduction, fused instructions, and L2 reuse. - Tiling parameter-space analysis: A four-stage method (parameter inventory, type/constraint tracing, algorithm enablement, candidate space construction) that separates hardware constraints from software heuristics before any search. - Structural optimization guidance: Covers sample bucketing by dtype/rank/broadcast/reduce-axis, scalar small-D paths, batched CopyOut, and branch hoisting for cases where parameter tuning alone yields no gains. - Use Case: Given a slow elementwise kernel whose trace shows 65% VECTOR utilization with heavy Cast instructions, the Skill routes to the VEC-bound playbook and recommends eliminating fp16/fp32 round-trip casts and fusing vector operations. ## Quick Start Ask the agent to analyze this Ascend C kernel's profiling trace, determine its bound type, and apply the matching optimization strategy from the ascendc-perf-optimize knowledge base.

Frequently Asked Questions about ascendc-perf-optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Ascend C kernel performance?▼

First classify the bottleneck from profiling or simulation traces as VEC bound, memory bound, scalar bound, or no bound. Then apply the matching strategy: UB fusion and Cast reduction for VEC bound, L2 reuse and merged copies for memory bound, loop restructuring for scalar bound, and DoubleBuffer or preload for no bound.

How to identify VEC bound vs memory bound in Ascend C kernels?▼

Check unit utilization in the trace: VEC bound shows high Vector utilization with idle MTE2 gaps, while memory bound shows MTE2 bandwidth near peak with Vector units waiting for data. The Skill provides trace signatures and severity grading for each type.

How do I build a tiling parameter search space for Ascend C operators?▼

Follow the four-stage method: list all kernel tiling parameters, classify each as fixed, independent, or derived while tracing constraints to hardware or software sources, determine enabled algorithms per sample bucket, then generate candidates within hardware limits using alignment-granularity steps.

Why does tile size tuning give no speedup on my Ascend kernel?▼

When tuning yields under-noise gains, the bottleneck is usually structural: kernel launch overhead, serialized CopyIn/Compute/CopyOut, per-row small CopyOuts, or per-tile branching. The no-bound playbook recommends batching rows, hoisting branches, and removing dead buffers instead of further parameter tuning.

When should I use scalar reduction instead of ReduceSum in Ascend C?▼

Use a scalar loop when the reduce dimension is small, typically D <= 32 or 64, because hardware tree reduction synchronization and temporary buffers cost more than a simple loop at that size. Larger reductions should use ReduceSum or ReduceMax.