<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=GPU_acceleration_in_Spark</id>
	<title>GPU acceleration in Spark - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=GPU_acceleration_in_Spark"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=GPU_acceleration_in_Spark&amp;action=history"/>
	<updated>2026-12-06T00:07:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=GPU_acceleration_in_Spark&amp;diff=151&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@7c9abaa</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=GPU_acceleration_in_Spark&amp;diff=151&amp;oldid=prev"/>
		<updated>2026-11-25T00:52:42Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@7c9abaa&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox concept&lt;br /&gt;
| name            = GPU acceleration in Spark&lt;br /&gt;
| also_known_as   = GPU-accelerated Spark, Spark on GPUs&lt;br /&gt;
| field           = Distributed data processing&lt;br /&gt;
| introduced      = Apache Spark 3.0 (accelerator-aware scheduling)&lt;br /&gt;
| key_parts       = GPU resource scheduling, SQL plugins, GPU machine learning libraries&lt;br /&gt;
| implementations = [[Apache Spark]], NVIDIA cuDF plugin for Apache Spark (formerly RAPIDS Accelerator), [[Apache Gluten]], cuML Spark&lt;br /&gt;
| related         = [[Spark resource profiles]], [[Native execution engine (Spark)]], [[Velox]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-23|the v4.3.0 tag of apache/spark (docs/configuration.md, python/pyspark/ml/torch/distributor.py), the NVIDIA cuDF plugin for Apache Spark download, configuration, supported operators, FAQ and getting-started pages and its v26.10.0 GitHub release, the apache/gluten README and VeloxGPU.md on the main branch, and the NVIDIA/cuml-spark repository}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;GPU acceleration in Spark&amp;#039;&amp;#039;&amp;#039; is the use of graphics processing units (GPUs) to run parts of an [[Apache Spark]] application, either by scheduling GPUs to tasks that use them directly (for example deep learning training) or by replacing Spark SQL operators with GPU implementations. Apache Spark itself provides the first part: since Spark 3.0, its scheduler can request GPUs for executors and assign GPU addresses to tasks.&amp;lt;ref name=&amp;quot;r300&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-3-0-0.html |title=Spark Release 3.0.0 |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;conf&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/configuration.html |title=Spark Configuration (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Running Spark SQL and DataFrame operators on a GPU needs a plugin such as the NVIDIA cuDF plugin for Apache Spark, formerly called the RAPIDS Accelerator for Apache Spark.&amp;lt;ref name=&amp;quot;dl&amp;quot;&amp;gt;{{Cite web |url=https://nvidia.github.io/cudf-spark/docs/download.html |title=Download (NVIDIA cuDF plugin for Apache Spark) |publisher=NVIDIA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison of GPU options for Spark ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! !! Apache Spark GPU scheduling !! NVIDIA cuDF plugin for Apache Spark !! Apache Gluten with Velox cuDF !! cuML Spark&lt;br /&gt;
|-&lt;br /&gt;
! What runs on the GPU&lt;br /&gt;
| User code that reads the GPU addresses Spark assigns (RDD functions, pandas UDFs, ML training)&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
| Supported Spark SQL and DataFrame operators, file scans and writes&amp;lt;ref name=&amp;quot;overview&amp;quot;&amp;gt;{{Cite web |url=https://docs.nvidia.com/cudf-spark/latest/getting-started/overview.html |title=Getting started overview (cuDF plugin for Apache Spark User Guide) |publisher=NVIDIA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Velox plan nodes converted to cuDF operators&amp;lt;ref name=&amp;quot;glutengpu&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/gluten/blob/main/docs/backends/velox/get-started/VeloxGPU.md |title=GPU Acceleration in Velox/Gluten (VeloxGPU.md, main branch) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| PySpark ML algorithms backed by the cuML library&amp;lt;ref name=&amp;quot;cumlspark&amp;quot;&amp;gt;{{Cite web |url=https://github.com/NVIDIA/cuml-spark |title=NVIDIA/cuml-spark |publisher=GitHub |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! How it is enabled&lt;br /&gt;
| &amp;lt;code&amp;gt;spark.executor.resource.gpu.amount&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;spark.task.resource.gpu.amount&amp;lt;/code&amp;gt;, a discovery script, or a [[Spark resource profiles|resource profile]]&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;spark.plugins=com.nvidia.spark.SQLPlugin&amp;lt;/code&amp;gt; plus the &amp;lt;code&amp;gt;rapids-4-spark&amp;lt;/code&amp;gt; jar&amp;lt;ref name=&amp;quot;onprem&amp;quot;&amp;gt;{{Cite web |url=https://docs.nvidia.com/cudf-spark/latest/getting-started/on-premise.html |title=Getting started on-prem (cuDF plugin for Apache Spark User Guide) |publisher=NVIDIA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;dl&amp;quot; /&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;spark.gluten.sql.columnar.cudf=true&amp;lt;/code&amp;gt; in a GPU build of Gluten&amp;lt;ref name=&amp;quot;glutengpu&amp;quot; /&amp;gt;&lt;br /&gt;
| Change the import, for example &amp;lt;code&amp;gt;spark_rapids_ml.feature.PCA&amp;lt;/code&amp;gt; in place of &amp;lt;code&amp;gt;pyspark.ml.feature.PCA&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;cumlspark&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Unsupported work&lt;br /&gt;
| Not applicable; Spark does not use the GPU itself&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
| Falls back to the Spark CPU implementation; RDD operations are not accelerated&amp;lt;ref name=&amp;quot;overview&amp;quot; /&amp;gt;&lt;br /&gt;
| Falls back to CPU operators, with row and columnar conversion&amp;lt;ref name=&amp;quot;glutengpu&amp;quot; /&amp;gt;&lt;br /&gt;
| Algorithms not in its list are not provided&amp;lt;ref name=&amp;quot;cumlspark&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Status&lt;br /&gt;
| Part of Apache Spark since 3.0.0&amp;lt;ref name=&amp;quot;r300&amp;quot; /&amp;gt;&lt;br /&gt;
| Release v26.10.0, published 2026-11-05&amp;lt;ref name=&amp;quot;rel&amp;quot;&amp;gt;{{Cite web |url=https://github.com/NVIDIA/cudf-spark/releases/tag/v26.10.0 |title=v26.10.0 release |publisher=GitHub |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Experimental; documented on the main branch, not in the v1.7.0 release&amp;lt;ref name=&amp;quot;glutengpu&amp;quot; /&amp;gt;&lt;br /&gt;
| Release v26.06.0, published 2026-07-22&amp;lt;ref name=&amp;quot;cumlrel&amp;quot;&amp;gt;{{Cite web |url=https://github.com/NVIDIA/cuml-spark/releases |title=Releases, NVIDIA/cuml-spark |publisher=GitHub |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Spark versions&lt;br /&gt;
| 3.0.0 and later&amp;lt;ref name=&amp;quot;r300&amp;quot; /&amp;gt;&lt;br /&gt;
| 3.3.0 to 4.2.0 in release v26.10.0; 4.3.0 is not listed&amp;lt;ref name=&amp;quot;dl&amp;quot; /&amp;gt;&lt;br /&gt;
| Same as Gluten on CPU&amp;lt;ref name=&amp;quot;glutengpu&amp;quot; /&amp;gt;&lt;br /&gt;
| Not stated in the README&lt;br /&gt;
|-&lt;br /&gt;
! License&lt;br /&gt;
| Apache License 2.0&amp;lt;ref name=&amp;quot;sparklic&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/LICENSE |title=LICENSE (apache/spark v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Source code Apache 2.0; documentation CC BY 4.0&amp;lt;ref name=&amp;quot;lic&amp;quot;&amp;gt;{{Cite web |url=https://github.com/NVIDIA/cudf-spark/blob/main/LICENSE |title=LICENSE, NVIDIA/cudf-spark |publisher=GitHub |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Apache License 2.0&amp;lt;ref name=&amp;quot;glutenreadme&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/gluten/blob/main/README.md |title=Apache Gluten README |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Apache License 2.0&amp;lt;ref name=&amp;quot;cumlspark&amp;quot; /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How does Apache Spark schedule GPUs? ==&lt;br /&gt;
Apache Spark schedules GPUs as a custom resource named &amp;lt;code&amp;gt;gpu&amp;lt;/code&amp;gt;. An application sets &amp;lt;code&amp;gt;spark.executor.resource.gpu.amount&amp;lt;/code&amp;gt; (default 0) for GPUs per executor and &amp;lt;code&amp;gt;spark.task.resource.gpu.amount&amp;lt;/code&amp;gt; for GPUs per task; fractional task amounts let several tasks share one GPU. On YARN and Kubernetes, the executor also needs &amp;lt;code&amp;gt;spark.executor.resource.gpu.discoveryScript&amp;lt;/code&amp;gt;, and Kubernetes needs &amp;lt;code&amp;gt;spark.executor.resource.gpu.vendor&amp;lt;/code&amp;gt;, for example &amp;lt;code&amp;gt;nvidia.com&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt; Spark then assigns GPU addresses to each task, which user code reads with &amp;lt;code&amp;gt;TaskContext.get().resources()&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt; Since Spark 3.1, [[Spark resource profiles]] let one stage request GPU executors while other stages use CPU-only executors.&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Spark&amp;#039;s own GPU support is used by machine learning code inside Spark. &amp;lt;code&amp;gt;pyspark.ml.torch.distributor.TorchDistributor&amp;lt;/code&amp;gt;, added in Spark 3.4.0, runs distributed PyTorch training on Spark; with &amp;lt;code&amp;gt;use_gpu=True&amp;lt;/code&amp;gt; (the default) on a cluster it requires &amp;lt;code&amp;gt;spark.task.resource.gpu.amount&amp;lt;/code&amp;gt; of at least 1.&amp;lt;ref name=&amp;quot;torch&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/python/pyspark/ml/torch/distributor.py |title=pyspark/ml/torch/distributor.py (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is the NVIDIA cuDF plugin for Apache Spark? ==&lt;br /&gt;
The NVIDIA cuDF plugin for Apache Spark is a set of Spark plugins, built on the cuDF library and UCX, that run DataFrame and SQL processing on NVIDIA GPUs. NVIDIA renamed it from the RAPIDS Accelerator for Apache Spark; the GitHub repository moved from &amp;lt;code&amp;gt;NVIDIA/spark-rapids&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;NVIDIA/cudf-spark&amp;lt;/code&amp;gt;, and the artifact name &amp;lt;code&amp;gt;rapids-4-spark&amp;lt;/code&amp;gt; stays the same for now.&amp;lt;ref name=&amp;quot;dl&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;readme&amp;quot;&amp;gt;{{Cite web |url=https://github.com/NVIDIA/cudf-spark/blob/main/README.md |title=NVIDIA cuDF plugin for Apache Spark README |publisher=GitHub |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; The plugin hooks into Spark at the Catalyst level, after the language APIs have been converted to a DataFrame plan, so it applies to PySpark, Scala, Java and SQL alike.&amp;lt;ref name=&amp;quot;faq&amp;quot;&amp;gt;{{Cite web |url=https://docs.nvidia.com/cudf-spark/latest/faq.html |title=Frequently Asked Questions (cuDF plugin for Apache Spark User Guide) |publisher=NVIDIA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cuDF plugin is turned on with &amp;lt;code&amp;gt;spark.plugins=com.nvidia.spark.SQLPlugin&amp;lt;/code&amp;gt;. NVIDIA&amp;#039;s on-premise example combines it with Spark&amp;#039;s own GPU settings, &amp;lt;code&amp;gt;spark.executor.resource.gpu.amount=1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;spark.task.resource.gpu.amount=0.25&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;onprem&amp;quot; /&amp;gt; The getting-started guide asks for Apache Spark 3.3 or later and one GPU per executor.&amp;lt;ref name=&amp;quot;overview&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
spark-submit \&lt;br /&gt;
  --jars rapids-4-spark_2.13-26.10.0.jar \&lt;br /&gt;
  --conf spark.plugins=com.nvidia.spark.SQLPlugin \&lt;br /&gt;
  --conf spark.executor.resource.gpu.amount=1 \&lt;br /&gt;
  --conf spark.task.resource.gpu.amount=0.25 \&lt;br /&gt;
  --conf spark.rapids.sql.explain=NOT_ON_GPU \&lt;br /&gt;
  app.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Which operators and formats run on the GPU? ===&lt;br /&gt;
The cuDF plugin replaces physical operators such as &amp;lt;code&amp;gt;FileSourceScanExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;FilterExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProjectExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;HashAggregateExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SortExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WindowExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ShuffleExchangeExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BroadcastHashJoinExec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ShuffledHashJoinExec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SortMergeJoinExec&amp;lt;/code&amp;gt;, and pandas UDF operators such as &amp;lt;code&amp;gt;MapInPandasExec&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;ops&amp;quot;&amp;gt;{{Cite web |url=https://nvidia.github.io/cudf-spark/docs/supported_ops.html |title=Supported Operators (NVIDIA cuDF plugin for Apache Spark) |publisher=NVIDIA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Its supported-operators page lists GPU reads for Avro, CSV, [[Delta Lake]], Hive text, [[Apache Iceberg]], JSON, ORC and [[Apache Parquet]], and GPU writes for Delta Lake, Hive text, Iceberg, ORC and Parquet. Timestamps are supported only in the UTC time zone.&amp;lt;ref name=&amp;quot;ops&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cuDF plugin&amp;#039;s FAQ states that only a limited set of SQL and DataFrame operations is supported; some MLlib functions such as PCA are accelerated, while GraphX and RDD code are not. Dataset operations that take Scala or Java functions, such as &amp;lt;code&amp;gt;flatMap&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;foreachPartition&amp;lt;/code&amp;gt;, still run correctly but mostly on the CPU.&amp;lt;ref name=&amp;quot;faq&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What happens when an operator is not supported? ===&lt;br /&gt;
When the cuDF plugin cannot run an operation on the GPU, that part of the plan runs on the Spark CPU implementation, so the query still completes.&amp;lt;ref name=&amp;quot;overview&amp;quot; /&amp;gt; The plugin decides this with rules, not the Spark scheduler.&amp;lt;ref name=&amp;quot;faq&amp;quot; /&amp;gt; &amp;lt;code&amp;gt;spark.rapids.sql.enabled&amp;lt;/code&amp;gt; (default true) turns GPU SQL on or off, and &amp;lt;code&amp;gt;spark.rapids.sql.explain&amp;lt;/code&amp;gt; logs the parts of a plan that were not placed on the GPU, for example with the value &amp;lt;code&amp;gt;NOT_ON_GPU&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;configs&amp;quot;&amp;gt;{{Cite web |url=https://nvidia.github.io/cudf-spark/docs/configs.html |title=Configuration (NVIDIA cuDF plugin for Apache Spark) |publisher=NVIDIA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What other GPU options exist for Spark? ==&lt;br /&gt;
[[Apache Gluten]], a project that offloads Spark SQL execution to native engines such as [[Velox]], documents an experimental GPU path on its main branch: with &amp;lt;code&amp;gt;spark.gluten.sql.columnar.cudf=true&amp;lt;/code&amp;gt;, Velox plan nodes are converted to GPU operators built on cuDF, and unsupported operators fall back to the CPU.&amp;lt;ref name=&amp;quot;glutengpu&amp;quot; /&amp;gt; See [[Native execution engine (Spark)]] for CPU-based native engines.&lt;br /&gt;
&lt;br /&gt;
cuML Spark (repository &amp;lt;code&amp;gt;NVIDIA/cuml-spark&amp;lt;/code&amp;gt;) provides PySpark ML compatible algorithms on GPUs, including KMeans, LinearRegression, LogisticRegression, PCA, RandomForestClassifier and UMAP.&amp;lt;ref name=&amp;quot;cumlspark&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Spark resource profiles]]&lt;br /&gt;
* [[Executor]]&lt;br /&gt;
* [[Apache Gluten]]&lt;br /&gt;
* [[Apache DataFusion Comet]]&lt;br /&gt;
* [[Native execution engine (Spark)]]&lt;br /&gt;
* [[Velox]]&lt;br /&gt;
* [[Project Tungsten]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Apache Spark]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>