CYBERTEC PostgreSQL Blog· Hans-Jürgen Schönig·
CYBERTEC PGEE Adds a GPU Execution Path to PostgreSQL
CYBERTEC PGEE Gets a GPU Execution Path
Key Takeaway
CYBERTEC has introduced PGEE GPU, which gives PostgreSQL a planner-controlled GPU execution path while keeping SQL, schema and application interfaces unchanged.
Why It Matters
Large analytical scans and aggregates can run on GPUs without application changes, with cost-based planner selection and CPU fallback, on PostgreSQL v19 and later.
Technical Breakdown · Distilled from the original source
Execution Model and Planner
- PGEE GPU is a PostgreSQL core change that adds GPU paths to planning; the planner costs them alongside CPU alternatives and picks the GPU only when its cost is lower and correctness is provable.
- A query that starts on the GPU can fall back to the CPU without erroring (e.g. under memory pressure); a single query can mix GPU scans and aggregates with CPU index scans.
- Plans expose GPU work through standard plan machinery, including Custom Scan nodes GpuAggCount, GpuGroupCount, GpuJoinCount, GpuSeqScan and GpuUnionGroup.
- Accelerated operations include scalar aggregates (count, sum, avg, min, max), GROUP BY, DISTINCT, COUNT(DISTINCT), analytics, partial aggregates and star-schema joins; types include int2, int4, int8, dates, timestamps, exact numeric up to precision 18, float4, float8, and text, varchar and UUID dictionary keys.
Visibility and Correctness
- The GPU works on a columnar representation in device memory while PostgreSQL keeps managing MVCC and visibility; cached data is validated against visibility machinery, and unsafe data is handled by the CPU within the same query.
- An internal suite of close to a million distinct SQL statements runs byte-identity checks with zero mismatches, covering mixed SERIALIZABLE transactions, concurrent writers, crash recovery, replication and HA, validated on GB10 and an H200 cluster.
Data Residency and Performance
- Only columns required by the query are cached, typically 4–6x smaller than on-disk data: a 57.3 GB retail dataset takes about 9.5 GB of GPU memory, a 158.4 GB IoT dataset about 38.2 GB; numeric is translated to 128-bit integers.
- First execution pays cache construction; unified memory uses GPU-driven column-store transformation, GPU local memory uses parallel background workers. Published numbers use warm data for both CPU and GPU.
- Eight L40S GPUs scanning and aggregating one billion rows: 159 seconds on a single CPU core versus 2.8 milliseconds, a 57063x difference; H200 reached up to 2.1 trillion rows/second with a 3.7x scale factor on four cards.
- The ML client maps GPU-resident columns to read-only PyTorch tensors via DLPack, with pgee_gpu export bridge and write_back; a 20-million-row, eight-column matrix took 18.1 seconds traditionally versus 0.15 seconds zero-copy (124x), and a 5-million-row eight-float8 benchmark took 4.6751 seconds via COPY and Python versus 0.0415 seconds (112.7x).
Versions and Deployment
- Supported on PostgreSQL v19 and later; GPU support is enabled per session or per role, and disabling it returns to standard PostgreSQL or PGEE GPU behaviour.
- One binary supports AMD ROCm and CUDA fat binaries; CUDA covers A100, L4, L40, L40S, H100, H200, B100, B200, B300, RTX 50xx and GB10.
- Deployable on-premises, on Kubernetes, AWS, Microsoft Azure and Google Cloud, and will be available through CYBERTEC Scalefield.
Source: CYBERTEC PostgreSQL Blog· cybertec-postgresql.com
PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.