Skip to content

Decode ALP-RD floats on the GPU - #11707

Draft
vishalkotak wants to merge 1 commit into
vortex-data:developfrom
vishalkotak:vishalkotak/alp-rd-cuda-kernel
Draft

vishalkotak wants to merge 1 commit into
vortex-data:developfrom
vishalkotak:vishalkotak/alp-rd-cuda-kernel

Conversation

@vishalkotak

@vishalkotak vishalkotak commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Full-precision floats that ALP can't encode fall back to the CPU on the GPU path, because ALP-RD had no CUDA decoder and the CUDA preset never picked it. This adds an ALP-RD kernel for f32 and f64, built on the patch chunk offsets from #11644, and lets the preset choose ALP-RD. Older files without chunk offsets still decode on the CPU.

Patch positions count from the unsliced array's 1024-row chunks, so the kernel decodes chunk-aligned rows, like bit-packing does. Codes outside the dictionary go to the CPU decoder instead of decoding to a wrong value.

Tested on an NVIDIA L4 with the full vortex-cuda suite; notes in the comment below.

I used Claude Code for analysis, debugging, and ideas.

Add a standalone CUDA kernel for ALP-RD f32 and f64 arrays and let the
CUDA compression preset choose ALP-RD.

Signed-off-by: Vishal Kotak <22182951+vishalkotak@users.noreply.github.com>
@vishalkotak
vishalkotak force-pushed the vishalkotak/alp-rd-cuda-kernel branch from 7174955 to 8e3707e Compare November 20, 2026 20:27
@vishalkotak

vishalkotak commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Tested on an NVIDIA L4 (CUDA 13.0): the full vortex-cuda suite passes, 929 of 929. The GPU runs caught a slicing bug the CPU tests missed (in a 5..1000 slice, the outlier from row 5 stayed at row 5), which is why the kernel decodes chunk-aligned rows.

ALP's standalone kernel seems to ignore the slice offset too; I'll check that separately.

P.S. I had to remove some logs from the below snapshot to not bloat the comment text.

Test log
# vortex-cuda on an NVIDIA L4, at 8e3707ef3 before its final comment-only reflow

$ nvidia-smi --query-gpu=name,driver_version,compute_cap --format=csv
name, driver_version, compute_cap
NVIDIA L4, 610.57.04, 8.9

$ nvcc --version | tail -1
Build cuda_13.0.r13.0/compiler.36260728_0

$ clang-format --style=file --dry-run --Werror vortex-cuda/kernels/src/alp_rd.cu
(no output, exit 0)

$ cargo clippy --locked -p vortex-cuda --all-targets --all-features -- -D warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 37s

$ cargo nextest run --locked -p vortex-cuda --no-fail-fast
    Starting 929 tests across 1 binary
  ... (ALP-RD tests shown; all other results in the summary)
        PASS [   7.028s] (471/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_code_outside_the_dictionary::case_1_valid_row
        PASS [   7.041s] (473/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_code_outside_the_dictionary::case_2_null_row
        PASS [   8.297s] (482/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_is_dispatched_to_the_gpu::case_1_auto
        PASS [   6.960s] (478/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_is_dispatched_to_the_gpu::case_2_standalone
        PASS [   6.680s] (481/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f32
        PASS [   6.556s] (475/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_1_one_value
        PASS [   6.512s] (479/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_2_part_of_a_chunk
        PASS [   6.503s] (480/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_3_exactly_one_chunk
        PASS [   6.434s] (477/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_4_one_past_a_chunk
        PASS [   6.411s] (476/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_5_patches_skip_a_chunk
        PASS [   7.102s] (489/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_6_patch_at_every_chunk_boundary
        PASS [   6.897s] (484/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_7_nulls
        PASS [   6.920s] (486/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_matches_cpu_f64::case_8_null_where_an_outlier_was
        PASS [   6.992s] (491/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_slice_of_a_slice
        PASS [   6.969s] (492/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_sliced_f32
        PASS [   6.947s] (488/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_sliced::case_1_inside_a_chunk
        PASS [   7.058s] (494/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_sliced::case_2_across_a_boundary
        PASS [   7.035s] (493/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_sliced::case_3_from_a_chunk_start
        PASS [   6.945s] (490/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_sliced::case_4_tail
        PASS [   6.841s] (485/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_alp_rd_without_chunk_offsets_decodes_on_the_cpu
        PASS [   6.899s] (487/929) vortex-cuda kernel::encodings::alp_rd::tests::test_cuda_preset_writes_alp_rd_for_full_precision_floats
     Summary [ 199.213s] 929 tests run: 929 passed, 0 skipped

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant