udf-benchmark

用于协助对 Apache Spark UDF 在 GPU 上的性能进行基准测试与分析。适用于 UDF 转换流程的第 3 步(udf-gen-test -> udf-convert-to-* -> udf-benchmark),在已有 CPU UDF 及对应 RapidsUDF 或 SQL 实现并需比较两者性能时使用。

仓库最近推送
GitHub Stars
212
Forks
664
Issues / PRs
21

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "udf-benchmark":https://skillpi.com/zh/skills/deepskill-5d8480d1dc500992cf3fa438ea7e1b797583f5cdc2b2fc3ec936edea991bc57b。安装前核对上游来源和版本:https://github.com/Kilo-Org/kilo-marketplace。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于协助对 Apache Spark UDF 在 GPU 上的性能进行基准测试与分析。适用于 UDF 转换流程的第 3 步(udf-gen-test -> udf-convert-to-* -> udf-benchmark),在已有 CPU UDF 及对应 RapidsUDF 或 SQL 实现并需比较两者性能时使用。

0 下载

介绍来源: third_party · Kilo-Org · 0.0.1 参考来源

SkillPi 解读

输入和输出
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: udf-benchmark
description: >-
  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.
metadata:
  spdx-file-copyright-text: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
  upstream:
    model: inherit
  category: data
  source:
    repository: 'https://github.com/NVIDIA/cudf-spark'
    path: skills/udf-benchmark
    license_path: LICENSE
    commit: a707353465abe170e486d91304944c98f64fd938

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/

版本历史

  1. skills-20261103210927-6c1b454 GitHub ↗
    原版更新说明

    Automated skills release from commit 6c1b4543cac1d45a80bf5904e4b69ac315117323

  2. skills-20260928190452-ff51758 GitHub ↗
    原版更新说明

    Automated skills release from commit ff51758b06b8249007116184096765d47bdb7505

  3. skills-20260924105536-d31110d GitHub ↗
    原版更新说明

    Automated skills release from commit d31110d62dc0bd00c22f1d6f6a630d1e702a0049

  4. skills-20260923085113-cea285e GitHub ↗
    原版更新说明

    Automated skills release from commit cea285ef0e4d6ec47cd2fd9fdbca03813a3363c7

  5. skills-20260922193956-97d7333 GitHub ↗
    原版更新说明

    Automated skills release from commit 97d7333d8200e5ac556c659c8669f3a83ba10866

此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 针对 Apache Spark UDF GPU 性能基准测试的专业工具
  • 提供完整的端到端工作流,解决实际工程痛点
  • 面向有明确技术需求的专业用户群体
触发精准92/100

亮点

  • 触发条件描述清晰具体,边界明确
  • 准确描述了使用前提和场景
  • 与 UDF 转换流程的其他步骤关联清晰
结构规范88/100

待提升项

  • 缺少明确的 When to Use 章节标题 原报告严重程度:轻微

    文档中提到了使用场景,但没有明确的 When to Use 章节标题

    改进建议:建议添加明确的 When to Use 章节,使文档结构更清晰

亮点

  • 工作流程步骤清晰,有明确的4步执行流程
  • 包含详细的命令示例和输出说明
  • frontmatter 完整,文档结构良好
执行可靠75/100

待提升项

  • 异常处理说明不够详细 原报告严重程度:轻微

    文档提到了 sandbox 限制,但对其他可能的执行异常情况说明不足

    改进建议:建议增加更多异常处理说明,如内存不足、GPU 设备不可用等情况

亮点

  • 提供了验证步骤确保执行正确性
  • 包含具体的脚本执行命令和参数说明
  • 说明了结果输出位置和文件结构
证据可验 (前四项均值)83/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • github.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。