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 | float | Universal | QAIRT 2.51, ONNX Runtime 1.30.0 | Download |
| ONNX | w8a16 | Universal | QAIRT 2.51, ONNX Runtime 1.30.0 | Download |
| QNN_DLC | float | Universal | QAIRT 2.51 | Download |
| QNN_DLC | w8a16 | Universal | QAIRT 2.51 | Download |
| TFLITE | float | Universal | QAIRT 2.51 | 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:
- Input resolution: 1x384
- Model checkpoint: google-bert/bert-base-uncased
- Model size (float): 418 MB
- Number of parameters: 110M
Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |
|---|---|---|---|---|---|---|
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 6.506 ms | 0 - 320 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 8.645 ms | 0 - 315 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® X2 Elite | 7.412 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® X Elite | 18.112 ms | 259 - 259 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 12.268 ms | 0 - 481 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 26.427 ms | 0 - 444 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 24.312 ms | 0 - 4 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 17.177 ms | 0 - 322 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Qualcomm® QCS8450 | 26.427 ms | 0 - 444 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 22.788 ms | 0 - 4 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 18.112 ms | 259 - 259 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 8.645 ms | 0 - 315 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® 8 Elite Extreme Gen 6 Mobile | 5.882 ms | 0 - 313 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | float | Snapdragon® 8 Elite Gen 6 Mobile | 6.887 ms | 0 - 287 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 4.894 ms | 0 - 401 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 6.71 ms | 0 - 393 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® X2 Elite | 5.459 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® X Elite | 13.354 ms | 154 - 154 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 9.058 ms | 0 - 510 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Gen 1 Mobile | 16.848 ms | 0 - 514 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 78.037 ms | 48 - 51 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 11.968 ms | 0 - 4 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 12.666 ms | 0 - 163 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® QCS8450 | 16.848 ms | 0 - 514 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 12.61 ms | 0 - 4 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 13.354 ms | 154 - 154 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-6690 | 204.483 ms | 47 - 547 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-7790 | 27.756 ms | 48 - 486 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 6.71 ms | 0 - 393 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 27.756 ms | 48 - 486 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Elite Extreme Gen 6 Mobile | 5.121 ms | 0 - 445 MB | NPU |
| Bert-Base-Uncased-Hf | ONNX | w8a16 | Snapdragon® 8 Elite Gen 6 Mobile | 5.506 ms | 0 - 401 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 6.498 ms | 0 - 315 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 8.574 ms | 0 - 310 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® X2 Elite | 7.766 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® X Elite | 18.224 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 12.242 ms | 0 - 478 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 26.372 ms | 0 - 435 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 24.551 ms | 0 - 3 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 17.143 ms | 0 - 2 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® QCS8450 | 26.372 ms | 0 - 435 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 22.948 ms | 0 - 2 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 18.224 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 8.574 ms | 0 - 310 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Elite Extreme Gen 6 Mobile | 5.838 ms | 0 - 310 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | float | Snapdragon® 8 Elite Gen 6 Mobile | 6.888 ms | 0 - 283 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 5.142 ms | 0 - 404 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 6.83 ms | 0 - 398 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 6.007 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® X Elite | 13.934 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 7.289 ms | 0 - 512 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 12.892 ms | 0 - 3 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 13.074 ms | 0 - 408 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® SA8650P | 12.964 ms | 0 - 437 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® SA8255P | 12.964 ms | 0 - 437 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 13.387 ms | 0 - 2 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 13.934 ms | 1 - 1 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 6.83 ms | 0 - 398 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Elite Extreme Gen 6 Mobile | 4.522 ms | 0 - 447 MB | NPU |
| Bert-Base-Uncased-Hf | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 6 Mobile | 5.542 ms | 0 - 403 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 6.571 ms | 0 - 330 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 8.686 ms | 0 - 322 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 12.236 ms | 0 - 483 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 26.496 ms | 0 - 439 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 24.18 ms | 0 - 260 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 17.26 ms | 0 - 3 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA8650P | 22.416 ms | 0 - 305 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA8255P | 22.416 ms | 0 - 305 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® QCS8450 | 26.496 ms | 0 - 439 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 22.669 ms | 0 - 260 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 8.686 ms | 0 - 322 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Qualcomm® SA8295P | 27.422 ms | 0 - 313 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Elite Extreme Gen 6 Mobile | 5.855 ms | 0 - 320 MB | NPU |
| Bert-Base-Uncased-Hf | TFLITE | float | Snapdragon® 8 Elite Gen 6 Mobile | 6.908 ms | 0 - 295 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.
