Add GPU unhex decoding to JNI #5294
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 253 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5294"
general
weight: 0.35
gerashegalov
Add native GPU unhex decoding
Related to NVIDIA/cudf-spark#12579. The Spark plugin integration will follow in a separate PR.
Description
Add
hexToBytesto cudf-spark-jni. It decodes hexadecimal strings to binary byte lists, treats an odd leading digit as a zero-padded nibble, and returns null for invalid input. The native decoder validates and then decodes one thread per row when every row fits in a 32-character chunk, and fixed-size character chunks otherwise, so one long string does not serialize a batch. Add JNI and Java entry points, native and Java correctness tests, and a batch-shape benchmark.Testing
HexToBytesTestsand all 77CAST_STRINGtests pass.CastStringsTest.hexToBytesTestpasses.Performance
The end-to-end numbers below were measured on 6a38abf5. The query is dominated by the Parquet scan, so they are unchanged within noise by later decoder changes. The native benchmark and
unhexoperator-time comparisons for 44404de5 are in the review thread onhex.cu.End-to-end Spark 4.1.1
UNHEXquery on 67,108,864 unique 16-character hex strings (1 GiB of logical input), with five warmups and ten timed queries. Both plans process the same Parquet input; the CPU run uses vanilla upstream Spark without the RAPIDS plugin. The GPU run uses this JNI implementation and the matching local Spark plugin integration. Medians include scan, decode, aggregate, andcollect().| Workload | Vanilla CPU Spark | GPU Spark |
| --- | ---: | ---: |
| All short strings | 1,608.7 ms | 324.3 ms |
| One 1 MiB hex string among short strings | 1,708.2 ms | 345.7 ms |
Host: AMD Ryzen Threadripper PRO 5975WX and NVIDIA Quadro RTX 6000. Local mode uses four CPU task slots and one Parquet partition. This shows a roughly 5× end-to-end GPU speedup for this workload; it does not claim a speedup for smaller batches.