A high-performance OpenXLA PJRT plugin bridging JAX StableHLO representations directly to Qualcomm Hexagon NPUs (45 TOPS), Adreno GPUs, and Oryon CPUs.
import jax
import jax.numpy as jnp
import jax_qnn
# 1. Discover Qualcomm hardware accelerators
print("Available Devices:", jax.devices("qnn"))
# 2. Define JAX Model
@jax.jit
def dense_model(x, w, b):
return jax.nn.relu(jnp.matmul(x, w) + b)
x = jnp.ones((128, 512), dtype=jnp.float32)
w = jnp.ones((512, 512), dtype=jnp.float32)
b = jnp.zeros((512,), dtype=jnp.float32)
# 3. Compile & Execute directly on Qualcomm Hexagon NPU
output = jax.jit(dense_model, backend="qnn")(x, w, b)
print("Output shape:", output.shape)
Targets Qualcomm HTP (Hexagon Tensor Processor) with Vector Tightly-Coupled Memory (VTCM) allocation for zero-DDR thrashing.
Built directly against the official OpenXLA PJRT C API standard (GetPjRtApi ABI), ensuring pure upstream JAX compatibility.
Converts JAX MLIR / StableHLO operations (dot_general, conv, maximum, broadcast) directly into native QNN execution graphs.
Full support for Windows 11 Copilot+ PCs (MCDM Driver Store) and Linux Snapdragon Developer Kits.
Measured on Qualcomm Snapdragon X Elite (X1E80100) 12-Core Oryon CPU using python examples/benchmark.py.
| Workload | CPU (Measured) | QNN Backend (Measured) | Speedup |
|---|---|---|---|
| 256×256 Dense GEMM + ReLU | 0.38 ms | 0.42 ms | ~1.0x |
| 512×512 Dense GEMM + ReLU | 1.83 ms | 1.61 ms | 1.1x |
| 1024×1024 Dense GEMM + ReLU | 6.07 ms | 6.12 ms | ~1.0x |
Run community examples across Computer Vision, Large Language Models, and Benchmarks.
Standard dense neural network layer executed on Qualcomm Hexagon NPU.
Computer vision convolutional filter layer mapped to QNN native ops.
Scaled dot-product attention block targeting Hexagon Vector units.
Comprehensive latency and throughput test across NPU, GPU, and CPU.