Assists with converting an Apache Spark UDF to a GPU-accelerated RapidsUDF using cuDF Java APIs. This is step 2 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-cudf -> udf-benchmark). Use this skill when you have a CPU UDF with a unit test and need to convert it to a RapidsUDF.
npx skills add https://github.com/NVIDIA/cudf-spark --skill udf-convert-to-cudf
evaluateColumnar methodBefore making any edits, create a visible TODO checklist for every workflow step in this skill and keep it updated. Do not produce a final answer until every required checklist item is marked complete.
Derive <CamelName> and <snake_name> from the UDF class name.
> Note: Commands require access to /tmp (Spark temp storage) and /dev (GPU device). If commands fail due to sandbox restrictions, re-run them unsandboxed.
Create a copy of the original UDF file in the same source directory (src/main/<java|scala>/com/udf/), then modify it:
Java: import ai.rapids.cudf.*;, import com.nvidia.spark.RapidsUDF;
Scala: import ai.rapids.cudf._, import com.nvidia.spark.RapidsUDF, import Arm.{withResource, closeOnExcept}
implements RapidsUDF to the class declarationevaluateColumnar method stub:Java: public ColumnVector evaluateColumnar(int numRows, ColumnVector... args) { }
Scala: def evaluateColumnar(numRows: Int, args: ColumnVector*): ColumnVector = { }
<CamelName>RapidsUDFevaluateColumnar methodRead references/RAPIDS_UDF.md for detailed background on:
evaluateColumnar workRead examples/ for example RapidsUDF implementations for the target language.
~/.cache/aether_agent/ if not already present. Explore java/src/<main|test>/java/ai/rapids/cudf for relevant methods and usage patterns.evaluateColumnar method using cuDF APIs.copyToHost() or methods that copy data GPU→CPU. This defeats the purpose of GPU accelerationFill in the target-specific TODOs in src/test/scala/com/udf/CudfComparisonTest.scala:
registerRapidsUDF to register the new RapidsUDF class.Then run the test:
mvn test -Dsuites=com.udf.CudfComparisonTest
If the test fails, analyze the error and iterate on the RapidsUDF implementation.
Treat the unit test as the CPU behavior specification. Do not weaken or remove test cases silently.
TODO/NOTE in the implementation explaining the mismatch.Re-run with memory leak detection:
mvn test -Dsuites=com.udf.CudfComparisonTest -Ddebug.memory.leaks=true > /tmp/memleak.log 2>&1
# Check for leaks
grep "LEAKED" /tmp/memleak.log | head -5
If leaks are found, ensure all GPU objects are properly closed.
If the user explicitly asked for the judge, a judge subagent, or a review agent, treat that as an explicit request for delegation: you MUST launch a separate subagent with model: inherit and instruct it to use the udf-judge-conversion skill. Ask it to review the UnitTest, CudfComparisonTest, and RapidsUDF implementation.
If the user did not request a judge/review agent, mark this step as skipped and continue to Step 6. If a required judge subagent is blocked by tool policy, stop and tell the user that explicit permission/instruction is needed.
If you run the judge, wait for it to complete and review its report. If the judge finds any issues, 1) fix the issues, 2) re-run the tests and leak checks, and 3) re-run the judge subagent.
Review your own work to ensure:
copyToHost() or row-by-row GPU-to-CPU copying is used for computationTableDebug.get().debug(...)) remain in final outputUpon successful completion:
src/main/<java|scala>/com/udf/<CamelName>RapidsUDF.<java|scala>These outputs are required for Step 3: Benchmark.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Use when implementing any feature or bugfix, before writing implementation code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Take nvidia/udf-convert-to-cudf from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.