udf-convert-to-cudf

Convert Apache Spark UDFs into GPU-accelerated RapidsUDF implementations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you convert an existing Apache Spark UDF into a GPU-accelerated RapidsUDF so it can run efficiently on NVIDIA GPUs while preserving CPU compatibility.

Core Features & Use Cases

  • Create the GPU UDF Wrapper: Add the required cuDF imports, implement the RapidsUDF interface, and rename the class appropriately.
  • Implement Columnar Logic: Translate row-based UDF behavior into evaluateColumnar using cuDF ColumnVector operations.
  • Validate and Harden: Update comparison tests, verify CPU and GPU results match, and check for GPU memory leaks.
  • Use Case: Apply this when you already have a tested Spark UDF and need a production-ready GPU version for accelerated Spark jobs.

Quick Start

Use this skill to convert my tested Spark UDF into a RapidsUDF and update the comparison test for GPU execution.

Frequently Asked Questions about udf-convert-to-cudf

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

FAQPage Schema
How do I convert an Apache Spark UDF to a GPU RapidsUDF?

To convert an Apache Spark UDF to a GPU RapidsUDF, implement the RapidsUDF interface, rename the class, and translate row-based logic into columnar evaluateColumnar operations using cuDF ColumnVector APIs.

What is needed to implement columnar execution in a Spark RapidsUDF?

Implementing columnar execution in a Spark RapidsUDF requires using cuDF Java APIs and correct ColumnVector type mapping to translate row-based UDF behavior into evaluateColumnar operations.

How do I prevent GPU memory leaks when running Spark RapidsUDFs?

Preventing GPU memory leaks in Spark RapidsUDFs requires explicit GPU resource management and memory-leak-safe evaluation during the columnar execution logic implementation.

Can I maintain CPU compatibility when migrating a UDF to GPU RapidsUDF?

You can maintain CPU compatibility during UDF migration by updating comparison tests to verify that CPU and GPU results match exactly within your stepwise migration workflow.

Do I need to update Spark tests when migrating a UDF to GPU?

Updating Spark tests is required when migrating a UDF to GPU to validate and harden the implementation, ensuring comparison tests verify CPU and GPU results match and check for memory leaks.

When should I use a GPU RapidsUDF instead of a standard Spark UDF?

Use a GPU RapidsUDF instead of a standard Spark UDF when you need production-ready GPU acceleration for Spark jobs and have a tested CPU UDF ready for stepwise columnar migration.