从 PyPI 安装 synapseml 只装 Python 包装层,不会带上 JVM 构件,需另行配置 spark.jars.packages;Spark 3.5 用 Scala 2.12,Spark 4.0/4.1 用 Scala 2.13,版本错配会报类不存在;Spark 4 构件需额外配置 mmlspark.blob.core.windows.net/maven 仓库。
SynapseML
microsoftMIT活跃维护基于 Spark 的分布式机器学习库,把 LightGBM、深度学习、认知服务等算法封装成易用 API,让大数据场景下的训练和推理可以直接在集群上跑。
Simple and Distributed Machine Learning Python Library porting ML algorithms for Spark
pip install synapseml==1.1.3
spark-shell --repositories "https://mmlspark.blob.core.windows.net/maven" --packages "com.microsoft.azure:synapseml_2.12:1.1.3"README 未说明具体显存或 GPU 型号要求;运行依赖 Apache Spark 集群(单机或多机均可),需按 Spark 版本匹配 Scala 版本。
基于 Apache Spark 的可扩展机器学习库,把文本、视觉、异常检测等模型接入现有 Spark 流水线
基于 Spark 的分布式机器学习库,把 LightGBM、深度学习、认知服务等算法封装成易用 API,让大数据场景下的训练和推理可以直接在集群上跑。
核心能力
- 提供与 SparkML/MLLib 一致的分布式 API,可直接嵌入现有 Spark 作业
- 覆盖文本分析、计算机视觉、异常检测、深度学习等多类任务
- 支持 Python、R、Scala、Java、.NET 多语言调用
- 可运行在单机、多机及弹性伸缩集群上训练与评估模型
- 抽象多种数据库、文件系统与云存储,简化数据接入
容易踩的坑
- v1.1.3最新正式版2026-04-07 · 2026-04-07 04:30 UTC
What's Changed
- feat: Add token usage to OpenAIPrompt and OpenAIEmbedding by @ranadeepsingh in https://github.com/microsoft/SynapseML/pull/2444
- chore: Remove redundant text message for file input in OpenAIPrompt by @levscaut in https://github.com/microsoft/SynapseML/pull/2448
- fix: Make translation test less flaky by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2449
- fix: Fix geospatial test error caused by invalid auth by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2450
- fix: Remove test for deprecated bing search service by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2454
- feat: Add OpenAI API Type to OpenAIDefaults by @levscaut in https://github.com/microsoft/SynapseML/pull/2453
- fix: Null cases for openai prompt and embeddings by @ranadeepsingh in https://github.com/microsoft/SynapseML/pull/2457
- chore: Replace placeholder with file name in prompt template by @levscaut in https://github.com/microsoft/SynapseML/pull/2456
- feat: OpenAI responses API: Add store and previous_response_id params by @ranadeepsingh in https://github.com/microsoft/SynapseML/pull/2460
- feat: OpenAIPrompt Branchout ReponseId and Usage cols by @ranadeepsingh in https://github.com/microsoft/SynapseML/pull/2461
- chore: remove redundant sas token from public test file by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2462
- chore: null value passthrough for path columns in OpenAIPrompt by @levscaut in https://github.com/microsoft/SynapseML/pull/2463
- chore: Add argument to limit file size, put file error to errorCol by @levscaut in https://github.com/microsoft/SynapseML/pull/2464
- fix: remove random monikers by @ranadeepsingh in https://github.com/microsoft/SynapseML/pull/2465
- chore: Bump version to v1.1.1 by @smamindl in https://github.com/microsoft/SynapseML/pull/2466
- chore: Bump version to v1.1.2 by @smamindl in https://github.com/microsoft/SynapseML/pull/2468
- fix: Master release bug fixes by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2485
- chore: Add granular CI job toggles and verification scripts by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2486
- ci: Speed up builds with coverage skip and pre-built horovod by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2487
- fix: Make TranslateSuite resilient to API translation changes by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2491
- fix: Remove overly tight polling timeout from AbstractiveSummarizationSuite by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2493
- ci: Skip WebsiteAutoDeployment on scheduled builds by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2492
- chore: Remove deprecated Bing Search API v7 components by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2494
- test: Port Fabric E2E tests from SynapseML-Internal by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2495
- feat: Add attributes parameter to logToCertifiedEvents by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2496
- test: add 145 unit tests for 22 untested core source files by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2497
- fix: use BUILD_SOURCEBRANCH tag for version when available by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2499
- ci: switch dead link checker from wget to lychee by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2501
- ci: fix security issues in reopen-issue-on-comment workflow by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2502
- ci: add dependency review and PR validation workflows by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2503
- ci: remove unused SYNAPSE_ENVIRONMENT pipeline parameter by @BrendanWalsh in https://github.com/microsoft/SynapseML/pull/2500
- ci: add copilot-instructions.md for AI coding agents by @BrendanWalsh in https://github.com/microsoft/Synaps
- v1.1.0SynapseML v1.1.02025-11-20 · 2025-11-20 03:51 UTC
查看更新说明
We are excited to announce the release of SynapseML v1.1 marking a host of powerful new features introduced since the initial v1.0 release. SynapseML is an open-source library that aims to streamline the development of massively scalable machine learning pipelines. It unifies several existing ML Frameworks and new Microsoft algorithms in a single, scalable API that is usable across Python, R, Scala, and Java. SynapseML is usable from any Apache Spark platform with first class enterprise support on Microsoft Fabric.
Highlights
Microsoft Fabric AI Functions OneLake Build and operationalize distributed ML with SynapseML in Fabric Apply Pandas and Spark LLM transformations with one line of code Automatically derive AI insights for unstructured data in OneLake Build Your First Model Explore AI Functions Learn More Hugging Face Azure AI Foundry Use open source models hosted on Hugging Face Run Azure AI Foundry models in your notebook Try an Example View Notebook More Hightlights
Spark 3.5 Support – In this version we transitioned to Spark 3.5 as our main Spark platform.
OpenAI Ecosystem – Comprehensive improvements including global parameter defaults, GPT-4 enablement, custom endpoints/headers, GPU-accelerated embeddings with KNN, and fine-grained control over model parameters (top_p, seed, responseFormat, temperature).
ML Innovation – HuggingFaceCausalLM transformer for distributed language model evaluation, custom embedder support, and synthetic difference-in-differences causal inference module.
Platform features – Spark Native OneLake support; MSI for Azure Storage; OpenAITranslate transformer.
AI Functions in Data Wrangler on Fabric – AI Functions built into Data Wrangler in Fabric allow you to apply LLM-powered operations to your dataframe without writing a single line of code.
New Features
Documentation 📚
- v1.0.14-spark3.5SynapseML v1.0.14 Spark 3.5pre-release2025-09-16 · 2025-09-16 06:47 UTC
这个版本没有写更新说明。
- v1.0.14SynapseML v1.0.142025-09-16 · 2025-09-16 06:45 UTC
查看更新说明
Changes:
- 123ead27e4ce8d60f24b7862f617c98c79589e14 chore: bump to v1.0.14 (#2418)
- 1ceb3b1ea46f584c0e01fbf6c1610ecfda49ebd1 chore: update OpenAIDefaults (#2415)
- 26220da27855026f20b3f7f622e988d16208237b feat: add aifoundry to openai prompt (#2404)
- aac2ed6b56d7b73b48d1793bf563fcfb98da325e fix: fix error handling in networking layer (#2412)
- 7c2f22a0a3761fc7c2c91d11f5a532a52385b248 feat: Add top_p and seed params to OpenAIDefaults (#2410)
- a9133aa3293bde93675847d98ff59796183a7c23 noop commit to Stop library releases in build
- a394061eade46b7ba8374a9140fdae9f5412d77c chore: Bump library to version to v1.0.13 (#2405)
- 85a66877da13de36b2ff324322c77bb25b99b5ed chore: fix propagation of fabric telemetry (#2403)
- 298c7ed29c3fec7b8daf4be190295f466e9bb5ee chore: Add devcontainer configuration for vscode and Copilot (#2400)
- 873884d4e4bf86ddda86489575970803980c76e9 feat: Add AIFoundaryChatCompletion (#2398)
- 83ebb5a868591f493a25b27ebb544828a98fd93f Update README.md
This list of changes was auto generated.
- v1.0.13SynapseML v1.0.132025-08-04 · 2025-08-04 19:05 UTC
查看更新说明
Changes:
- a394061eade46b7ba8374a9140fdae9f5412d77c chore: Bump library to version to v1.0.13 (#2405)
- 85a66877da13de36b2ff324322c77bb25b99b5ed chore: fix propagation of fabric telemetry (#2403)
- 298c7ed29c3fec7b8daf4be190295f466e9bb5ee chore: Add devcontainer configuration for vscode and Copilot (#2400)
- 873884d4e4bf86ddda86489575970803980c76e9 feat: Add AIFoundaryChatCompletion (#2398)
- 83ebb5a868591f493a25b27ebb544828a98fd93f Update README.md
This list of changes was auto generated.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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.
| Topics | Links |
|---|---|
| Build | |
| Version | |
| Docs | |
| Support | |
| Binder | |
| Usage |
Features
| Vowpal Wabbit on Spark | The Cognitive Services for Big Data | LightGBM on Spark | Spark Serving |
| Fast, Sparse, and Effective Text Analytics | Leverage the Microsoft Cognitive Services at Unprecedented Scales in your existing SparkML pipelines | Train Gradient Boosted Machines with LightGBM | Serve any Spark Computation as a Web Service with Sub-Millisecond Latency |
| HTTP on Spark | ONNX on Spark | Responsible AI | Spark Binding Autogeneration |
| An Integration Between Spark and the HTTP Protocol, enabling Distributed Microservice Orchestration | Distributed and Hardware Accelerated Model Inference on Spark | Understand Opaque-box Models and Measure Dataset Biases | Automatically Generate Spark bindings for PySpark and SparklyR |
| Isolation Forest on Spark | CyberML | Conditional KNN |
| Distributed Nonlinear Outlier Detection | Machine Learning Tools for Cyber Security | Scalable 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 line | Spark runtime | Scala | Python baseline | Release tag | Python package | Maven coordinate |
|---|---|---|---|---|---|---|
master | Spark 3.5.x | 2.12 | Python 3.11 | v1.1.3 | synapseml==1.1.3 | com.microsoft.azure:synapseml_2.12:1.1.3 |
spark4.0 | Spark 4.0.1+ (<4.1) | 2.13 | Python 3.12 | v1.1.3-spark4.0 | synapseml==1.1.3 | com.microsoft.azure:synapseml_2.13:1.1.3-spark4.0 |
spark4.1 | Spark 4.1.x | 2.13 | Python 3.13 | v1.1.3-spark4.1 | synapseml==1.1.3 | com.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"
AWS EMR and pre-provisioned clusters
--packages is supported for production Spark jobs as well as notebooks. For
example, use it with spark-submit on EMR rather than downloading a single
JAR manually:
spark-submit \
--repositories "https://mmlspark.blob.core.windows.net/maven" \
--packages "com.microsoft.azure:synapseml_2.12:1.1.3" \
job.py
The top-level synapseml_2.12 artifact is an aggregate artifact: its POM
references the SynapseML module JARs and their runtime dependencies, but the
artifact JAR itself does not contain implementation classes. In particular,
IsolationForest is in synapseml-core_2.12 and also requires the LinkedIn
Isolation Forest dependency. Spark resolves this complete dependency closure
when --packages or spark.jars.packages is used.
If a cluster image or pre-installed environment must be manually provisioned,
use a Maven-compatible dependency resolver during setup to install the complete
runtime dependency closure for the selected coordinate, and verify that the JARs
are added to both the driver and executor JVM classpaths (for example via
spark.driver.extraClassPath and spark.executor.extraClassPath or standard
cluster classpath configuration).
Manual JAR placement is error-prone:
- Merely having a JAR localized or added to Python/YARN/Livy search paths does not ensure that its classes are loaded into the Spark driver's JVM classpath.
- Copying only the aggregate artifact or omitting transitive dependencies will
cause
ClassNotFoundExceptionorNoClassDefFoundError(often surfaced via Py4J as<class> does not exist in the JVM) even if the Python module imports successfully.
Always pin a single coordinate matching the cluster's Spark and Scala versions.
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 SynapseML developer, 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
-
Visit our website.
-
Watch our keynote demos at the Spark+AI Summit 2019, the Spark+AI European Summit 2018, the Spark+AI Summit 2018 and SynapseML at the Spark Summit.
-
See how SynapseML is used to help endangered species.
-
Explore generative adversarial artwork in our collaboration with The MET and MIT.
-
Explore our collaboration with Apache Spark on image analysis.
Contributing & feedback
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] 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.