Skip to content

Commit c29fc9f

Browse files
Merge pull request #116143 from garyericson/05-21-mi-ml-in-new-scheme
ASQLMI: Adding ML to MI TOC
2 parents 30082dd + 098b1c7 commit c29fc9f

File tree

6 files changed

+256
-4
lines changed

6 files changed

+256
-4
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- name: Azure
2+
tocHref: /sql/
3+
topicHref: /azure/index
4+
items:
5+
- name: SQL Managed Instance
6+
tocHref: /sql/
7+
topicHref: /azure/azure-sql/managed-instance
8+
items:
9+
- name: Machine Learning
10+
tocHref: /sql/machine-learning/
11+
topicHref: /azure/azure-sql/managed-instance/machine-learning-services-overview
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### YamlMime:ContextObject
2+
brand: azure
3+
uhfHeaderId: azure
4+
breadcrumb_path: ../bread/toc.yml
5+
toc_rel: ../../toc.yml
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: Key differences for Machine Learning Services (preview)
3+
description: This topic describes key differences between Machine Learning Services in Azure SQL Managed Instance and SQL Server Machine Learning Services.
4+
services: sql-database
5+
ms.service: sql-database
6+
ms.subservice: machine-learning
7+
ms.custom:
8+
ms.devlang:
9+
ms.topic: conceptual
10+
author: garyericson
11+
ms.author: garye
12+
ms.reviewer: carlrab, davidph
13+
manager: cgronlun
14+
ms.date: 05/27/2020
15+
---
16+
17+
# Key differences between Machine Learning Services in Azure SQL Managed Instance and SQL Server
18+
19+
The functionality of [Machine Learning Services in Azure SQL Managed Instance (preview)](machine-learning-services-overview.md) is nearly identical to [SQL Server Machine Learning Services](https://docs.microsoft.com/sql/advanced-analytics/what-is-sql-server-machine-learning). Following are some key differences.
20+
21+
> [!IMPORTANT]
22+
> Machine Learning Services in Azure SQL Managed Instance is currently in public preview. To sign up, see [Sign up for the preview](machine-learning-services-overview.md#signup).
23+
24+
## Preview limitations
25+
26+
During the preview, the service has the following limitations:
27+
28+
- Loopback connections do not work (see [Loopback connection to SQL Server from a Python or R script](/sql/machine-learning/connect/loopback-connection)).
29+
- External Resource pools are not supported.
30+
- Only Python and R are supported. External languages such as Java cannot be added.
31+
- Scenarios using the [Message Passing Interface](https://docs.microsoft.com/message-passing-interface/microsoft-mpi) (MPI) are not supported.
32+
33+
In case of a Service Level Objective (SLO) update, please update the SLO and raise a support ticket to re-enable the dedicated resource limits for R/Python.
34+
35+
## Language support
36+
37+
Machine Learning Services in SQL Managed Instance and SQL Server support both Python and R [extensibility framework](https://docs.microsoft.com/sql/advanced-analytics/concepts/extensibility-framework). The key differences are:
38+
39+
- The initial versions of Python and R are different between Machine Learning Services in SQL Managed Instance and SQL Server:
40+
41+
| | Python | R |
42+
|----------------------|--------|-------|
43+
| SQL Managed Instance | 3.7.1 | 3.5.2 |
44+
| SQL Server | 3.5.2 | 3.3.3 |
45+
46+
- There is no need to configure `external scripts enabled` via `sp_configure`. Once you are [signed up](machine-learning-services-overview.md#signup) for the preview, machine learning is enabled for your SQL database.
47+
48+
## Packages
49+
50+
Python and R package management work differently between SQL Managed Instance and SQL Server. These differences are:
51+
52+
- Packages cannot perform outbound network calls. This limitation is similar to the [default firewall rules for Machine Learning Services](https://docs.microsoft.com//sql/advanced-analytics/security/firewall-configuration) in SQL Server, but can't be changed in SQL Managed Instance.
53+
- There is no support for packages that depend on external runtimes (like Java) or need access to OS APIs for installation or usage.
54+
55+
For more information about managing Python and R packages, see:
56+
57+
- [Get Python package information](https://docs.microsoft.com/sql/machine-learning/package-management/python-package-information?context=azure/sql-database/context/ml-context&view=sql-server-ver15)
58+
- [Get R package information](https://docs.microsoft.com/sql/machine-learning/package-management/r-package-information?context=azure/sql-database/context/ml-context&view=sql-server-ver15)
59+
60+
## Resource governance
61+
62+
It is not possible to limit R resources through [Resource Governor](https://docs.microsoft.com/sql/relational-databases/resource-governor/resource-governor) and external resource pools.
63+
64+
During the public preview, R resources are set to a maximum of 20% of the SQL Managed Instance resources, and depend on which service tier you choose. For more information, see [Azure SQL Database purchasing models](https://docs.microsoft.com/azure/sql-database/sql-database-service-tiers).
65+
66+
### Insufficient memory error
67+
68+
If there is insufficient memory available for R, you will get an error message. Common error messages are:
69+
70+
- Unable to communicate with the runtime for 'R' script for request id: *******. Please check the requirements of 'R' runtime
71+
- 'R' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004. ...an external script error occurred: "..could not allocate memory (0 Mb) in C function 'R_AllocStringBuffer'"
72+
- An external script error occurred: Error: cannot allocate vector of size.
73+
74+
Memory usage depends on how much is used in your R scripts and the number of parallel queries being executed. If you receive the errors above, you can scale your database to a higher service tier to resolve this.
75+
76+
## Next steps
77+
78+
- See the overview, [Machine Learning Services in Azure SQL Managed Instance](machine-learning-services-overview.md).
79+
- To learn how to use Python in Machine Learning Services, see [Run Python scripts](https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-python-create-script?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15).
80+
- To learn how to use R in Machine Learning Services, see [Run R scripts](https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-r-create-script?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15).
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Machine Learning Services in Azure SQL Managed Instance (preview)
3+
description: This article provides an overview or Machine Learning Services in Azure SQL Managed Instance.
4+
services: sql-database
5+
ms.service: sql-database
6+
ms.subservice: machine-learning
7+
ms.custom:
8+
ms.devlang:
9+
ms.topic: conceptual
10+
author: garyericson
11+
ms.author: garye
12+
ms.reviewer: carlrab, davidph
13+
manager: cgronlun
14+
ms.date: 05/27/2020
15+
---
16+
17+
# Machine Learning Services in Azure SQL Managed Instance (preview)
18+
19+
Machine Learning Services is a feature of Azure SQL Managed Instance (preview) that provides in-database machine learning, supporting both Python and R scripts. The feature includes Microsoft Python and R packages for high-performance predictive analytics and machine learning. The relational data can be used in scripts through stored procedures, T-SQL script containing Python or R statements, or Python or R code containing T-SQL.
20+
21+
> [!IMPORTANT]
22+
> Machine Learning Services is a feature of Azure SQL Managed Instance that's currently in public preview.
23+
> This preview functionality is initially available in a limited number of regions in the US, Asia Europe, and Australia with additional regions being added later.
24+
>
25+
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
26+
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
27+
>
28+
> [Sign up for the preview](#signup) below.
29+
30+
## What is Machine Learning Services?
31+
32+
Machine Learning Services in Azure SQL Managed Instance lets you execute Python and R scripts in-database. You can use it to prepare and clean data, do feature engineering, and train, evaluate, and deploy machine learning models within a database. The feature runs your scripts where the data resides and eliminates transfer of the data across the network to another server.
33+
34+
Use Machine Learning Services with R/Python support in Azure SQL Managed Instance to:
35+
36+
- **Run R and Python scripts to do data preparation and general purpose data processing** - You can now bring your R/Python scripts to Azure SQL Managed Instance where your data lives, instead of having to move data out to some other server to run R and Python scripts. You can eliminate the need for data movement and associated problems related to latency, security, and compliance.
37+
38+
- **Train machine learning models in database** - You can train models using any open source algorithms. You can easily scale your training to the entire dataset rather than relying on sample datasets pulled out of the database.
39+
40+
- **Deploy your models and scripts into production in stored procedures** - The scripts and trained models can be operationalized simply by embedding them in T-SQL stored procedures. Apps connecting to Azure SQL Managed Instance can benefit from predictions and intelligence in these models by just calling a stored procedure. You can also use the native T-SQL PREDICT function to operationalize models for fast scoring in highly concurrent real-time scoring scenarios.
41+
42+
Base distributions of Python and R are included in Machine Learning Services. You can install and use open-source packages and frameworks, such as PyTorch, TensorFlow, and scikit-learn, in addition to the Microsoft packages [revoscalepy](https://docs.microsoft.com/sql/advanced-analytics/python/ref-py-revoscalepy) and [microsoftml](https://docs.microsoft.com/sql/advanced-analytics/python/ref-py-microsoftml) for Python, and [RevoScaleR](https://docs.microsoft.com/sql/advanced-analytics/r/ref-r-revoscaler), [MicrosoftML](https://docs.microsoft.com/sql/advanced-analytics/r/ref-r-microsoftml), [olapR](https://docs.microsoft.com/sql/advanced-analytics/r/ref-r-olapr), and [sqlrutils](https://docs.microsoft.com/sql/advanced-analytics/r/ref-r-sqlrutils) for R.
43+
44+
<a name="signup"></a>
45+
46+
## Sign up for the preview
47+
48+
This limited public preview is subject to the [Azure preview terms](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
49+
50+
If you're interested in joining the preview program and accept these terms, then you can request enrollment by creating an Azure support ticket at [https://azure.microsoft.com/support/create-ticket/](https://azure.microsoft.com/support/create-ticket/). For "Issue type" select "Technical", for "Service" select "SQL Database Managed Instance", and for "Problem type" select "Other". In your request, state that you would like to be enrolled into limited public preview of Machine Learning for SQL Managed Instance with these details: logical server name, region, and subscription ID.
51+
52+
Once you're enrolled in the program, Microsoft will onboard you to the public preview and enable Machine Learning Services for your existing or new database.
53+
54+
Machine Learning Services in SQL Managed Instance is not recommended for production workloads during the public preview.
55+
56+
## Next steps
57+
58+
- See the [key differences from SQL Server Machine Learning Services](machine-learning-services-differences.md).
59+
- To learn how to use Python in Machine Learning Services, see [Run Python scripts](https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-python-create-script?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15).
60+
- To learn how to use R in Machine Learning Services, see [Run R scripts](https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-r-create-script?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15).

articles/azure-sql/toc.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,101 @@
754754
href: managed-instance/connectivity-architecture-overview.md
755755
- name: T-SQL differences
756756
href: managed-instance/transact-sql-tsql-differences-sql-server.md
757+
758+
- name: Machine Learning Services
759+
items:
760+
- name: Overview
761+
href: managed-instance/machine-learning-services-overview.md
762+
- name: Key differences
763+
href: managed-instance/machine-learning-services-differences.md
764+
- name: Quickstarts
765+
items:
766+
- name: Python
767+
items:
768+
- name: Run Python scripts
769+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-python-create-script?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
770+
- name: Data structures and objects
771+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-python-data-structures?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
772+
- name: Python functions
773+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-python-functions?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
774+
- name: Train and score a model
775+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-python-train-score-model?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
776+
- name: R
777+
items:
778+
- name: Run R scripts
779+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-r-create-script?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
780+
- name: Data types and objects
781+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-r-data-types-and-objects?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
782+
- name: R functions
783+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-r-functions?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
784+
- name: Train and score a model
785+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/quickstart-r-train-score-model?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
786+
- name: Tutorials
787+
items:
788+
- name: Python
789+
items:
790+
- name: Ski rental (linear regression)
791+
items:
792+
- name: 1 - Introduction
793+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-ski-rental-linear-regression?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
794+
- name: 2 - Prepare data
795+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-ski-rental-linear-regression-prepare-data?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
796+
- name: 3 - Train model
797+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-ski-rental-linear-regression-train-model?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
798+
- name: 4 - Deploy model
799+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-ski-rental-linear-regression-deploy-model?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
800+
- name: Categorize customers (k-means clustering)
801+
items:
802+
- name: 1 - Introduction
803+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-clustering-model?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
804+
- name: 2 - Prepare the data
805+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-clustering-model-prepare-data?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
806+
- name: 3 - Create the model
807+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-clustering-model-build?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
808+
- name: 4 - Deploy the model
809+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/python-clustering-model-deploy?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
810+
- name: R
811+
items:
812+
- name: Ski rental (decision tree)
813+
items:
814+
- name: 1 - Introduction
815+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-predictive-model-introduction?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
816+
- name: 2 - Prepare data
817+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-predictive-model-prepare-data?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
818+
- name: 3 - Train model
819+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-predictive-model-train?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
820+
- name: 4 - Deploy model
821+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-predictive-model-deploy?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
822+
- name: Categorize customers (k-means clustering)
823+
items:
824+
- name: 1 - Introduction
825+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-clustering-model-introduction?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
826+
- name: 2 - Prepare the data
827+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-clustering-model-prepare-data?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
828+
- name: 3 - Create the model
829+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-clustering-model-build?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
830+
- name: 4 - Deploy the model
831+
href: https://docs.microsoft.com/sql/machine-learning/tutorials/r-clustering-model-deploy?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
832+
- name: Manage Python, R packages
833+
items:
834+
- name: Python
835+
items:
836+
- name: Get Python package information
837+
href: https://docs.microsoft.com/sql/machine-learning/package-management/python-package-information?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
838+
- name: Install with sqlmlutils
839+
href: https://docs.microsoft.com/sql/machine-learning/package-management/install-additional-python-packages-on-sql-server?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
840+
- name: R
841+
items:
842+
- name: Get R package information
843+
href: https://docs.microsoft.com/sql/machine-learning/package-management/r-package-information?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
844+
- name: Install with sqlmlutils
845+
href: https://docs.microsoft.com/sql/machine-learning/package-management/install-additional-r-packages-on-sql-server?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
846+
- name: Create a miniCRAN repo
847+
href: https://docs.microsoft.com/sql/machine-learning/package-management/create-a-local-package-repository-using-minicran?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
848+
- name: Tips for using R packages
849+
href: https://docs.microsoft.com/sql/machine-learning/package-management/tips-for-using-r-packages?context=/azure/azure-sql/managed-instance/context/ml-context&view=sql-server-ver15
850+
851+
757852
- name: Features
758853
items:
759854
- name: Linked servers

0 commit comments

Comments
 (0)