udf-convert-to-cuda

Convert Apache Spark CPU UDFs into native CUDA RapidsUDF implementations.

993|294|Updated May 14, 2020
One-click install
npx skills add https://github.com/NVIDIA/cudf-spark --skill udf-convert-to-cuda
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: udf-convert-to-cuda
Source: https://github.com/NVIDIA/cudf-spark/tree/main/skills/udf-convert-to-cuda
Command: npx skills add https://github.com/NVIDIA/cudf-spark --skill udf-convert-to-cuda

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps convert a tested Apache Spark CPU UDF into a native CUDA implementation so the same business logic can run on the GPU through RAPIDS.

Core Features & Use Cases

  • JNI and Java wrapper guidance: Builds the RapidsUDF bridge and columnar entry point.
  • Native CUDA implementation guidance: Shows how to add libcudf and CUDA logic without copying data back to the host.
  • Testing and packaging workflow: Covers build, comparison testing, and native library packaging for the UDF JAR.
  • Use case: A developer has a passing row-by-row UDF test and needs to port it to a GPU path while keeping Spark fallback behavior and null semantics intact.

Quick Start

Ask for help converting your existing Spark UDF into a native CUDA RapidsUDF using this skill and provide the CPU UDF, its unit test, and the expected GPU behavior.

Frequently Asked Questions about udf-convert-to-cuda

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert an Apache Spark UDF to CUDA?

Converting a Spark UDF to CUDA requires building a Java RapidsUDF wrapper, writing a JNI bridge, and implementing native CUDA logic with libcudf to execute the business logic directly on the GPU.

Can I use this to port aggregating Spark UDFs to GPU?

No, this workflow targets non-aggregating Spark UDFs. You must have an existing CPU UDF with a passing unit test to validate the Java wrapper, JNI bridge, and native CUDA logic during the GPU conversion.

What do I need to build a native RapidsUDF JAR?

Building a native RapidsUDF JAR requires validating the Java wrapper, implementing JNI bridge code and CUDA logic, and packaging the compiled native library into the JAR alongside comparison tests.

How does CUDA handle null values in a converted Spark UDF?

Native CUDA RapidsUDF implementations must explicitly adhere to GPU null semantics, ensuring the JNI bridge and libcudf logic process null values safely without breaking Spark fallback behavior.

Why does my Spark RapidsUDF need a JNI bridge?

A JNI bridge is required to connect the Java RapidsUDF columnar entry point to the native CUDA libcudf logic, enabling direct GPU execution of the Spark UDF without host data transfers.