--- library_name: pytorch license: other tags: - backbone - android pipeline_tag: text-generation --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/albert_base_v2_hf/web-assets/model_demo.png) # Albert-Base-V2-Hf: Optimized for Qualcomm Devices ALBERT 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 Albert-Base-V2-Hf found [here](https://github.com/google-research/albert). This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.60.0/src/qai_hub_models/models/albert_base_v2_hf) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary). Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) 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 | |---|---|---|---|---| | QNN_DLC | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/albert_base_v2_hf/releases/v0.60.0/albert_base_v2_hf-qnn_dlc-float.zip) | TFLITE | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/albert_base_v2_hf/releases/v0.60.0/albert_base_v2_hf-tflite-float.zip) For more device-specific assets and performance metrics, visit **[Albert-Base-V2-Hf on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/albert_base_v2_hf)**. ### Option 2: Export with Custom Configurations Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.60.0/src/qai_hub_models/models/albert_base_v2_hf) 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 [Albert-Base-V2-Hf on GitHub](https://github.com/qualcomm/ai-hub-models/blob/v0.60.0/src/qai_hub_models/models/albert_base_v2_hf) for usage instructions. ## Model Details **Model Type:** Model_use_case.text_generation **Model Stats:** - Input resolution: 1x384 - Model checkpoint: albert/albert-base-v2 - Model size (float): 43.9 MB - Number of parameters: 11.8M ## Performance Summary | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |---|---|---|---|---|---|--- | Albert-Base-V2-Hf | QNN_DLC | float | Snapdragon® X2 Elite | 8.037 ms | 1 - 1 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Snapdragon® X Elite | 18.258 ms | 1 - 1 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 12.549 ms | 0 - 357 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 31.832 ms | 0 - 326 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 23.485 ms | 0 - 2 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 68.849 ms | 0 - 324 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 17.581 ms | 0 - 12 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® SA8775P | 21.928 ms | 0 - 307 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® SA8650P | 21.928 ms | 0 - 307 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® SA8255P | 21.928 ms | 0 - 307 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® QCS8450 | 31.832 ms | 0 - 326 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 21.804 ms | 0 - 2 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 18.258 ms | 1 - 1 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 9.37 ms | 0 - 313 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® SA7255P | 68.849 ms | 0 - 324 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Qualcomm® SA8295P | 27.648 ms | 0 - 334 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 9.37 ms | 0 - 313 MB | NPU | Albert-Base-V2-Hf | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 7.169 ms | 0 - 340 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 13.057 ms | 0 - 376 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 32.374 ms | 0 - 370 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 69.477 ms | 0 - 339 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 17.093 ms | 0 - 6 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® SA8775P | 22.064 ms | 0 - 338 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® SA8650P | 22.064 ms | 0 - 338 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® SA8255P | 22.064 ms | 0 - 338 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® QCS8450 | 32.374 ms | 0 - 370 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 22.499 ms | 0 - 32 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 9.677 ms | 0 - 314 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® SA7255P | 69.477 ms | 0 - 339 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Qualcomm® SA8295P | 27.896 ms | 0 - 327 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Snapdragon® 8 Elite Mobile | 9.677 ms | 0 - 314 MB | NPU | Albert-Base-V2-Hf | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 7.479 ms | 0 - 332 MB | NPU ## License * The license for the original implementation of Albert-Base-V2-Hf can be found [here](https://github.com/google-research/albert/blob/master/LICENSE). ## References * [ALBERT: A Lite BERT for Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942) * [Source Model Implementation](https://github.com/google-research/albert) ## Community * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI. * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).