OnQ Blog

Guest blog: Introducing Qualcomm Snapdragon Math Libraries

29 Apr 2016

Qualcomm products mentioned within this post are offered by Qualcomm Technologies, Inc. and/or its subsidiaries.

Matthew Badin is the technical lead for the Qualcomm Snapdragon Math Libraries and the author of the BLAS implementation offered as part of QSML. Matthew is a member of Qualcomm Research Silicon Valley where he works with universities and other business units to support math primitives on Qualcomm silicon. Read on to get Matthew's thoughts on Qualcomm Snapdragon Math LibrariesMath primitives optimized for Snapdragon processors.

It’s not easy to build low-level math and high performance into the same mobile app. Linear algebra operations like matrix, vector and scalar operations are resource-intensive, implementing them while keeping the device responsive is difficult.

To help address this problem, we offer Qualcomm Snapdragon Math Libraries (QSML) with high-performance implementations of more than 200 Basic Linear Algebra Subprograms (BLAS) primitives optimized for all generations of Qualcomm Snapdragon processors.

You can download the installer (Windows, OS X or Linux) now, compile for ARM and link QSML instead of OpenBLAS or ATLAS. Load the app onto any Snapdragon-powered device and you’ll see for yourself how much better it executes low-level math routines.

Because QSML supports the standard BLAS interfaces, frameworks like Eigen are able to use QSML as a backend. This allows you to easily take advantage of the performance offered by QSML without making any changes to your code. The difference is QSML takes full advantage of the Snapdragon CPU.

A New Option For Linear Algebra And Predictive Apps On Mobile

This graphic shows relative performance between QSML and stock Eigen for single- (SGEMM) and double- (DGEMM) precision general matrix-matrix multiply:

The results, based on Qualcomm Technologies Inc. (QTI) internal tests, show as much as 5x better performance when using QSML on Snapdragon as compared to Eigen on Snapdragon. The performance delta is relatively steady from a shallow (K=64) matrix product up to a deeper (K=128) product, demonstrating how evenly the implementation can scale.

QSML shortens your development time, allowing quicker to commercial solutions:

  • QSML lets you focus on what differentiates your application: We worry about the performance and correctness of the math primitives so you don’t have to. We support over 200 primitives, with more expected to come, so you can focus on the high level algorithms and features.
  • Portable across Snapdragon platforms: Want to move your neural network from Android to the Snapdragon Flight Drone Development Platform? We’ve got you covered. Experiment, iterate, and innovate. We make sure your solution runs well across Snapdragon platforms.
  • Tailored to the microarchitecture: We tailor our code for each generation of Snapdragon, making sure your application gets the best performance not only on the latest generation, but across generations.

As mobile devices get more powerful, it becomes possible to bring resource-intensive linear algebra out of the cloud and into native apps for prediction, machine learning, and neural networks. Developers trying to build those mobile apps have asked us for Snapdragon-optimized math libraries to give them the performance they need.

QSML Use Cases: Deep Learning, Neural Networks

If you’re using a deep-learning library or framework like Torch, Theano or Caffe, and you want to enable it on Snapdragon, QSML is the best way to do it. QSML helps accelerate and enable machine learning algorithms on Qualcomm Technologies devices, algorithms that used to be confined to the cloud.

Silk Labs was the Developer of the Month for April on the Qualcomm Developer Network (QDN) blog. Its IoT device, Sense, uses QSML. Wayne Lee of Silk Labs says, “We are running complex neural networks locally on the device to detect faces, objects and sounds. Performance is super-important and we’ve used QSML as a simple drop-in replacement for OpenBLAS. The resulting, significant performance gains allow us to run our networks much faster."

Next Steps

Don’t want to run your predictive app in the cloud? Take advantage of the performance increase from QSML and run your app on mobile devices.

Qualcomm Snapdragon and Qualcomm Snapdragon Flight are products of Qualcomm Technologies, Inc.


Engage with us on