MiniLM-v2

0 downloads 0 likes on ModelScope updated

Model card

MiniLM-v2: Optimized for Qualcomm Devices

All-MiniLM-L6-v2 maps sentences to a 384-dimensional dense vector space. Trained on 1B+ sentence pairs, it excels at semantic search, clustering, and sentence similarity tasks while being small enough to run on mobile devices.

This is based on the implementation of MiniLM-v2 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.45, ONNX Runtime 1.27.1 Download
ONNX w8a8 Universal QAIRT 2.45, ONNX Runtime 1.27.1 Download
QNN_DLC float Universal QAIRT 2.45 Download
QNN_DLC w8a8 Universal QAIRT 2.45 Download
TFLITE float Universal QAIRT 2.45 Download
TFLITE w8a8 Universal QAIRT 2.45 Download

For more device-specific assets and performance metrics, visit MiniLM-v2 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 MiniLM-v2 on GitHub for usage instructions.

Model Details

Model Type: Model_use_case.text_generation

Model Stats:

  • Embedding dimension: 384
  • Input resolution: 128 tokens
  • Model checkpoint: sentence-transformers/all-MiniLM-L6-v2
  • Model size (float): 86.7 MB
  • Number of parameters: 22.7M

Performance Summary

Model Runtime Precision Chipset Inference Time (ms) Peak Memory Range (MB) Primary Compute Unit
MiniLM-v2 ONNX float Snapdragon® X2 Elite 0.671 ms 1 - 1 MB NPU
MiniLM-v2 ONNX float Snapdragon® X Elite 1.676 ms 44 - 44 MB NPU
MiniLM-v2 ONNX float Snapdragon® 8 Gen 3 Mobile 1.123 ms 0 - 106 MB NPU
MiniLM-v2 ONNX float Snapdragon® 8 Gen 1 Mobile 2.361 ms 0 - 106 MB NPU
MiniLM-v2 ONNX float Qualcomm® Dragonwing™ IQ-8275 1.781 ms 0 - 3 MB NPU
MiniLM-v2 ONNX float Qualcomm® Dragonwing™ QCS8550 (Proxy) 1.616 ms 0 - 50 MB NPU
MiniLM-v2 ONNX float Qualcomm® QCS8450 2.361 ms 0 - 106 MB NPU
MiniLM-v2 ONNX float Qualcomm® Dragonwing™ IQ-9075 1.864 ms 0 - 3 MB NPU
MiniLM-v2 ONNX float Qualcomm® Dragonwing™ IQ-X7181 1.676 ms 44 - 44 MB NPU
MiniLM-v2 ONNX float Qualcomm® Dragonwing™ Q-8750 0.793 ms 0 - 58 MB NPU
MiniLM-v2 ONNX float Snapdragon® 8 Elite Mobile 0.793 ms 0 - 58 MB NPU
MiniLM-v2 ONNX float Snapdragon® 8 Elite Gen 5 Mobile 0.64 ms 0 - 62 MB NPU
MiniLM-v2 ONNX w8a8 Snapdragon® X2 Elite 0.671 ms 1 - 1 MB NPU
MiniLM-v2 ONNX w8a8 Snapdragon® X Elite 1.779 ms 23 - 23 MB NPU
MiniLM-v2 ONNX w8a8 Snapdragon® 8 Gen 3 Mobile 1.192 ms 0 - 87 MB NPU
MiniLM-v2 ONNX w8a8 Snapdragon® 8 Gen 1 Mobile 1.985 ms 0 - 88 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ QCS6490 5.548 ms 0 - 3 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ IQ-8275 1.674 ms 0 - 3 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ QCS8550 (Proxy) 1.703 ms 0 - 153 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® QCS8450 1.985 ms 0 - 88 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ IQ-9075 1.797 ms 0 - 3 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ IQ-X7181 1.779 ms 23 - 23 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ Q-6690 6.686 ms 0 - 60 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ Q-7790 1.957 ms 0 - 54 MB NPU
MiniLM-v2 ONNX w8a8 Qualcomm® Dragonwing™ Q-8750 0.843 ms 0 - 56 MB NPU
MiniLM-v2 ONNX w8a8 Snapdragon® 8 Elite Mobile 0.843 ms 0 - 56 MB NPU
MiniLM-v2 ONNX w8a8 Snapdragon® 8 Elite Gen 5 Mobile 0.66 ms 0 - 57 MB NPU
MiniLM-v2 ONNX w8a8 Snapdragon® 7 Gen 4 Mobile 1.957 ms 0 - 54 MB NPU
MiniLM-v2 QNN_DLC float Snapdragon® X2 Elite 0.671 ms 1 - 1 MB NPU
MiniLM-v2 QNN_DLC float Snapdragon® X Elite 1.296 ms 1 - 1 MB NPU
MiniLM-v2 QNN_DLC float Snapdragon® 8 Gen 3 Mobile 0.791 ms 38 - 136 MB NPU
MiniLM-v2 QNN_DLC float Snapdragon® 8 Gen 1 Mobile 1.892 ms 0 - 101 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® Dragonwing™ IQ-8275 1.323 ms 0 - 2 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® Dragonwing™ QCS8550 (Proxy) 1.118 ms 0 - 2 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® SA8775P 1.513 ms 0 - 59 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® SA8650P 1.513 ms 0 - 59 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® SA8255P 1.513 ms 0 - 59 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® QCS8450 1.892 ms 0 - 101 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® Dragonwing™ IQ-9075 1.391 ms 2 - 4 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® Dragonwing™ IQ-X7181 1.296 ms 1 - 1 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® Dragonwing™ Q-8750 0.568 ms 0 - 59 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® SA7255P 3.596 ms 0 - 59 MB NPU
MiniLM-v2 QNN_DLC float Qualcomm® SA8295P 2.301 ms 0 - 57 MB NPU
MiniLM-v2 QNN_DLC float Snapdragon® 8 Elite Mobile 0.568 ms 0 - 59 MB NPU
MiniLM-v2 QNN_DLC float Snapdragon® 8 Elite Gen 5 Mobile 0.455 ms 0 - 58 MB NPU
MiniLM-v2 QNN_DLC w8a8 Snapdragon® X2 Elite 0.812 ms 0 - 0 MB NPU
MiniLM-v2 QNN_DLC w8a8 Snapdragon® X Elite 1.914 ms 1 - 1 MB NPU
MiniLM-v2 QNN_DLC w8a8 Snapdragon® 8 Gen 3 Mobile 1.219 ms 0 - 73 MB NPU
MiniLM-v2 QNN_DLC w8a8 Snapdragon® 8 Gen 1 Mobile 1.962 ms 0 - 69 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ QCS6490 4.011 ms 0 - 2 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ IQ-8275 1.654 ms 0 - 2 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ QCS8550 (Proxy) 1.718 ms 0 - 2 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® SA8775P 1.931 ms 0 - 50 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® SA8650P 1.931 ms 0 - 50 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® SA8255P 1.931 ms 0 - 50 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® QCS8450 1.962 ms 0 - 69 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ IQ-9075 1.819 ms 0 - 2 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ IQ-X7181 1.914 ms 1 - 1 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ Q-6690 6.118 ms 0 - 50 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ Q-7790 1.698 ms 0 - 47 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® Dragonwing™ Q-8750 0.838 ms 0 - 49 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® SA7255P 3.423 ms 0 - 48 MB NPU
MiniLM-v2 QNN_DLC w8a8 Qualcomm® SA8295P 2.38 ms 0 - 46 MB NPU
MiniLM-v2 QNN_DLC w8a8 Snapdragon® 8 Elite Mobile 0.838 ms 0 - 49 MB NPU
MiniLM-v2 QNN_DLC w8a8 Snapdragon® 8 Elite Gen 5 Mobile 0.685 ms 0 - 53 MB NPU
MiniLM-v2 QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 1.698 ms 0 - 47 MB NPU
MiniLM-v2 TFLITE float Snapdragon® 8 Gen 3 Mobile 0.82 ms 0 - 102 MB NPU
MiniLM-v2 TFLITE float Snapdragon® 8 Gen 1 Mobile 1.956 ms 0 - 101 MB NPU
MiniLM-v2 TFLITE float Qualcomm® Dragonwing™ IQ-8275 1.377 ms 0 - 46 MB NPU
MiniLM-v2 TFLITE float Qualcomm® Dragonwing™ QCS8550 (Proxy) 1.146 ms 0 - 2 MB NPU
MiniLM-v2 TFLITE float Qualcomm® SA8775P 1.568 ms 0 - 65 MB NPU
MiniLM-v2 TFLITE float Qualcomm® SA8650P 1.568 ms 0 - 65 MB NPU
MiniLM-v2 TFLITE float Qualcomm® SA8255P 1.568 ms 0 - 65 MB NPU
MiniLM-v2 TFLITE float Qualcomm® QCS8450 1.956 ms 0 - 101 MB NPU
MiniLM-v2 TFLITE float Qualcomm® Dragonwing™ IQ-9075 1.414 ms 0 - 45 MB NPU
MiniLM-v2 TFLITE float Qualcomm® Dragonwing™ Q-8750 0.594 ms 0 - 66 MB NPU
MiniLM-v2 TFLITE float Qualcomm® SA7255P 3.721 ms 0 - 62 MB NPU
MiniLM-v2 TFLITE float Qualcomm® SA8295P 2.354 ms 0 - 56 MB NPU
MiniLM-v2 TFLITE float Snapdragon® 8 Elite Mobile 0.594 ms 0 - 66 MB NPU
MiniLM-v2 TFLITE float Snapdragon® 8 Elite Gen 5 Mobile 0.482 ms 0 - 60 MB NPU
MiniLM-v2 TFLITE w8a8 Snapdragon® 8 Gen 3 Mobile 1.671 ms 0 - 80 MB NPU
MiniLM-v2 TFLITE w8a8 Snapdragon® 8 Gen 1 Mobile 2.612 ms 0 - 81 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® Dragonwing™ QCS6490 17.056 ms 0 - 30 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® Dragonwing™ IQ-8275 2.256 ms 0 - 25 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® Dragonwing™ QCS8550 (Proxy) 2.364 ms 0 - 3 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® SA8775P 2.682 ms 0 - 59 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® SA8650P 2.682 ms 0 - 59 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® SA8255P 2.682 ms 0 - 59 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® QCS8450 2.612 ms 0 - 81 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® Dragonwing™ IQ-9075 2.506 ms 0 - 24 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® Dragonwing™ Q-6690 12.129 ms 0 - 37 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® Dragonwing™ Q-7790 5.05 ms 0 - 35 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® Dragonwing™ Q-8750 1.135 ms 0 - 58 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® SA7255P 4.601 ms 0 - 55 MB NPU
MiniLM-v2 TFLITE w8a8 Qualcomm® SA8295P 3.197 ms 0 - 48 MB NPU
MiniLM-v2 TFLITE w8a8 Snapdragon® 8 Elite Mobile 1.135 ms 0 - 58 MB NPU
MiniLM-v2 TFLITE w8a8 Snapdragon® 8 Elite Gen 5 Mobile 0.945 ms 0 - 55 MB NPU
MiniLM-v2 TFLITE w8a8 Snapdragon® 7 Gen 4 Mobile 5.05 ms 0 - 35 MB NPU

License

  • The license for the original implementation of MiniLM-v2 can be found here.

References

Community