Skip to content

Execute Widen and legacy decimal reads on the GPU #11284

Open

Description

@connortsui20

Progress towards #10701.

GPU reads of two kinds of decimal data fail, one today and one once CD5 lands, because the reader returns an array that CUDA cannot execute. The CPU fallback only runs when every buffer is on the host, so a device read errors instead of falling back (vortex-cuda/src/executor.rs).

1. Widen has no CUDA kernel

After CD5, every DecimalByteParts array with a narrow MSP reads from a file with an integer Widen as its MSP, so a GPU read of such a column fails with "CPU fallback with device-resident buffers is not supported". A kernel for vortex.widen fixes it: it extends the child into a new buffer at the logical width (sign extension for signed integers and decimals, zero extension for unsigned integers) and keeps the validity. A decimal Widen can reuse the kernels in vortex-cuda/kernels/src/decimal_cast.cu. CD5 can't merge before this part.

2. Legacy vortex.decimal nodes fail on the GPU

Since #10995, a legacy vortex.decimal node, stored at a width other than the canonical width of its precision, is read through WidenArray::from_stored_decimal, which scans the values to pick the precision of the Widen child. The read plugin is synchronous and has no CUDA stream, so it can't scan a device buffer and fails with "Decimal storage at a noncanonical width must be in host memory, got device memory" (vortex-array/src/arrays/widen/encode/decimal.rs). A CUDA session can register its own vortex.decimal reader instead, since ArraySession::register replaces the reader with the same ID, and that reader can reuse the kernel from part 1. CD5 doesn't depend on this part.

Open question: should the CUDA reader trust the stored precision and sign-extend to the canonical width on the device, as canonical reads already trust it, or scan on the device? Narrowing storage that is wider than the canonical width needs either that trust or an overflow check.

ok were going to hard error on this and fix this later in the cuda executor for decimal

Originally posted by @connortsui20 in #10995

Activity

  1. connortsui20 commented on Nov 5, 2026

    @connortsui20
    MemberAuthor
  2. changed the title [-]Fix legacy decimal read on GPU[/-] [+]Execute `Widen` and legacy decimal reads on the GPU[/+] on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions