mcpbeat Sign in

Udf Benchmark Agent Skill

Assists with benchmarking and profiling the performance of an Apache Spark UDF on the GPU. This is step 3 of 3 in the UDF conversion workflow (udf-gen-test -> udf-convert-to-* -> udf-benchmark). Use this skill when you have a CPU UDF and a RapidsUDF or SQL implementation, and need to benchmark the performance of the CPU UDF against the GPU implementation.

971 tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
990
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/NVIDIA/cudf-spark --skill udf-benchmark

What comes with it

866 bytes besides the instruction
CUDF_MICROBENCHMARKS.md

The instruction itself

10 sections, as written by the author

UDF Benchmark

Workflow

  • [ ] Step 1: Implement BenchUtils (fill in TODO methods)
  • [ ] Step 2: Validate with a small dataset
  • [ ] Step 3: Generate full benchmark data and run benchmarks
  • [ ] Step 4: cuDF microbenchmarks (skip for SQL targets)

Before 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.

Prerequisites

  • Project directory from Steps 1-2 (udf-gen-test, udf-convert-to-*) with passing tests

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.

Step 1: Implement BenchUtils

Read src/main/scala/com/udf/bench/BenchUtils.scala. Replace placeholders with the actual camel/snake UDF name.

Fill in the TODO methods following the docstrings. For variable-length inputs, generate sizable rows representative of enterprise-scale data. Refer to the unit test for schema and example data.

Step 2: Validate

Make scripts executable:

chmod +x *.sh

Run validation mode to test with a small dataset:

./run_gen_data.sh --rows 1000 --validate

This runs both the CPU and GPU implementations on the dataset.

If validation fails, analyze the error and fix the BenchUtils implementation.

Step 3: Generate Data and Run Benchmarks

The scripts set the default heap size to 16g in .mvn/jvm.config; adjust depending on data size.

Generate benchmark data (10M rows):

./run_gen_data.sh --rows 10000000

Run benchmarks:

# CPU benchmark
./run_spark_benchmark.sh --mode cpu --data-path data/bench_data_10000000_rows.parquet

# GPU benchmark
./run_spark_benchmark.sh --mode gpu --data-path data/bench_data_10000000_rows.parquet

Results are saved to the results/ directory as JSON files.

Step 4: cuDF Microbenchmarks

> Skip this step for SQL targets. This only applies to cuDF RapidsUDF conversions.

Follow CUDF_MICROBENCHMARKS.md to implement and run in-memory microbenchmarks.

Output

Upon successful completion:

  • Benchmark utilities: src/main/scala/com/udf/bench/BenchUtils.scala
  • Microbenchmarks (cuDF): src/main/scala/com/udf/bench/MicroBenchRunner.scala
  • Generated data: data/
  • Benchmark results: results/

Other skills for the same job

different authors, same section of the catalogue
Skill Creator
by anthropics
vendor ×10

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

56k tokens scripts
Geo Database
by christophacham
×4

Access NCBI GEO for gene expression/genomics data. Search/download microarray and RNA-seq datasets (GSE, GSM, GPL), retrieve SOFT/Matrix files, for transcriptomics and expression analysis.

12k tokens
Pymc Bayesian Modeling
by christophacham
×4

Bayesian modeling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.

24k tokens scripts
Pymoo
by christophacham
×4

Multi-objective optimization framework. NSGA-II, NSGA-III, MOEA/D, Pareto fronts, constraint handling, benchmarks (ZDT, DTLZ), for engineering design and optimization problems.

19k tokens scripts
Statsmodels
by ComeOnOliver
×4

Statistical modeling toolkit. OLS, GLM, logistic, ARIMA, time series, hypothesis tests, diagnostics, AIC/BIC, for rigorous statistical inference and econometric analysis.

41k tokens
Add Uint Support
by pytorch
vendor ×3

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

2k tokens
At Dispatch V2
by pytorch
vendor ×3

Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.

2k tokens
Docstring
by pytorch
vendor ×3

Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.

3k tokens

How to use it

Copy the folder

Take nvidia/udf-benchmark from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

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.