Lab 01 — AI Hub Deployment (QAI Hub)

Phase: 06 — Qualcomm NPU Hardware & Deployment | Difficulty: ⭐⭐⭐⭐⭐ | Time: 3–4 hours

Qualcomm AI Hub (qai_hub) compiles and benchmarks models directly on Snapdragon NPU/DSP hardware.

What you build

  • Export a model to ONNX (opset 17) for QAI Hub compatibility
  • Simulate SNPE/QNN conversion pipeline (profile, compile, inference tasks)
  • Evaluate model compatibility: supported ops vs fallback ops
  • Parse and analyze Hub job results for latency and accuracy

Key concepts

ConceptWhat to understand
SNPE vs QNNSNPE = legacy DLC format; QNN = new binary context format
NPU targetsSnapdragon 8 Gen 3 (SM8650) has 45 TOPS NPU
Op supportNot all ONNX ops supported on NPU; unsupported fall to CPU/GPU
QAI Hub jobscompile_jobprofile_jobinference_job pipeline

Files

FilePurpose
lab.pyStubs with TODO markers
solution.pyComplete working implementation
test_lab.pypytest suite
requirements.txtDependencies

Run

pip install -r requirements.txt
python lab.py
pytest test_lab.py -v

Note: Full QAI Hub tests require a qai_hub account and device access. Tests that need account access are skipped automatically.