Skip to main content
Download PDF

Embedded SoC Performance Tuning Guide

Revision v1.0 (2026.07.29)

1. Root Cause Analysis​

Host-Induced Performance Discrepancies

While the DEEPX DX-M1 (& DX-M1M) NPU offers high-efficiency AI compute capabilities, its real-world performance is fundamentally bound by the capabilities of the Host SoC. When integrating a discrete NPU via PCIe, host-side hardware constraints frequently become the primary root causes of performance degradation.

1.1. Host CPU Processing Power Limits (Low DMIPS)​

An AI inference pipeline is a collaborative workload. It requires intensive computation not just on the NPU, but also on the Host SoC's CPU cores for data orchestration, pre/post-processing, and fallback operations.

  • ONNX Operator Offloading (Fallback Overhead): Deep learning models often contain specialized, custom, or complex layers that may not be natively supported by the NPU's hardware architecture or its compiler. In these scenarios, the ONNX Runtime or the NPU software stack automatically offloads (falls back) these unsupported operations to the Host CPU.
  • Dependency Bottleneck: If the Host CPU has low DMIPS (Dhrystone MIPS), it will struggle to execute these non-accelerated mathematical operations efficiently. Because the NPU cannot proceed until the CPU completes these tasks, a weak host core creates a critical dependency.
  • Pipeline Synchronization Stalls: Transferring intermediate tensors back and forth between the NPU and CPU across the PCIe bus for offloaded ONNX operations introduces massive synchronization overhead. As a result, the high-performance DEEPX M1 NPU spends a significant amount of time idling (starvation state), leading to a severe drop in overall system frame rates (FPS) and increased latency.
  • Pre/Post-Processing Burden: Beyond operator fallback, essential tasks such as video decoding, image resizing, and complex post-processing (e.g., Non-Maximum Suppression (NMS) for object detection) rely entirely on the Host CPU, further compounding the DMIPS bottleneck.

1.2. PCIe Interface and Bandwidth Discrepancies​

The maximum data throughput between the Host SoC and the DEEPX M1 is strictly governed by the host's PCIe controller specifications.

  • Hardware Mismatch: Even if the NPU supports higher PCIe generations and multi-lane configurations (e.g., PCIe Gen 3 x4), the actual transfer speed will drop to the lowest common denominator if the Host SoC only supports a lower standard (e.g., PCIe Gen 2 x1 or x2).
  • System Impact: This bandwidth mismatch restricts the data pipeline. High-resolution tensor transfers or multi-stream workloads encounter massive transmission delays across the PCIe bus, degrading inference latency.

1.3. Host System Memory (DRAM) Bandwidth Contention​

Before any input data is transferred to the NPU via DMA (Direct Memory Access), it must be buffered and pre-processed within the Host SoC's main system memory.

  • Bandwidth Bottleneck: Low-cost or power-optimized Host SoCs often feature constrained memory architectures (e.g., narrow 16-bit or 32-bit LPDDR channels). This limited memory bandwidth must be shared among the operating system, multimedia pipelines (ISP/GPU), and NPU DMA operations.
  • System Impact: High memory bus utilization by other system processes causes memory latency spikes. Consequently, DMA transfers to the PCIe controller are delayed, stalling the entire asynchronous execution pipeline of the M1 NPU.

2. Hardware Optimization: Post-Processing Unit (PPU)​

This chapter explains the core concepts, architectural roles, and supported modes of the PPU, and provides practical JSON configuration guides and key operational restrictions to maximize system performance.

2.1. Core Concepts and Architectural Role​

The Post-Processing Unit (PPU) is a dedicated hardware acceleration module inside the DEEPX NPU designed to optimize specific post-processing steps for supported CNN-based object detection models, especially the YOLO family.

Typically, after the raw predictions exit the detection head of a model, several computationally expensive operations must run on thousands of candidate anchor boxes. By enabling the dedicated PPU hardware path, the system architecture shifts as follows:

  • Hardware-Level Filtering: Operations such as Sigmoid calculations, confidence threshold filtering, and Argmax-style class selection are executed directly within the NPU hardware.
  • Host CPU Offloading: By filtering out the vast majority of negative candidates before sending the tensors to the host, the overall host CPU utilization is dramatically reduced.
  • Latency Minimization: Eliminating massive intermediate tensor transfers across the PCIe bus resolves the synchronization stalls detailed in Chapter 1, ensuring low end-to-end latency for edge devices.

[Baseline: Without PPU]

Baseline: Without PPU

[Optimized: With PPU]

Optimized: With PPU

Figure 1. YOLO Post-Processing Optimization via DX-RT PPU Acceleration

2.2. Evaluation of Performance Benchmark​

To evaluate the practical impact of PPU acceleration, end-to-end performance (FPS) was measured across various host platforms, comparing performance with and without PPU enabled.

ModelIntel i5-14600KRaspberry Pi5NXP i.MX8MPRenesas RZ/G3EAMD Zynq
Platform / CoreP x12 Thread
E x8 Thread
Cortex A76 x4Cortex A53 x4Cortex A55 x4Cortex A53 x2
PCIe BandwidthGen3 x4Gen2 x1Gen3 x1Gen3 x1Gen2 x2
OSUbuntuYoctoYoctoYoctoPetaLinux
Target MetricW/O PPU
→ W/ PPU
(FPS)
W/O PPU
→ W/ PPU
(FPS)
W/O PPU
→ W/ PPU
(FPS)
W/O PPU
→ W/ PPU
(FPS)
W/O PPU
→ W/ PPU
(FPS)
YOLOv3_416223 → 21794 → 22031 → 21928 → 21916 → 219
YOLOv5s334 → 41639 → 31313 → 41411 → 4167 → 413
YOLOv7128 → 12337 → 12314 → 12211 → 1227 → 122
YOLOv7x76 → 7438 → 7313 → 7311 → 737 → 73
YOLOv8n456 → 13451 → 13714 → 13615 → 1369 → 135
YOLOv8s366 → 12349 → 12314 → 12215 → 1229 → 122
YOLOv9t395 → 12668 → 12726 → 12620 → 12513 → 125
YOLOv10n317 → 11742 → 11712 → 11712 → 1168 → 116
YOLOv11n341 → 11950 → 11914 → 11915 → 1199 → 119
YOLOXs412 → 27682 → 27876 → 27759 → 27628 → 276

2.3. Supported Models and PPU Configuration Modes​

The compiler provides two PPU configuration modes depending on the model's architecture.

PPU ModeHead ArchitectureKey Effect & Target Models
type = 0Anchor-BasedExecutes anchor-based box decoding using predefined anchor priors, along with confidence filtering and class selection via the PPU path.

Target Models: YOLOv3, YOLOv4, YOLOv5, YOLOv7
type = 1Anchor-FreeExecutes anchor-free box decoding (stride-based distance regression), along with confidence filtering and class selection via the PPU path.

Target Models: YOLOX, YOLOv8, YOLOv9, YOLOv10, YOLOv11, YOLOv12

2.4. Implementation: JSON-Based PPU Configuration​

PPU configurations are defined in the compilation JSON file using the ppu parameter block. You must locate the correct ONNX operator node names in your model using a visualization tool like Netron.

A. Type 0 Configuration (Anchor-Based YOLO Series)​

Map the final Conv node names of each scale to their corresponding anchor counts:

{
"inputs": {
"input": [1, 3, 224, 224]
},
"calibration_method": "ema",
"calibration_num": 100,
"ppu": {
"type": 0,
"conf_thres": 0.25,
"num_classes": 80,
"activation": "Sigmoid",
"layer": {
"Conv_245": {"num_anchors": 3},
"Conv_294": {"num_anchors": 3},
"Conv_343": {"num_anchors": 3}
}
},
"default_loader": {
"dataset_path": "./calibration_images"
}
}

Type 0 Configuration (Anchor-Based YOLO Series)

Figure 2. Type 0 Configuration (Anchor-Based YOLO Series)

B. Type 1 Configuration (Anchor-Free YOLO Series)​

Identify and pair the bounding box (bbox) and class confidence (cls_conf) head nodes:

{
"ppu": {
"type": 1,
"conf_thres": 0.25,
"num_classes": 80,
"layer": [
{"bbox": "Mul_441", "cls_conf": "Sigmoid_442"
}
]
}
}

Type 1 Configuration (Anchor-Free YOLO Series)

Figure 3. Type 1 Configuration (Anchor-Free YOLO Series)

2.5. Key Restrictions and Operational Limitations​

While the PPU significantly accelerates inference, system integrators must account for the following architectural constraints:

  • NMS Host Execution Required: The PPU hardware path does not perform Non-Maximum Suppression (NMS). Applications must fetch the filtered output tensors from the NPU and run NMS separately on the host CPU.
  • Precise Node Naming: Always use the exact ONNX operator node name (the box in Netron) rather than the tensor/edge names in the JSON layer configurations. Mismatched names will trigger a ConfigInputError.
  • Non-Supported Scenarios: PPU configurations should be disabled for standard Classification models (e.g., ResNet, MobileNet), Segmentation models (e.g., DeepLab, U-Net), or custom architectures whose head formats deviate from standard YOLO structures.
note

For detailed information, refer to Section 3.5.5 ('Optional Parameters: PPU Configuration') in the DXNN Compiler (DX-COM) User Manual.

3. ONNX Graph Pre-Optimization​

This chapter explains the operational principles of ONNX graph pre-optimization, demonstrates real-world throughput gains under CPU-constrained host environments, and provides Python API integration guides along with architectural migration notes.

3.1. Core Concepts and Operational Principles​

Version Compatibility: The dx_com.pre_optimize() API is supported starting from DEEPX SDK v2.4.0 (DX-COM v2.4.0) and later.

The dx_com.pre_optimize() API is an ONNX-level graph transformation API that restructures a model's CPU-side post-processing pipeline.

In resource-constrained edge environments (such as those running on ARM cores), host CPU operations like Sigmoid, Softmax, DFL decoding, and dist2bbox often become a major bottleneck. When these operations process the full anchor grid (e.g., 8,400 candidates for a standard 640×640 input), they dominate end-to-end latency and leave the NPU idling.

To solve this, the pre-optimization API reorders the post-processing graph execution:

  • Upfront TopK Selection: The graph is restructured to execute TopK selection upfront, filtering the massive candidate pool down to a tightly scoped set of K candidates (default is K=300).
  • Targeted Downstream Operations: Expensive post-processing algorithms are then applied exclusively to those K selected candidates instead of the entire grid.
  • Proportional Computational Cost: This shifts the CPU compute overhead to be roughly proportional to K rather than the total anchor count, drastically restoring throughput.

ONNX Graph Transformation: Baseline (AS-IS) vs. Pre-Optimized (TO-BE)

Figure 4. ONNX Graph Transformation: Baseline (AS-IS) vs. Pre-Optimized (TO-BE)

3.2. Performance Evaluation and Throughput Gains​

The table below showcases the end-to-end throughput improvements when enabling pre-optimization on a CPU-constrained host environment.

Evaluation of Benchmarking Environment:

  • Host CPU: ARM Cortex-A53 (Low-DMIPS Core)
  • NPU Accelerator: DEEPX M1
Target ModelBaseline Performance (FPS)Pre-Optimized Performance (FPS)Measured Speed-up
YOLOv8n
Object Detection
613485.7×
YOLOv8n
Segmentation
591873.2×
YOLO26n
Object Detection
1763151.8×

3.3. Programmatic Integration Workflow​

The graph pre-optimization must be applied programmatically in Python before initiating the compiler workflow. Users must load the source ONNX file, configure the target execution pass (e.g., yolo_postprocess or yolo26_postprocess), run the optimizer, and pass the generated optimized model to the compiler.

3.4. Migration Notes and Architectural Exceptions​

A. Integration Benefits​

Migrating to the new Pre-optimization API yields several core technical benefits:

  • Upfront Validation: Error and compatibility checks are completed immediately at the API level before compilation starts.
  • Extended Model Support: Natively supports Instance Segmentation pipelines and standard yolo26_postprocess workflows.
  • Composable Pipelines: Delivers highly modular, fully composable graph transformation passes.

B. YOLOv10 Structural Exemption​

The yolo_postprocess parameter block intentionally excludes YOLOv10. Because YOLOv10 features a native, one-to-one detection head that eliminates non-maximum suppression (NMS), it inherently lacks the redundant post-processing overhead this API is designed to restructure. If you are migrating a legacy YOLOv10 project from PPU Type 2, you can safely remove the ppu configuration block entirely from your JSON without setting up a replacement pipeline.

C. Future Roadmap​

DEEPX plans to actively expand pre-optimization support to additional advanced models, including RTMDet and other leading real-time detector architectures, in upcoming SDK updates.

note

For comprehensive parameter descriptions and advanced usage, refer to Section 4.2 ("ONNX Graph Transformation APIs") in the DXNN Compiler (DX-COM) User Manual.

4. Runtime Optimization: SIMD Acceleration​

This chapter explains the core concepts of platform-specific SIMD and hardware acceleration, showcases comparative performance benchmarks on edge host devices, and provides step-by-step CMake build configurations and runtime API implementation workflows.

4.1. Core Concepts and Acceleration Mechanisms​

When host CPU processing power becomes a pipeline bottleneck, the DEEPX Runtime (DX-RT) leverages platform-specific SIMD (Single Instruction Multiple Data) instructions and specialized hardware acceleration libraries to optimize two primary CPU-side pipeline tasks:

  • Data Format Conversion (NPU Format Handler - NFH): Depending on the model compilation, input data may need to be transposed and padded into NPU-specific layouts, and output data must be stripped of padding and converted back to the host format. These per-frame conversions can cause significant overhead. DX-RT accelerates this stage using platform-optimized SIMD libraries.
  • Data Quantization and De-Quantization: Optimizes host-NPU memory bandwidth by transmitting low-precision int8 data over PCIe instead of Float32 (Quantization) and converting it back to Float32 on the host side (De-Quantization). This reduces the overall data volume to 1/4, which proportionally minimizes the processing overhead for padding insertion (memcpy), PCIe transport, and tensor transposing. Additionally, because uniform Scale and Zero-Point operations are applied across the entire dataset, this stage is highly parallelizable and explicitly optimized for SIMD acceleration. (Will be supported in next release)
  • CPU Operator Acceleration: This replaces the default execution provider for ONNX Runtime CPU tasks (unsupported subgraphs) with highly optimized, hardware-tuned alternatives.

The acceleration mechanisms utilized depend entirely on your target host architecture:

Acceleration Targetx86_64aarch64 (ARM)
Data Format Conversion (NFH)Intel IPPARM NEON
CPU Operator Acceleration (ORT EP)OpenVINO EPXNNPACK EP

4.2. Performance Benchmarks and Acceleration Impact​

The table below illustrates the throughput benchmarks (FPS) across different acceleration combinations.

Evaluation Benchmarking Environment:

  • Host Board: Orange Pi 5 Plus (aarch64)
  • NPU Accelerator: DEEPX DX-M1 via PCIe Gen3 x4
  • OS & Software Stack: Ubuntu 22.04, DX-RT v3.3.0 (Compiled with USE_ORT=ON)
  • Measurement Profile: run_model utility (averaged over 2,000 iterations, excluding application-level pre/post-processing pipelines)
Target ModelBaseline (FPS)NFH Only (FPS)CPU Operator Only (FPS)Joint Acceleration (Both Enabled)
YOLOv8s8486128131
YOLOv10s68689698

Note on Deployment Metrics:

These metrics serve as isolated runtime engine benchmarks. End-to-end performance in production environments may vary depending on the overhead of your integrated application-level pre- and post-processing pipelines.

4.3. Programmatic Integration Workflow​

Enabling hardware-accelerated processing in DX-RT is a two-step process: (1) compiling the framework with the appropriate CMake flags, and (2) explicitly activating the features within your source code via the Runtime Configuration API.

A. Step 1: CMake Configuration and Compilation​

Acceleration is disabled by default. Open your cmake/dxrt.cfg.cmake file under "dx-runtime/dx_rt" and set the following configuration parameters to ON:

# edit cmake/dxrt.cfg.cmake
option(USE_NPU_FORMAT_CONVERSION_ACCELERATION "Include NFH acceleration code" ON)
option(USE_CPU_OP_ACCELERATION "Include CPU operator acceleration code" ON)

After modifying the file, you must trigger a clean build to fetch dependencies and compile properly:

$ ./build.sh --clean

Build System Note:

During the clean compilation step, the build system will automatically download and locally configure the third-party dependencies (such as Intel IPP, OpenVINO, or XNNPACK) over the network.

B. Step 2: Runtime API Integration​

To programmatically activate the compiled acceleration blocks within your application, call the global Configuration API before initiating inference.

C++ Implementation:

#include "dxrt/dxrt_api.h"

// Retrieve the global configuration instance
auto& config = dxrt::Configuration::GetInstance();

// Explicitly enable acceleration flags
config.SetEnable(dxrt::Configuration::ITEM::NFH_ACCELERATION, true);
config.SetEnable(dxrt::Configuration::ITEM::CPU_OP_ACCELERATION, true);

Python Implementation:

from dx_engine import Configuration

# Initialize configuration
config = Configuration()

# Explicitly enable acceleration flags
config.set_enable(Configuration.ITEM.NFH_ACCELERATION, True)
config.set_enable(Configuration.ITEM.CPU_OP_ACCELERATION, True)

Quick Testing Tip

You can quickly benchmark and verify performance gains directly from your terminal without rebuilding your application source code by passing explicit runtime flags to the CLI utility:

$ run_model -m model.dxnn --accel-nfh --accel-cpu

4.4. Platform Constraints and Operational Considerations​

  • Windows Support Roadmap: While hardware-accelerated pipelines are fully supported natively on Linux (Ubuntu 20.04 to 26.04) across both x86_64 and aarch64 architectures, Windows support is currently designated as Planned for an upcoming deployment cycle.
  • Algorithmic Limitations: Enabling CPU operator acceleration yields significant performance enhancements almost exclusively for math-heavy, highly parallelizable layers such as Convolutions (Conv) and Matrix Multiplications (MatMul). Memory-bandwidth-bound operations like Reshape, Transpose, or Concat will see negligible optimization under these providers.
  • Profiler Integration: It is highly recommended to run the DX-RT Profiler first to diagnose whether host-side data conversions or fallback subgraphs are actual system bottlenecks. If your overall latency is heavily dominated by execution on the NPU Core itself, enabling SIMD features will yield minimal end-to-end performance impact.

4.5. Future Roadmap and Development Directions​

Planned Feature Matrix

Targeted Optimization FeatureDevelopment StatusTarget Release Timeline
Data (De) Quantization SIMD AccelerationPlannedSeptember 2026
CPU Fallback Transpose SIMD AccelerationTBD—
Column-Wise SIMD Log SoftmaxTBD—

Strategic Development Directions

  • Targeted CPU Fallback Improvements: Future development cycles will prioritize optimizing fallback CPU operations based on empirical run-time profiling, focusing engineering resources on the most time-consuming operations first.
  • Optimization Limits: Because ONNX Runtime's upstream CPU operators are already highly optimized by the open-source community, achieving further general-purpose CPU speed-ups is mathematically challenging. Consequently, future developments may focus on highly localized, model-specific optimizations which require substantial validation timelines.
note

For detailed runtime implementation parameters, refer to Section 4.8.1 ("Hardware-Accelerated Data Processing") in the DXNN Runtime (DX-RT) User Manual.

5. Memory Optimization: Contiguous Memory Allocation (Planned for 2026)​

This chapter explains the core concepts of Contiguous Memory Allocation (CMA) in DX-RT, contrasts its physical memory layout with traditional fragmented user buffers, and details how the dedicated PCIe DMA engine achieves peak asynchronous throughput.

5.1. Core Concepts and Physical Memory Layout​

Efficient host memory allocation and physical page layouts are critical to sustaining low-latency execution loops, especially when pushing high frame rates. To resolve the severe physical page fragmentation inherent in standard OS memory architectures, DX-RT utilizes a Contiguous Memory Allocator (CMA) mechanism.

  • Traditional User Buffer (AS-IS): Although memory buffers appear perfectly contiguous within the application's virtual memory space, the underlying OS fragments them into hundreds of random, non-contiguous 4KB physical memory pages in host DDR.
  • Contiguous CMA Buffer (TO-BE): Allocates a dedicated, physically contiguous block of DDR RAM (a unified memory "highway") reserved specifically for high-speed device I/O upon driver initialization.

Virtual-to-Physical Memory Mapping

Figure 5. Virtual-to-Physical Memory Mapping: Traditional Fragmented Buffer (AS-IS) vs. Contiguous CMA Buffer (TO-BE)

5.2. Architectural Workflow Comparison​

The table below contrasts the mechanical differences between traditional user-space buffers and the optimized CMA buffer workflow during host-device transactions:

Feature DimensionTraditional User Space Buffer (AS-IS)Contiguous CMA Buffer (TO-BE)
Physical Memory StateFragmented (distributed across non-contiguous 4KB pages)Fully contiguous (single giant continuous block)
Host CPU OverheadHigh - O(N) Complexity - :
• Pin and track virtual pages (get_user_pages) on every frame
• Resolve and translate hundreds of physical page addresses
• Construct complex Scatter-Gather Lists
Low - O(1) Complexity - :
• Verifies the pre-allocated physical CMA address
• Maps address space directly to user space via mmap once
• Generates a single-line pointer transaction command
DMA Descriptor ListDozens to hundreds of descriptors required (one for every 4KB page)Exactly one descriptor is sufficient (Start Address + Size)
PCIe Hardware BehaviorFrequent pipeline stalls:
PCIe controller stalls during segmentation to fetch and parse the next fragmented page address
Peak Burst Transfer:
High-speed continuous transmission over the PCIe bus without a single controller stall
Cache SynchronizationIterative cache flushing page-by-page (high software loop overhead)Single, immediate cache sync over a single continuous region

5.3. Performance Benefits of CMA and Dedicated PCIe DMA Engines​

  • Host CPU Utilization Drop: This approach completely eradicates substantial OS kernel software overhead. In traditional user-space buffers, the kernel is forced to pin and lock memory pages, query translation tables, and dynamically assemble Scatter-Gather (SG) lists on every single inference cycle. With CMA, the CPU bypasses this entire pipeline, simply passing the unified physical starting address (O(1) complexity) directly to the PCIe DMA controller.
  • Peak PCIe Bus Throughput: When the PCIe card reads or writes physical DDR host memory, contiguous layouts unlock the hardware's peak sequential bandwidth. Contiguous memory allows the hardware prefetcher and PCIe burst transmission mode to operate at full capacity. Conversely, fragmented 4KB page boundaries generate translation lookup (TLB) misses and hardware scheduler interrupts, causing severe transfer stalls.
  • Direct PCIe DMA Kernel Engine (dx_dma.ko): Working hand-in-hand with CMA, this custom PCIe DMA driver coordinates low-overhead, fast physical memory copy transactions between host DDR and NPU on-board LPDDR memory.
  • Multi-Channel DMA Scaling: The architecture features a multi-threaded execution queue mapping to 4 dedicated physical DMA channels (upgraded in v3.0.0 from 3 to 4 channels). This upgrade prevents channel serialization bottlenecks and allows concurrent, non-blocking input/output flows.
  • Asynchronous Overlapped Execution: By utilizing the non-blocking RunAsync() and Wait() runtime APIs, host pre-processing, PCIe Write, NPU core computation, PCIe Read, and post-processing are executed in parallel. This completely overlaps transfer times on the PCIe bus with active NPU compute cycles.

Asynchronous Pipeline Optimization

Figure 6. Asynchronous Pipeline Optimization: Concurrent Ingress and Egress Flow via Non-Blocking APIs

note

Support for contiguous memory allocation management is scheduled for release within 2026. Detailed runtime memory implementation parameters will be updated in a future release of DXNN Runtime (DX-RT) User Manual.