Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DX-M1 M.2 Module — Inference Compilation & Reference Validation

An empirical record of compiling and validating AI models for the DEEPX DX-M1 NPU (M.2 module form factor), produced by Squarelight. The goal of this repository is to document a reproducible, software-only workflow for taking standard ONNX models through the official DEEPX toolchain to a DX-M1-targeted binary, and to establish a CPU reference baseline for the same models.

Scope & honesty note. No physical DX-M1 NPU was attached during this run. Everything here is software: the DEEPX DX-COM compiler (which runs on a host CPU) produces the DX-M1 .dxnn binaries, and ONNX Runtime on CPU provides the functional/latency reference that a real DX-M1 deployment would be validated against. The .dxnn artifacts are genuine DX-M1 target binaries; the latency numbers in this repo are CPU reference numbers, not NPU numbers.

What was done

  1. Installed the official DX-COM 2.3.0 compiler wheel from DEEPX (sdk.deepx.ai) in a clean linux/amd64 Ubuntu 22.04 container. The compiler self-reports Target Hardware: M1.
  2. Downloaded three sample ONNX models + a 100-image INT8 calibration set from the DEEPX DX ModelZoo.
  3. Compiled all three models to DX-M1 .dxnn binaries with post-training INT8 quantization and calibration — full compiler logs captured.
  4. Ran each original ONNX graph through ONNX Runtime (CPU) to capture a latency/throughput and output-signature reference baseline.

Results

Model Task ONNX → DXNN NPU / CPU groups Compile time CPU ref latency (mean) CPU ref throughput
MobileNetV2-1 Classification 13 MB → 7 MB 1 / 0 (full NPU) 19 s 4.41 ms 226.8 fps
YOLOV5S-1 Object detection 27 MB → 15 MB 1 / 1 218 s 77.0 ms 13.0 fps
YOLOV5S_Face-1 Face detection 30 MB → 16 MB 1 / 1 229 s 85.3 ms 11.7 fps

Key observations from the compiler:

  • INT8 quantization roughly halves model size (e.g. MobileNetV2 13 MB → 7 MB).
  • MobileNetV2 maps entirely to the NPU (0 CPU groups); DX-COM even fuses preprocessing (Div(255) + Normalize) into the NPU graph.
  • YOLOv5s models partition into an NPU group (backbone/neck) plus a single CPU group (detection head) — the expected split for these architectures.
  • Compile times are inflated here because the linux/amd64 compiler runs under QEMU emulation on an Apple Silicon host; on native x86_64 they are much lower.

Machine-readable results: results/summary.json.

Repository layout

.
├── README.md
├── scripts/
│   ├── run_pipeline.sh            # end-to-end reproduction (compile + reference)
│   ├── reference_inference.py     # ONNX Runtime CPU benchmark harness
│   └── clean_log.py               # collapses tqdm/progress noise in captured logs
├── logs/
│   ├── 01_install_dxcom.log       # DX-COM 2.3.0 install (Target Hardware: M1)
│   ├── 02_download_models.log     # sample ONNX model download
│   ├── 03_download_calibration.log
│   ├── 04_dxm1_compile.clean.log  # DX-M1 compilation (readable)
│   ├── 05_cpu_reference_inference.clean.log
│   └── 06_environment.log         # toolchain/version fingerprint
└── results/
    ├── summary.json
    ├── cpu_reference_inference.json
    └── dxnn/                       # compiled DX-M1 binaries + per-model compiler.log
        ├── MobileNetV2-1/MobileNetV2-1.dxnn
        ├── YOLOV5S-1/YOLOV5S-1.dxnn
        └── YOLOV5S_Face-1/YOLOV5S_Face-1.dxnn

Reproducing

Requires an x86_64 Linux host (or emulated container) with ≥16 GB RAM available to the process — DX-COM enforces a 15 GB memory floor.

# from a clean Ubuntu 22.04 amd64 container
apt-get update && apt-get install -y python3-venv git curl \
    libgl1-mesa-glx libglib2.0-0
./scripts/run_pipeline.sh

The script installs DX-COM, pulls the sample models + calibration set, compiles each to .dxnn, and runs the CPU reference benchmark.

About the DX-M1

The DEEPX DX-M1 is an edge/on-device AI accelerator delivered in an M.2 module that plugs into a host over PCIe. It has no cloud "inference-as-a-service" API — inference runs on the physical module via the DX-RT runtime. This repo therefore uses the two paths that do work without hardware: the DX-COM compiler (host-side) and a CPU reference for functional comparison. Validating the compiled .dxnn binaries on real silicon is the natural next step once a DX-M1 module is available.

Tooling & sources


All logs in this repository are captures of actual runs. Latency figures are ONNX Runtime CPU references, not DX-M1 NPU measurements.

About

Empirical compilation & CPU reference validation of AI models for the DEEPX DX-M1 M.2 NPU module (DX-COM 2.3.0).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages