Bert-Base-Uncased-Hf: Optimized for Qualcomm Devices
Bert is a lightweight BERT model designed for efficient self-supervised learning of language representations. It can be used for masked language modeling and as a backbone for various NLP tasks.
This is based on the implementation of Bert-Base-Uncased-Hf found here. This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the Qualcomm® AI Hub Models library to export with custom configurations. More details on model performance across various devices, can be found here.
Qualcomm AI Hub Models uses Qualcomm AI Hub Workbench to compile, profile, and evaluate this model. Sign up to run these models on a hosted Qualcomm® device.
Getting Started
There are two ways to deploy this model on your device:
Option 1: Download Pre-Exported Models
Below are pre-exported model assets ready for deployment.
| Runtime | Precision | Chipset | SDK Versions | Download |
|---|---|---|---|---|
| ONNX | w8a16 | Universal | QAIRT 2.45, ONNX Runtime 1.27.1 | Download |
| QNN_DLC | float | Universal | QAIRT 2.45 | Download |
| QNN_DLC | w8a16 | Universal | QAIRT 2.45 | Download |
| TFLITE | float | Universal | QAIRT 2.45 | Download |
For more device-specific assets and performance metrics, visit Bert-Base-Uncased-Hf on Qualcomm® AI Hub.
Option 2: Export with Custom Configurations
Use the Qualcomm® AI Hub Models Python library to compile and export the model with your own:
- Custom weights (e.g., fine-tuned checkpoints)
- Custom input shapes
- Target device and runtime configurations
This option is ideal if you need to customize the model beyond the default configuration provided here.
See our repository for Bert-Base-Uncased-Hf on GitHub for usage instructions.
Model Details
Model Type: Model_use_case.text_generation
Model Stats:
- Model checkpoint: google-bert/bert-base-uncased
- Input resolution: 1x384
- Number of parameters: 110M
- Model size (float): 418 MB
Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |
|---|---|---|---|---|---|---|
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® X2 Elite | 4.869 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® X Elite | 10.47 ms | 153 - 153 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 7.043 ms | 0 - 521 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Gen 1 Mobile | 18.372 ms | 0 - 527 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 66.945 ms | 13 - 16 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 9.969 ms | 0 - 4 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® QCS8450 | 18.372 ms | 0 - 527 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 9.715 ms | 0 - 3 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 10.47 ms | 153 - 153 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 6.141 ms | 0 - 455 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Elite Mobile | 6.141 ms | 0 - 455 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 4.608 ms | 0 - 462 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® X2 Elite | 9.894 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® X Elite | 21.048 ms | 0 - 0 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 16.28 ms | 0 - 653 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 41.311 ms | 0 - 491 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8275 | 79.445 ms | 0 - 473 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 21.83 ms | 0 - 732 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® SA8775P | 27.095 ms | 0 - 474 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® SA8650P | 27.095 ms | 0 - 474 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® SA8255P | 27.095 ms | 0 - 474 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® QCS8450 | 41.311 ms | 0 - 491 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 26.58 ms | 0 - 2 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 21.048 ms | 0 - 0 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 11.032 ms | 0 - 469 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® SA7255P | 79.445 ms | 0 - 473 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® SA8295P | 35.205 ms | 0 - 287 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 11.032 ms | 0 - 469 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 8.762 ms | 0 - 492 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 5.335 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® X Elite | 11.551 ms | 0 - 0 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 7.478 ms | 0 - 521 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS8275 | 26.027 ms | 0 - 443 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 10.85 ms | 0 - 2 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® SA8775P | 10.754 ms | 0 - 445 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® SA8650P | 10.754 ms | 0 - 445 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® SA8255P | 10.754 ms | 0 - 445 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 10.542 ms | 0 - 2 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 11.551 ms | 0 - 0 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 6.085 ms | 0 - 459 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® SA7255P | 26.027 ms | 0 - 443 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Elite Mobile | 6.085 ms | 0 - 459 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 4.468 ms | 0 - 464 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 16.414 ms | 0 - 657 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 33.286 ms | 0 - 493 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ QCS8275 | 79.83 ms | 0 - 486 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 21.388 ms | 0 - 3 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA8775P | 27.18 ms | 0 - 488 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA8650P | 27.18 ms | 0 - 488 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA8255P | 27.18 ms | 0 - 488 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® QCS8450 | 33.286 ms | 0 - 493 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 27.001 ms | 0 - 259 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 11.249 ms | 0 - 486 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA7255P | 79.83 ms | 0 - 486 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA8295P | 34.693 ms | 0 - 289 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Elite Mobile | 11.249 ms | 0 - 486 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 8.997 ms | 0 - 504 MB | NPU |
License
- The license for the original implementation of Bert-Base-Uncased-Hf can be found here.
References
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
- Source Model Implementation
Community
- Join our AI Hub Slack community to collaborate, post questions and learn more about on-device AI.
- For questions or feedback please reach out to us.
