A performance counter is a specialized hardware register within a processor that increments to track the occurrence of specific low-level microarchitectural events. On Neural Processing Units (NPUs) and other accelerators, these counters measure metrics like executed floating-point operations, cache hits/misses, memory transactions, and branch mispredictions. This raw event data is the foundation for detailed performance profiling, enabling engineers to quantify compute throughput, memory bandwidth utilization, and identify bottlenecks.
Glossary
Performance Counter

What is a Performance Counter?
A precise definition of the hardware mechanism used for low-level performance analysis of computational kernels on accelerators like NPUs.
Performance counters are accessed via profiling APIs or tools like kernel profilers to analyze NPU kernel execution. By correlating counter data with source code, engineers perform hotspot identification and bottleneck analysis to determine if a kernel is compute-bound or memory-bound. This empirical evidence directly informs auto-tuning efforts, such as optimizing workgroup size or tile size selection, to maximize hardware efficiency and achieve peak performance for AI workloads.
Key Characteristics of Performance Counters
Performance counters are hardware registers that provide low-level, quantitative insight into the execution behavior of NPU kernels. Understanding their characteristics is essential for precise bottleneck analysis and effective auto-tuning.
Hardware-Level Granularity
Performance counters are hardware-implemented registers within the processor's execution units, caches, and memory controllers. They count physical events at the silicon level, such as:
- Floating-point operations (FLOPs) executed
- Cache misses (L1, L2, shared memory)
- DRAM read/write transactions
- Branch mispredictions
- Instruction pipeline stalls This provides a ground-truth view of kernel behavior, free from the approximations of software simulation.
Event-Based Measurement
Counters track discrete, low-level microarchitectural events rather than high-level software metrics. This allows engineers to correlate performance issues with specific hardware behaviors. For example, a high count of L1 cache misses directly explains memory latency stalls, while a low compute throughput counter indicates the kernel may be memory-bound. This event-driven data is the foundation for constructing accurate performance models used in auto-tuning.
Limited Multiplexing & Overhead
NPUs have a finite number of physical counter registers (often 4-8 per core). Profiling complex kernels may require measuring more events than available hardware counters, necessitating multiplexing—where the profiling tool time-slices events, reducing accuracy. Furthermore, reading counters incurs a small but non-zero overhead. Effective profiling involves strategic selection of the most relevant counters to minimize multiplexing and overhead, focusing on the suspected bottleneck (e.g., memory vs. compute).
Core Attribution & Thread Aggregation
Counters can often be configured to measure events for a single core, a subset of cores, or the entire NPU. For parallel workloads, results are typically aggregated across all active threads in a warp or wavefront. Understanding this aggregation is key: a high global cache miss count could be caused by poor access patterns from all threads or severe thread divergence in a few threads. Advanced tools can sometimes provide per-core or per-thread-group insights for finer-grained analysis.
Primary Use Case: Bottleneck Analysis
The definitive use of performance counters is to diagnose the root cause of sub-optimal performance. By analyzing ratios and relationships between counters, engineers can classify a kernel's limiting factor:
- Compute-Bound: High FLOPs count, low cache miss rate, low memory bandwidth utilization.
- Memory-Bound: High cache miss rate, memory bandwidth near peak, low FLOP utilization.
- Latency-Bound: High pipeline stall counts due to dependencies or branch mispredictions. This analysis directly informs optimization strategy, such as improving memory coalescing or adjusting the vectorization factor.
How Performance Counters Work
Performance counters are hardware-level telemetry registers that provide granular, low-overhead visibility into the execution of computational kernels on specialized processors like Neural Processing Units (NPUs).
A performance counter is a specialized hardware register within a processor core that increments each time a specific microarchitectural event occurs. These events include cache misses, floating-point operations (FLOPs), branch mispredictions, and memory transactions. For NPU acceleration, counters directly measure kernel efficiency by tracking metrics like compute throughput, memory bandwidth utilization, and pipeline stalls, providing the raw data essential for bottleneck analysis and hotspot identification.
Performance profiling tools, such as a kernel profiler, sample these counters to correlate event counts with specific lines of code or functions. This data reveals whether a kernel is compute-bound or memory-bound. Engineers use this insight to guide auto-tuning processes—like tile size selection and workgroup size optimization—and to validate the effectiveness of compiler optimizations such as kernel fusion and memory coalescing, ensuring NPU resources are fully utilized.
Common Performance Counter Events
Performance counters are hardware registers that track low-level events within a Neural Processing Unit (NPU). These events provide the foundational data for performance analysis, bottleneck identification, and auto-tuning of AI kernels. The following cards detail the most critical event categories for NPU performance engineering.
Compute Activity
These counters measure the utilization of the NPU's arithmetic and logic units (ALUs), which are the core engines for matrix multiplications and convolutions.
- FLOPS (Floating-Point Operations Per Second): The raw rate of FP16, BF16, or FP32 operations executed. A low sustained FLOPS rate often indicates a memory-bound kernel.
- MACs (Multiply-Accumulate Operations): Counts the fundamental operations in dense and convolutional layers. Comparing executed MACs to theoretical peak reveals compute efficiency.
- ALU Utilization Percentage: The fraction of clock cycles where the ALU pipelines are actively processing data, as opposed to stalled. High utilization is the goal for compute-bound workloads.
- Tensor Core/MMA Unit Activity: Specific to NPUs with dedicated matrix-multiply-accumulate units, these counters show usage of the most powerful compute hardware.
Memory Hierarchy
Counters in this category track data movement across the NPU's complex memory subsystems, which is often the primary bottleneck.
- Global Memory Transactions: Counts reads/writes to the high-capacity, off-chip DRAM (e.g., HBM). High counts with low compute throughput signal inefficient access patterns.
- Cache Hit/Miss Rates: Measures effectiveness of on-chip SRAM caches (L1, L2, shared memory). A low L1 Cache Hit Rate forces data fetches from slower memory levels.
- Memory Bandwidth Utilization: The percentage of the theoretical peak bandwidth being used. Saturation near 100% confirms a memory-bound condition.
- Bank Conflicts: Occur when multiple threads in a warp attempt to access different data within the same memory bank simultaneously, causing serialized access and reducing effective bandwidth.
Parallelism & Scheduling
These events quantify how effectively the NPU's parallel execution resources are occupied and managed.
- Occupancy: The ratio of active warps/wavefronts to the maximum supported per streaming multiprocessor (SM). Low occupancy can limit ability to hide memory latency.
- Thread Divergence Events: Counts occurrences where threads within a single warp take different execution paths (e.g., in an
if/elsestatement), causing serialization. - Pipeline Stalls: Tracks cycles where the instruction pipeline is idle due to data dependencies, resource conflicts, or memory wait states.
- Scheduler Issues: Counts cycles where the warp scheduler has no eligible warps to issue, often due to all warps waiting for long-latency operations.
Control Flow & Synchronization
Counters that measure the cost of program control decisions and coordination between threads, which can introduce overhead.
- Branch Instructions & Mispredictions: Counts executed branches and the number that were mispredicted by the hardware, causing pipeline flushes and wasted cycles.
- Barrier Synchronizations: Tracks executions of
__syncthreads()or similar instructions. Excessive barriers can serialize execution and reduce parallelism. - Atomic Operation Contention: Measures conflicts when multiple threads attempt to atomically update the same memory location, causing serialization.
- Predicated Instruction Execution: Counts instructions executed under a false predicate (masked off), representing wasted compute cycles in divergent code.
Data Movement & I/O
Events related to transferring data between the host (CPU) and the NPU device, a critical phase for overall pipeline latency.
- PCIe (or Interconnect) Transfer Volumes: Measures the amount of data moved over the host-device link. Overlapping this transfer with computation via asynchronous execution is key.
- DMA Engine Activity: Tracks usage of the Direct Memory Access controllers that manage bulk data transfers without CPU intervention.
- Unified Memory Page Faults: In systems with unified virtual memory, counts page migrations between CPU and NPU memory, which are high-latency events.
- Texture/Surface Memory Accesses: For NPUs supporting these specialized memory spaces, counters track cache efficiency for spatially local data.
Power & Efficiency
Counters that correlate performance activity with energy consumption, crucial for edge and mobile NPU deployments.
- Dynamic Power Events: Estimates power draw from transistor switching activity, often correlated with ALU utilization and clock frequency.
- Memory Access Energy: Models energy consumed by DRAM and cache accesses. Reducing unnecessary global memory transactions directly lowers this.
- Voltage/Frequency Domain Activity: Tracks time spent in different power-performance states (P-states).
- Operations per Joule: A derived metric (e.g., GOPs/J) calculated from compute throughput and power counters, representing the ultimate efficiency metric for the kernel.
Performance Counter vs. Related Profiling Concepts
This table differentiates hardware performance counters from other key profiling and analysis tools used in NPU and accelerator optimization.
| Feature / Metric | Performance Counter | Kernel Profiler | Execution Trace | Sampling Profiler |
|---|---|---|---|---|
Primary Data Source | Hardware event registers | Runtime API & hardware counters | Instrumented program execution | Periodic program interrupt |
Measurement Granularity | Cycle-accurate, per-event | Per-kernel launch & device | Per-instruction/function call | Statistical, sample-based |
Typical Overhead | Low to moderate (< 5%) | Moderate (5-15%) | Very high (> 50%) | Very low (< 1%) |
Key Output Metrics | Cache misses, FLOPs, branch mispredictions | Kernel duration, occupancy, SM utilization | Full call stack, memory access sequence | Statistical time distribution per function |
Identifies Bottleneck Type | ||||
Requires Code Instrumentation | ||||
Guides Auto-Tuning Directly | ||||
Best For Analyzing | Micro-architectural inefficiencies | Kernel-level resource utilization | Algorithmic flow & data dependencies | High-level application hotspots |
Frequently Asked Questions
A performance counter is a hardware register that counts low-level events within a processor, such as cache misses, floating-point operations, or branch mispredictions, used for detailed performance analysis of NPU kernels. These FAQs address its core function, usage, and role in the performance engineering workflow.
A performance counter is a specialized hardware register integrated into a processor's architecture that increments each time a specific microarchitectural event occurs. It works by being hardwired to monitor signals within the NPU or CPU, such as the completion of a floating-point operation, a request to a specific level of cache, or the misprediction of a branch instruction. Unlike software timers, these counters provide direct, low-overhead insight into the actual hardware behavior of a running kernel. Performance engineers configure which events to monitor, and profiling tools then sample these registers to collect quantitative data on compute throughput, memory bandwidth utilization, and cache hit rates, forming the empirical basis for bottleneck analysis and optimization.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Performance counters are one component of a comprehensive profiling toolkit. These related concepts are essential for diagnosing bottlenecks and optimizing NPU kernels.
Kernel Profiler
A software tool that aggregates and visualizes raw performance counter data, providing a holistic view of kernel execution. It measures execution time, resource utilization, and correlates hardware events to specific lines of source code.
- Integrates multiple counters to identify correlations (e.g., high cache misses with low memory bandwidth).
- Provides timeline views for asynchronous execution and concurrent kernel analysis.
- Essential for hotspot identification, guiding optimization efforts to the most costly code sections.
Execution Trace
A chronological, instruction-level record of a program's runtime behavior. While a performance counter aggregates events, a trace provides the exact sequence, crucial for diagnosing complex, non-deterministic issues.
- Captures control flow, memory addresses, and function calls.
- Used to analyze thread divergence and pipeline stalls by seeing the exact path each thread took.
- Heavyweight but precise, often used after counters identify a problematic region for deep inspection.
Bottleneck Analysis
The systematic process of using profiling data (like counter values) to identify the primary factor limiting performance. It classifies kernels into fundamental categories based on their limiting resource.
- Compute-Bound: Counters show high ALU utilization but low cache miss rates. Limited by arithmetic throughput.
- Memory-Bound: Counters show high DRAM bandwidth usage or high cache miss rates. Limited by data movement speed.
- Latency-Bound: Counters may show low occupancy due to serialized operations or dependency stalls.
Performance Model
An analytical or machine-learned model that predicts execution time or resource usage based on kernel parameters and hardware specs. It uses counter data for validation and calibration.
- Roofline Model is a common analytical model relating operational intensity (Ops/Byte) to attainable performance (FLOPS).
- Guides auto-tuning by predicting the outcome of parameter changes without exhaustive profiling.
- Counters provide ground truth to train and validate data-driven, learned performance models.
Auto-Tuning
The automated process of searching a configuration space to find optimal kernel parameters. It relies on performance counters as the objective function to evaluate each candidate configuration.
- Parameter Search explores variables like workgroup size, tile dimensions, and unroll factors.
- Techniques like Bayesian Optimization use counter feedback (e.g., cache hits, compute throughput) to intelligently navigate the search space.
- Goal is to maximize positive counters (e.g., FLOPS, bandwidth) and minimize negative ones (e.g., stalls, misses).
Resource Contention
A performance-degrading condition where multiple executing tasks compete for a shared hardware resource. Performance counters are critical for detecting and quantifying this interference.
- Counters measure shared resource usage like L2 cache access rates, memory controller utilization, and interconnect traffic.
- Manifests in concurrent kernel execution or multi-tenant NPU environments.
- Diagnosis requires comparing counters from isolated vs. concurrent runs to see elevated miss rates or reduced bandwidth.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us