A comprehensive technical deep-dive into the JAX compiler pipeline, OpenXLA PJRT C API integration, and Qualcomm QNN native graph lowering.
GetPjRtApi C ABI. No custom JAX forks, no hacks, and zero Python execution overhead during compiled inference.
The shared library exports the standard C ABI symbol GetPjRtApi() defined in csrc/pjrt/pjrt_c_api.h:
QnnGraph_t.| StableHLO Primitive | Qualcomm QNN Operation | NPU Acceleration (HTP) |
|---|---|---|
stablehlo.dot_general |
QNN_OP_MAT_MUL |
✔ Native Tensor Core |
stablehlo.add / subtract |
QNN_OP_ELEMENT_WISE_ADD / SUB |
✔ Hexagon Vector Unit |
stablehlo.multiply / divide |
QNN_OP_ELEMENT_WISE_MUL / DIV |
✔ Hexagon Vector Unit |
stablehlo.maximum (ReLU) |
QNN_OP_RELU / QNN_OP_ELEMENT_WISE_MAX |
✔ Fused Activation |
stablehlo.convolution |
QNN_OP_CONV_2D |
✔ 2D/3D HW Engine |
stablehlo.reduce |
QNN_OP_REDUCE_SUM / MEAN |
✔ Vector Reduction |
stablehlo.reshape / transpose |
QNN_OP_RESHAPE / TRANSPOSE |
✔ Zero-Copy View |
Qualcomm Snapdragon processors feature Vector Tightly-Coupled Memory (VTCM) directly embedded alongside the Hexagon NPU execution pipelines. During compilation, intermediate tensor allocations are placed in VTCM, completely eliminating main memory bus traffic during deep layer execution.