Building & Installation Guide

Instructions for building the native C++ PJRT plugin library and installing the Python package across Windows on ARM and Linux.

1. Prerequisites

2. Configure Environment Variables

Set QNN_SDK_ROOT to your installed SDK directory:

Windows PowerShell:

$env:QNN_SDK_ROOT = "C:\Qualcomm\QAIRT\2.37.0.250724"

Linux / Bash:

export QNN_SDK_ROOT="/opt/qualcomm/qairt/2.37.0.250724"

3. Building the C++ PJRT Plugin (`pjrt_qnn.dll`)

# 1. Clone the repository git clone https://github.com/carrycooldude/JAX-QNN.git cd JAX-QNN # 2. Configure build with CMake mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DQNN_SDK_ROOT=$QNN_SDK_ROOT # 3. Compile shared library (pjrt_qnn.dll on Windows, pjrt_qnn.so on Linux) cmake --build . --config Release

4. Installing the Python Package

# Install in editable development mode pip install -e ".[dev]"

5. Verifying the Installation

# Run the test suite pytest tests/ -v
Note on STUB Mode: If QNN_SDK_ROOT is omitted during CMake configuration, the plugin will automatically compile in STUB mode with reference CPU execution for development and continuous integration.