microsoft/SynapseML

Simple and Distributed Machine Learning Python Library porting ML algorithms for Spark

5,245

stars

1,839

commits

Scala

primary language

Sep 10, 2026

updated

aka.ms/spark
ai
apache-spark
azure
big-data
cognitive-services
databricks
data-science
deep-learning
http
lightgbm
machine-learning
microsoft
ml
model-deployment
onnx
opencv
pyspark
scala
spark
synapse
Browse cluster: MLOps platforms and data pipelines

README

SynapseML

Synapse Machine Learning

SynapseML (previously known as MMLSpark), is an open-source library that simplifies the creation of massively scalable machine learning (ML) pipelines. SynapseML provides simple, composable, and distributed APIs for a wide variety of different machine learning tasks such as text analytics, vision, anomaly detection, and many others. SynapseML is built on the Apache Spark distributed computing framework and shares the same API as the SparkML/MLLib library, allowing you to seamlessly embed SynapseML models into existing Apache Spark workflows.

With SynapseML, you can build scalable and intelligent systems to solve challenges in domains such as anomaly detection, computer vision, deep learning, text analytics, and others. SynapseML can train and evaluate models on single-node, multi-node, and elastically resizable clusters of computers. This lets you scale your work without wasting resources. SynapseML is usable across Python, R, Scala, Java, and .NET. Furthermore, its API abstracts over a wide variety of databases, file systems, and cloud data stores to simplify experiments no matter where data is located.

SynapseML publishes runtime-specific JVM artifacts: Spark 3.5 uses Scala 2.12, while Spark 4.0 and 4.1 use Scala 2.13. See the installation matrix before selecting a Maven coordinate.

TopicsLinks
BuildBuild Status codecov Code style: black
VersionVersion Release Notes Snapshot Version
DocsWebsite Scala Docs PySpark Docs Academic Paper
SupportGitter Mail
BinderBinder
UsageDownloads
Table of Contents

Features

Vowpal Wabbit on SparkThe Cognitive Services for Big DataLightGBM on SparkSpark Serving
Fast, Sparse, and Effective Text AnalyticsLeverage the Microsoft Cognitive Services at Unprecedented Scales in your existing SparkML pipelinesTrain Gradient Boosted Machines with LightGBMServe any Spark Computation as a Web Service with Sub-Millisecond Latency
HTTP on SparkONNX on SparkResponsible AISpark Binding Autogeneration
An Integration Between Spark and the HTTP Protocol, enabling Distributed Microservice OrchestrationDistributed and Hardware Accelerated Model Inference on SparkUnderstand Opaque-box Models and Measure Dataset BiasesAutomatically Generate Spark bindings for PySpark and SparklyR
Isolation Forest on SparkCyberMLConditional KNN
Distributed Nonlinear Outlier DetectionMachine Learning Tools for Cyber SecurityScalable KNN Models with Conditional Queries

Documentation and Examples

For quickstarts, documentation, demos, and examples please see our website.

Setup and installation

SynapseML installation has two parts: the language wrapper and the JVM artifacts loaded by Spark. Installing synapseml from PyPI does not add the JVM artifacts. A Python wrapper can import successfully while its JVM class is missing; using a _2.12 artifact with Spark 4 can produce errors such as LightGBMClassifier does not exist in the JVM.

Choose one complete published build from the Spark runtime. master is the canonical Spark 3.5 development line; Spark 4.0 and Spark 4.1 are maintained on their corresponding branches.

Code lineSpark runtimeScalaPython baselineRelease tagPython packageMaven coordinate
masterSpark 3.5.x2.12Python 3.11v1.1.3synapseml==1.1.3com.microsoft.azure:synapseml_2.12:1.1.3
spark4.0Spark 4.0.1+ (<4.1)2.13Python 3.12v1.1.3-spark4.0synapseml==1.1.3com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0
spark4.1Spark 4.1.x2.13Python 3.13v1.1.3-spark4.1synapseml==1.1.3com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1

Always configure https://mmlspark.blob.core.windows.net/maven, where the Spark 4 artifacts are published. See the full installation guide for platform-specific details.

Latest master snapshot

The latest successful master build targets Spark 3.5 and Scala 2.12. This copy-ready command reads the current snapshot version published by CI and starts Spark with that exact JVM build:

MASTER_VERSION="$(
  curl -fsSL https://mmlspark.blob.core.windows.net/icons/badges/master_version3.svg |
    sed -n 's/.*aria-label="master version: \([^"]*\)".*/\1/p'
)"
test -n "$MASTER_VERSION"
spark-shell \
  --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.12:${MASTER_VERSION}"

The PyPI package contains released Python wrappers. If you need Python APIs that are new on master, build the matching wheel from source.

First select the correct platform that you are installing SynapseML into:

Microsoft Fabric

In Microsoft Fabric notebooks SynapseML is already installed. The following copy-ready override targets a Spark 4.1 / Scala 2.13 runtime:

%%configure -f
{
  "name": "synapseml",
  "conf": {
      "spark.jars.packages": "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1",
      "spark.jars.repositories": "https://mmlspark.blob.core.windows.net/maven",
      "spark.jars.excludes": "org.scala-lang:scala-reflect,org.apache.spark:spark-tags_2.13,org.scalactic:scalactic_2.13,org.scalatest:scalatest_2.13,com.fasterxml.jackson.core:jackson-databind",
      "spark.yarn.user.classpath.first": "true",
      "spark.sql.parquet.enableVectorizedReader": "false"
  }
}

Synapse Analytics

Current Azure Synapse pools use Spark 3.5. Place the following in the first cell of your notebook:

%%configure -f
{
  "name": "synapseml",
  "conf": {
      "spark.jars.packages": "com.microsoft.azure:synapseml_2.12:1.1.3",
      "spark.jars.repositories": "https://mmlspark.blob.core.windows.net/maven",
      "spark.jars.excludes": "org.scala-lang:scala-reflect,org.apache.spark:spark-tags_2.12,org.scalactic:scalactic_2.12,org.scalatest:scalatest_2.12,com.fasterxml.jackson.core:jackson-databind",
      "spark.yarn.user.classpath.first": "true",
      "spark.sql.parquet.enableVectorizedReader": "false"
  }
}

To install at the pool level instead of the notebook level add the spark properties listed above to the pool configuration.

Databricks

To install SynapseML on the Databricks cloud, create a new library from Maven coordinates in your workspace.

Use one of these exact Maven coordinates:

  • Spark 4.1 / Scala 2.13: com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1
  • Spark 4.0 / Scala 2.13: com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0
  • Spark 3.5 / Scala 2.12: com.microsoft.azure:synapseml_2.12:1.1.3

Add the resolver https://mmlspark.blob.core.windows.net/maven, attach the library to the target cluster, and restart it before importing synapse.ml.

You can use SynapseML in both your Scala and PySpark notebooks. To get started with our example notebooks import the following databricks archive:

https://mmlspark.blob.core.windows.net/dbcs/SynapseMLExamplesv1.1.3.dbc

Python Standalone

Choose exactly one complete runtime variant below, then start Spark with that variant's JVM artifact.

Spark 4.1 / Python 3.13

python -m pip install "synapseml==1.1.3" "pyspark>=4.1,<4.2"

Spark 4.0 / Python 3.12

python -m pip install "synapseml==1.1.3" "pyspark>=4.0.1,<4.1"

Spark 3.5 / Python 3.11

python -m pip install "synapseml==1.1.3" "pyspark>=3.5,<3.6"
from pyspark.sql import SparkSession

# Spark 4.1. Select the coordinate matching the PySpark command used above.
synapseml_coordinate = "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1"
# Spark 4.0:
# synapseml_coordinate = "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0"
# Spark 3.5:
# synapseml_coordinate = "com.microsoft.azure:synapseml_2.12:1.1.3"

spark = (
    SparkSession.builder.appName("MyApp")
    .config("spark.jars.packages", synapseml_coordinate)
    .config(
        "spark.jars.repositories",
        "https://mmlspark.blob.core.windows.net/maven",
    )
    .getOrCreate()
)
import synapse.ml

Spark Submit

SynapseML can be conveniently installed on existing Spark clusters via the --packages option. Each example below is independently copyable.

# Spark 4.1
pyspark --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1"
# Spark 4.0
pyspark --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0"
# Spark 3.5
pyspark --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.12:1.1.3"

SBT

Choose the dependency matching your Spark runtime.

Spark 4.1

resolvers += "SynapseML" at "https://mmlspark.blob.core.windows.net/maven"
libraryDependencies +=
  "com.microsoft.azure" % "synapseml_2.13" % "1.1.3-spark4.1"

Spark 4.0

resolvers += "SynapseML" at "https://mmlspark.blob.core.windows.net/maven"
libraryDependencies +=
  "com.microsoft.azure" % "synapseml_2.13" % "1.1.3-spark4.0"

Spark 3.5

resolvers += "SynapseML" at "https://mmlspark.blob.core.windows.net/maven"
libraryDependencies +=
  "com.microsoft.azure" % "synapseml_2.12" % "1.1.3"

Apache Livy and HDInsight

To install SynapseML from within a Jupyter notebook served by Apache Livy, the following Spark 3.5 / Scala 2.12 configure magic can be used. You will need to start a new session after this configure cell is executed.

Excluding certain packages from the library may be necessary due to current issues with Livy 0.5.

%%configure -f
{
    "name": "synapseml",
    "conf": {
        "spark.jars.packages": "com.microsoft.azure:synapseml_2.12:1.1.3",
        "spark.jars.repositories": "https://mmlspark.blob.core.windows.net/maven",
        "spark.jars.excludes": "org.scala-lang:scala-reflect,org.apache.spark:spark-tags_2.12,org.scalactic:scalactic_2.12,org.scalatest:scalatest_2.12,com.fasterxml.jackson.core:jackson-databind"
    }
}

Docker

The easiest way to evaluate SynapseML is via our pre-built Docker container. To do so, run the following command:

docker run -it -p 8888:8888 -e ACCEPT_EULA=yes mcr.microsoft.com/mmlspark/release jupyter notebook

Navigate to http://localhost:8888/ in your web browser to run the sample notebooks. See the documentation for more on Docker use.

To read the EULA for using the docker image, run docker run -it -p 8888:8888 mcr.microsoft.com/mmlspark/release eula

R

To try out SynapseML using the R autogenerated wrappers see our instructions. Note: This feature is still under development and some necessary custom wrappers may be missing.

Building from source

SynapseML has recently transitioned to a new build infrastructure. For detailed developer docs please see the Developer Readme

If you are an existing synapsemldeveloper, you will need to reconfigure your development setup. We now support platform independent development and better integrate with intellij and SBT. If you encounter issues please reach out to our support email!

Papers

Learn More

Contributing & feedback

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

See CONTRIBUTING.md for contribution guidelines.

To give feedback and/or report an issue, open a GitHub Issue.

Other relevant projects

Apache®, Apache Spark, and Spark® are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.

Contributors

(top 30 of 112)

mhamilton723

769 commits

imatiach-msft

141 commits

elibarzilay

99 commits

serena-ruan

87 commits

microsoft/SynapseML

Simple and Distributed Machine Learning Python Library porting ML algorithms for Spark

5,245

stars

1,839

commits

Scala

primary language

Sep 10, 2026

updated

aka.ms/spark
ai
apache-spark
azure
big-data
cognitive-services
databricks
data-science
deep-learning
http
lightgbm
machine-learning
microsoft
ml
model-deployment
onnx
opencv
pyspark
scala
spark
synapse
Browse cluster: MLOps platforms and data pipelines

README

SynapseML

Synapse Machine Learning

SynapseML (previously known as MMLSpark), is an open-source library that simplifies the creation of massively scalable machine learning (ML) pipelines. SynapseML provides simple, composable, and distributed APIs for a wide variety of different machine learning tasks such as text analytics, vision, anomaly detection, and many others. SynapseML is built on the Apache Spark distributed computing framework and shares the same API as the SparkML/MLLib library, allowing you to seamlessly embed SynapseML models into existing Apache Spark workflows.

With SynapseML, you can build scalable and intelligent systems to solve challenges in domains such as anomaly detection, computer vision, deep learning, text analytics, and others. SynapseML can train and evaluate models on single-node, multi-node, and elastically resizable clusters of computers. This lets you scale your work without wasting resources. SynapseML is usable across Python, R, Scala, Java, and .NET. Furthermore, its API abstracts over a wide variety of databases, file systems, and cloud data stores to simplify experiments no matter where data is located.

SynapseML publishes runtime-specific JVM artifacts: Spark 3.5 uses Scala 2.12, while Spark 4.0 and 4.1 use Scala 2.13. See the installation matrix before selecting a Maven coordinate.

TopicsLinks
BuildBuild Status codecov Code style: black
VersionVersion Release Notes Snapshot Version
DocsWebsite Scala Docs PySpark Docs Academic Paper
SupportGitter Mail
BinderBinder
UsageDownloads
Table of Contents

Features

Vowpal Wabbit on SparkThe Cognitive Services for Big DataLightGBM on SparkSpark Serving
Fast, Sparse, and Effective Text AnalyticsLeverage the Microsoft Cognitive Services at Unprecedented Scales in your existing SparkML pipelinesTrain Gradient Boosted Machines with LightGBMServe any Spark Computation as a Web Service with Sub-Millisecond Latency
HTTP on SparkONNX on SparkResponsible AISpark Binding Autogeneration
An Integration Between Spark and the HTTP Protocol, enabling Distributed Microservice OrchestrationDistributed and Hardware Accelerated Model Inference on SparkUnderstand Opaque-box Models and Measure Dataset BiasesAutomatically Generate Spark bindings for PySpark and SparklyR
Isolation Forest on SparkCyberMLConditional KNN
Distributed Nonlinear Outlier DetectionMachine Learning Tools for Cyber SecurityScalable KNN Models with Conditional Queries

Documentation and Examples

For quickstarts, documentation, demos, and examples please see our website.

Setup and installation

SynapseML installation has two parts: the language wrapper and the JVM artifacts loaded by Spark. Installing synapseml from PyPI does not add the JVM artifacts. A Python wrapper can import successfully while its JVM class is missing; using a _2.12 artifact with Spark 4 can produce errors such as LightGBMClassifier does not exist in the JVM.

Choose one complete published build from the Spark runtime. master is the canonical Spark 3.5 development line; Spark 4.0 and Spark 4.1 are maintained on their corresponding branches.

Code lineSpark runtimeScalaPython baselineRelease tagPython packageMaven coordinate
masterSpark 3.5.x2.12Python 3.11v1.1.3synapseml==1.1.3com.microsoft.azure:synapseml_2.12:1.1.3
spark4.0Spark 4.0.1+ (<4.1)2.13Python 3.12v1.1.3-spark4.0synapseml==1.1.3com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0
spark4.1Spark 4.1.x2.13Python 3.13v1.1.3-spark4.1synapseml==1.1.3com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1

Always configure https://mmlspark.blob.core.windows.net/maven, where the Spark 4 artifacts are published. See the full installation guide for platform-specific details.

Latest master snapshot

The latest successful master build targets Spark 3.5 and Scala 2.12. This copy-ready command reads the current snapshot version published by CI and starts Spark with that exact JVM build:

MASTER_VERSION="$(
  curl -fsSL https://mmlspark.blob.core.windows.net/icons/badges/master_version3.svg |
    sed -n 's/.*aria-label="master version: \([^"]*\)".*/\1/p'
)"
test -n "$MASTER_VERSION"
spark-shell \
  --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.12:${MASTER_VERSION}"

The PyPI package contains released Python wrappers. If you need Python APIs that are new on master, build the matching wheel from source.

First select the correct platform that you are installing SynapseML into:

Microsoft Fabric

In Microsoft Fabric notebooks SynapseML is already installed. The following copy-ready override targets a Spark 4.1 / Scala 2.13 runtime:

%%configure -f
{
  "name": "synapseml",
  "conf": {
      "spark.jars.packages": "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1",
      "spark.jars.repositories": "https://mmlspark.blob.core.windows.net/maven",
      "spark.jars.excludes": "org.scala-lang:scala-reflect,org.apache.spark:spark-tags_2.13,org.scalactic:scalactic_2.13,org.scalatest:scalatest_2.13,com.fasterxml.jackson.core:jackson-databind",
      "spark.yarn.user.classpath.first": "true",
      "spark.sql.parquet.enableVectorizedReader": "false"
  }
}

Synapse Analytics

Current Azure Synapse pools use Spark 3.5. Place the following in the first cell of your notebook:

%%configure -f
{
  "name": "synapseml",
  "conf": {
      "spark.jars.packages": "com.microsoft.azure:synapseml_2.12:1.1.3",
      "spark.jars.repositories": "https://mmlspark.blob.core.windows.net/maven",
      "spark.jars.excludes": "org.scala-lang:scala-reflect,org.apache.spark:spark-tags_2.12,org.scalactic:scalactic_2.12,org.scalatest:scalatest_2.12,com.fasterxml.jackson.core:jackson-databind",
      "spark.yarn.user.classpath.first": "true",
      "spark.sql.parquet.enableVectorizedReader": "false"
  }
}

To install at the pool level instead of the notebook level add the spark properties listed above to the pool configuration.

Databricks

To install SynapseML on the Databricks cloud, create a new library from Maven coordinates in your workspace.

Use one of these exact Maven coordinates:

  • Spark 4.1 / Scala 2.13: com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1
  • Spark 4.0 / Scala 2.13: com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0
  • Spark 3.5 / Scala 2.12: com.microsoft.azure:synapseml_2.12:1.1.3

Add the resolver https://mmlspark.blob.core.windows.net/maven, attach the library to the target cluster, and restart it before importing synapse.ml.

You can use SynapseML in both your Scala and PySpark notebooks. To get started with our example notebooks import the following databricks archive:

https://mmlspark.blob.core.windows.net/dbcs/SynapseMLExamplesv1.1.3.dbc

Python Standalone

Choose exactly one complete runtime variant below, then start Spark with that variant's JVM artifact.

Spark 4.1 / Python 3.13

python -m pip install "synapseml==1.1.3" "pyspark>=4.1,<4.2"

Spark 4.0 / Python 3.12

python -m pip install "synapseml==1.1.3" "pyspark>=4.0.1,<4.1"

Spark 3.5 / Python 3.11

python -m pip install "synapseml==1.1.3" "pyspark>=3.5,<3.6"
from pyspark.sql import SparkSession

# Spark 4.1. Select the coordinate matching the PySpark command used above.
synapseml_coordinate = "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1"
# Spark 4.0:
# synapseml_coordinate = "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0"
# Spark 3.5:
# synapseml_coordinate = "com.microsoft.azure:synapseml_2.12:1.1.3"

spark = (
    SparkSession.builder.appName("MyApp")
    .config("spark.jars.packages", synapseml_coordinate)
    .config(
        "spark.jars.repositories",
        "https://mmlspark.blob.core.windows.net/maven",
    )
    .getOrCreate()
)
import synapse.ml

Spark Submit

SynapseML can be conveniently installed on existing Spark clusters via the --packages option. Each example below is independently copyable.

# Spark 4.1
pyspark --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.1"
# Spark 4.0
pyspark --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0"
# Spark 3.5
pyspark --repositories "https://mmlspark.blob.core.windows.net/maven" \
  --packages "com.microsoft.azure:synapseml_2.12:1.1.3"

SBT

Choose the dependency matching your Spark runtime.

Spark 4.1

resolvers += "SynapseML" at "https://mmlspark.blob.core.windows.net/maven"
libraryDependencies +=
  "com.microsoft.azure" % "synapseml_2.13" % "1.1.3-spark4.1"

Spark 4.0

resolvers += "SynapseML" at "https://mmlspark.blob.core.windows.net/maven"
libraryDependencies +=
  "com.microsoft.azure" % "synapseml_2.13" % "1.1.3-spark4.0"

Spark 3.5

resolvers += "SynapseML" at "https://mmlspark.blob.core.windows.net/maven"
libraryDependencies +=
  "com.microsoft.azure" % "synapseml_2.12" % "1.1.3"

Apache Livy and HDInsight

To install SynapseML from within a Jupyter notebook served by Apache Livy, the following Spark 3.5 / Scala 2.12 configure magic can be used. You will need to start a new session after this configure cell is executed.

Excluding certain packages from the library may be necessary due to current issues with Livy 0.5.

%%configure -f
{
    "name": "synapseml",
    "conf": {
        "spark.jars.packages": "com.microsoft.azure:synapseml_2.12:1.1.3",
        "spark.jars.repositories": "https://mmlspark.blob.core.windows.net/maven",
        "spark.jars.excludes": "org.scala-lang:scala-reflect,org.apache.spark:spark-tags_2.12,org.scalactic:scalactic_2.12,org.scalatest:scalatest_2.12,com.fasterxml.jackson.core:jackson-databind"
    }
}

Docker

The easiest way to evaluate SynapseML is via our pre-built Docker container. To do so, run the following command:

docker run -it -p 8888:8888 -e ACCEPT_EULA=yes mcr.microsoft.com/mmlspark/release jupyter notebook

Navigate to http://localhost:8888/ in your web browser to run the sample notebooks. See the documentation for more on Docker use.

To read the EULA for using the docker image, run docker run -it -p 8888:8888 mcr.microsoft.com/mmlspark/release eula

R

To try out SynapseML using the R autogenerated wrappers see our instructions. Note: This feature is still under development and some necessary custom wrappers may be missing.

Building from source

SynapseML has recently transitioned to a new build infrastructure. For detailed developer docs please see the Developer Readme

If you are an existing synapsemldeveloper, you will need to reconfigure your development setup. We now support platform independent development and better integrate with intellij and SBT. If you encounter issues please reach out to our support email!

Papers

Learn More

Contributing & feedback

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

See CONTRIBUTING.md for contribution guidelines.

To give feedback and/or report an issue, open a GitHub Issue.

Other relevant projects

Apache®, Apache Spark, and Spark® are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.

Contributors

(top 30 of 112)

mhamilton723

769 commits

imatiach-msft

141 commits

elibarzilay

99 commits

serena-ruan

87 commits

Languages

Scala

83.5%

Python

13.4%

JavaScript

1.6%