Machine learning and AI with ONNX in SQL Edge
Important
Azure SQL Edge will be retired on September 30, 2025. For more information and migration options, see the Retirement notice.
Note
Azure SQL Edge no longer supports the ARM64 platform.
Machine learning in Azure SQL Edge supports models in the Open Neural Network Exchange (ONNX) format. ONNX is an open format you can use to interchange models between various machine learning frameworks and tools.
Overview
To infer machine learning models in Azure SQL Edge, you first need to get a model. This can be a pretrained model or a custom model trained with your framework of choice. Azure SQL Edge supports the ONNX format and you need to convert the model to this format. There should be no effect on model accuracy, and once you have the ONNX model, you can deploy the model in Azure SQL Edge and use native scoring with the PREDICT T-SQL function.
Get ONNX models
To obtain a model in the ONNX format:
Model Building Services: Services such as the automated Machine Learning feature in Azure Machine Learning support directly exporting the trained model in the ONNX format.
Convert and/or export existing models: Several training frameworks (for example, PyTorch, Chainer, and Caffe2) support native export functionality to ONNX, which allows you to save your trained model to a specific version of the ONNX format. For frameworks that don't support native export, there are standalone ONNX Converter installable packages that enable you to convert models trained from different machine learning frameworks to the ONNX format.
Supported frameworks
-
For the full list of supported frameworks and examples, see Converting to ONNX format.
Limitations
Currently, not all ONNX models are supported by Azure SQL Edge. The support is limited to models with numeric data types:
Other numeric types can be converted to supported types by using CAST and CONVERT.
The model inputs should be structured so that each input to the model corresponds to a single column in a table. For example, if you're using a pandas dataframe to train a model, then each input should be a separate column to the model.