Accelerating Spark Workloads with GPUs in Cloudera Data Engineering

GPU nodes are optional compute resources that enable hardware-accelerated processing for data-intensive Spark workloads.

By using the Nvidia cuDF Spark framework for Apache Spark acceleration, you can achieve significant performance gains for data preparation tasks.

To ensure consistent performance and resource balancing, configure your GPU nodes to match the memory and storage specifications of your worker nodes.

GPU workers

To enable GPUs within your cluster, you can add GPU nodes within the Cloudera Data Engineering cluster. You can add GPU workers provided by your service provider, for example, AWS or Openstack. The Anywhere Cloud platform handles installing the NVIDIA gpu-operator on these devices. The gpu-operator handles the Kubernetes support and ensures that the correct drivers are in place. The GPU nodes are grouped under the cde-gpu-nodes Kubernetes label.

Scheduling constraints

Anywhere Cloud automatically applies a noSchedule taint on your GPU workers to ensure that only GPU accelerated jobs run on these nodes.

For example:

ecosystem.awc.cloudera.com/taint=cde-gpu-nodes:NoSchedule

This taint blocks other, non-Cloudera Data Engineering applications as well as Spark jobs without GPU acceleration configured from being scheduled on GPU nodes.

When Cloudera Data Engineering is configured with GPU acceleration, the Spark job automatically adds the ecosystem.awc.cloudera.com/taint=cde-gpu-nodes:NoSchedule toleration as well as the ecosystem.awc.cloudera.com/nodeGroup=cde-gpu-nodes node selector so that the RAPIDs library can discover the GPU nodes correctly.

Managing GPU resources

Label management: It is automated when using the NVIDIA GPU Operator. The Kubernetes owner installs a Kubernetes Operator on the cluster for GPU, which handles the necessary drivers, plugins, and metadata automatically. You do not need to manage these labels manually.

Executor mapping and parallelism

By default, Spark assigns one GPU per executor task runner. Fine-tuning the number of GPU cores and concurrent tasks allows efficient parallel processing across available hardware resources.

Strict 1:1 Mapping:
Nvidia cuDF Spark maintains a 1-to-1 relationship between GPU resources and Spark job executors.
Fixed Allocation:
Dynamic allocation is not available; Spark executors are fixed.
Default Parallelism:
Parallelism refers to the number of concurrent tasks a single Spark executor can process simultaneously using its assigned GPU resources. The level of parallelism scales directly with the number of CPU cores per executor (for example, 2 executor cores provide a parallelism of 2).
Single-GPU Nodes:
On nodes with a single GPU resource (such as AWS P4, P5, or P6 instances up to 4x large), the 1:1 relationship ensures that the Spark executor has full access to the node's vCPU and CPU memory.

Out-of-Memory (OOM) considerations

GPU memory constraints can lead to Out-Of-Memory errors during high-throughput shuffle operations or large dataframe transformations.

For more information, see the Nvidia Tuning Guide document.