Instructions to use kadamiak-consultred/laya-qcs8550-npu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use kadamiak-consultred/laya-qcs8550-npu with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Laya on the Qualcomm Hexagon NPU (QCS8550)
Precompiled QNN context binaries of the Laya decision model for the Hexagon NPU (HTP V73) of the Qualcomm QCS8550, in fp16. Answers match stock Laya on the CPU (48/48 decisions identical per checkpoint), 15-39x faster end to end.
This is not a new model: it is Laya's weights, converted and compiled for one chip. The export, compile and runtime scripts that produced these files are open source (see "Rebuild it yourself").
Code (export, compile, runtime, benchmarks): Consult-Red-Ltd/Laya-on-Qualcomm
Files
| File | Checkpoint (base) | Max tokens | Graph lengths | Size |
|---|---|---|---|---|
ctx/english_socid66_archv73.bin |
convaiinnovations/laya (ModernBERT-large) |
512 | 128, 256, 512 | 857 MB |
ctx/multilingual_socid66_archv73.bin |
convaiinnovations/laya, subfolder multilingual (mmBERT-base) |
1024 | 128, 256, 512, 1024 | 664 MB |
ctx/typed-decisions_socid66_archv73.bin |
convaiinnovations/laya, subfolder typed-decisions (ModernBERT-large) |
1024 | 128, 256, 512, 1024 | 876 MB |
Each file is one context binary with one graph per length and the weights stored once. SHA256SUMS
lists checksums. results/ has the raw benchmark JSON from the board.
Compatibility (read this first)
A context binary is tied to the chip and to the SDK version. It will not load elsewhere.
| Target | Qualcomm QCS8550 (Thundercomm RB5 Gen2), Hexagon HTP V73, soc_model 66 |
| Built with | QAIRT 2.51.200.261021, fp16, optimization level 3, weight sharing |
| Runtime on the device | QAIRT 2.51 or newer. An older runtime fails with Using newer context binary on old SDK (error 5000) |
| Other chips | Other SoCs (e.g. SM8550 is soc_model 43) or other DSP architectures need a rebuild from the scripts |
Limits: batch 1, at most 32 options per question, inputs up to the maximum tokens above (longer inputs are rejected, not truncated).
Results (RB5 Gen2, QAIRT 2.51 runtime)
Latency per call, one question, median; CPU is stock laya.Agent with torch fp32 on the board's
Kryo CPU. "End to end" includes tokenization and decoding on the CPU.
| Checkpoint | Tokens | NPU graph | NPU end to end | CPU | Speed-up |
|---|---|---|---|---|---|
| english | 128 | 25 ms | 49 ms | 1.29 s | 27x |
| english | 512 | 127 ms | 148 ms | 4.62 s | 31x |
| multilingual | 128 | 12 ms | 21 ms | 0.54 s | 25x |
| multilingual | 1024 | 221 ms | 245 ms | 3.59 s | 15x |
| typed-decisions | 128 | 25 ms | 49 ms | 1.25 s | 26x |
| typed-decisions | 1024 | 416 ms | 435 ms | 8.00 s | 18x |
Agreement with the CPU on 12 texts x 4 questions per checkpoint: 48/48 identical answers, probability difference 0.0005-0.0007 on average (fp16 vs fp32). Sustained 5 minutes at 128 tokens: about 20 decisions per second with no slowdown. Accuracy is Laya's own; the NPU reproduces the CPU, it does not improve on it.
How to run
You need the QAIRT 2.51 runtime libraries on the device. They are not included here: download
the SDK from Qualcomm (free, account required) and copy libQnnHtp.so, libQnnSystem.so,
libQnnHtpV73Stub.so, libQnnHtpPrepare.so and libQnnHtpV73Skel.so as described in the code
code repository. The runner (libqnnrt.so) and NPUAgent / NPURouter, which wrap upstream Laya's own
agent so tokenization, the small head, calibration and decoding stay unchanged, are in the
repository below.
from laya_npu import NPURouter # from the code repository
router = NPURouter() # one NPUAgent per models/<name>.bin
print(router.predict("We were billed twice for March. Refund it today or we cancel.", {
"department": {"type": "choice", "instructions": "Which department should handle this?",
"criteria": {"billing": "invoices, payments, refunds",
"technical": "bugs, outages, errors", "other": "everything else"}},
"churn_risk": {"type": "noul", "instructions": "Does the customer threaten to leave?"}}))
Rebuild it yourself
Export (ONNX, static shapes), compile (QAIRT, offline on x86_64 Linux) and runtime scripts, with a step-by-step recipe, are in the code repository (Apache-2.0). Two clean runs a day apart produced byte-identical binaries.
Licenses and attribution
- Weights: derived from Laya by Convai Innovations (Apache-2.0), itself fine-tuned from ModernBERT-large and mmBERT-base. These files are a modified form of those weights (fp16, compiled for the HTP) and are released under Apache-2.0, the same licence as the original. Please also check the licences of the base models.
- Qualcomm software: the binaries were produced with the Qualcomm AI Runtime (QAIRT) SDK, and running them needs its runtime libraries. Those are Qualcomm software under the Qualcomm AI Stack License that ships with the SDK; no SDK file is redistributed here. Use of QAIRT is subject to that licence, including its prohibited and high-risk use cases (for example social scoring, employment, or access to essential services). Laya is a decision model: keep those restrictions in mind.
- Not affiliated with or endorsed by Qualcomm Technologies, Inc. or Convai Innovations.
Model tree for kadamiak-consultred/laya-qcs8550-npu
Base model
convaiinnovations/laya