-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add instructions on running PDS-H #23025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 13 commits into
NVIDIA:main
from
Matt711:imp/docs/polars-tpch-benchmark-instructions
Jul 2, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
79e7e2b
Add instructions for running TPC-H benchmarks
Matt711 41df94c
add env vars and tuning section
Matt711 6a84f1a
clarify example scale factor
Matt711 4df77a1
Merge branch 'main' into imp/docs/polars-tpch-benchmark-instructions
Matt711 1de60ed
add cpu section and results sections
Matt711 74defc6
address reviews
Matt711 05ea9ed
specify pinned memory defaults
Matt711 be44f90
add a TODO for num_streaming_threads=8 default outside the benchmark …
Matt711 e28cc86
dont set cpu threds=1 for cpu engines, include env in tracked list
Matt711 92da78c
Merge branch 'main' into imp/docs/polars-tpch-benchmark-instructions
Matt711 9d31e22
add cpu-only instructions
Matt711 90c2f79
update framing
Matt711 e1964c5
Merge branch 'main' into imp/docs/polars-tpch-benchmark-instructions
Matt711 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| # Benchmarks | ||
|
|
||
| <!-- TODO: add PDS-DS (TPC-DS variant) section, mirroring the PDS-H instructions below --> | ||
|
|
||
| ## PDS-H (TPC-H variant) | ||
|
|
||
| The steps below reproduce the PDS-H benchmark results using the Polars GPU engine. | ||
|
|
||
| ### Setup | ||
|
|
||
| **GPU machines** can run both CPU and GPU benchmarks. Install `cudf-polars` following the | ||
| [RAPIDS installation guide](https://docs.rapids.ai/install). For nightly wheels, install with | ||
| the `ray` extra (required for multi-GPU benchmarking): | ||
|
|
||
| ```bash | ||
| CUDA_MAJOR=$(nvidia-smi | grep -oP 'CUDA Version: \K[0-9]+') | ||
| pip install --extra-index-url https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \ | ||
| "cudf-polars-cu${CUDA_MAJOR}[ray]>=0.0.0a0" | ||
| ``` | ||
|
|
||
| Because `cudf-polars` pins to a tested range of Polars versions, the nightly wheel will install | ||
| the highest Polars version the GPU engine currently supports, which may not be the latest | ||
| Polars release. | ||
|
|
||
| <!-- TODO: consider adding a [benchmark] pip extra to cudf-polars that includes tpchgen-cli | ||
| (and possibly structlog) so benchmark dependencies can be installed in one step: | ||
| pip install "cudf-polars-cu${CUDA_MAJOR}[ray,benchmark]>=0.0.0a0" | ||
| Requires changes to pyproject.toml and dependencies.yaml. --> | ||
|
|
||
| **CPU-only machines** (no CUDA) can only run the `--frontend polars-cpu` benchmark. Since the | ||
| `cudf-polars` GPU wheels require CUDA, install from source instead: | ||
|
|
||
| ```bash | ||
| git clone --depth=1 https://github.com/rapidsai/cudf.git | ||
| pip install --no-deps ./cudf/python/cudf_polars | ||
| pip install polars nvtx | ||
| ``` | ||
|
|
||
| Then install `tpchgen-cli`, a Rust-based TPC-H data generator used to produce the benchmark | ||
| dataset as Parquet files: | ||
|
|
||
| ```bash | ||
| pip install tpchgen-cli | ||
| ``` | ||
|
|
||
| ### Generate data | ||
|
|
||
| Set the scale factor once and reuse it across all steps. The following generates SF1000 | ||
| (scale factor 1000, roughly 1TB of data): | ||
|
|
||
| ```bash | ||
| export SCALE_FACTOR=1000.0 | ||
| export DATA_PATH="data/tables/scale-${SCALE_FACTOR}" | ||
|
|
||
| tpchgen-cli --output-dir="${DATA_PATH}" --format=parquet -s ${SCALE_FACTOR} | ||
| ``` | ||
|
|
||
| ### Run | ||
|
|
||
| **CPU** (`--frontend polars-cpu`, Polars CPU streaming engine): | ||
|
|
||
| ```bash | ||
| python -m cudf_polars.streaming.benchmarks.pdsh all \ | ||
| --frontend polars-cpu \ | ||
| --path "${DATA_PATH}" | ||
| ``` | ||
|
|
||
| **Single GPU** (`--frontend spmd`, single-process streaming executor, equivalent to `collect(engine="gpu")`): | ||
|
|
||
| ```bash | ||
| python -m cudf_polars.streaming.benchmarks.pdsh all \ | ||
| --frontend spmd \ | ||
| --path "${DATA_PATH}" | ||
| ``` | ||
|
|
||
| **Multi GPU** (`--frontend ray`, Ray-managed distributed streaming executor): | ||
|
|
||
| If running inside a Docker container, increase `/dev/shm` by passing `--shm-size=16g` to | ||
| `docker run`. All multi-GPU frontends use UCX for intra-node communication, which relies on | ||
| POSIX shared memory (`/dev/shm`) for GPU-to-GPU transfers. Docker's default `/dev/shm` is | ||
| 64MB, which is far too small and will cause failures on any non-trivial workload. | ||
|
|
||
| By default all visible GPUs are used. To select specific devices, set `CUDA_VISIBLE_DEVICES`. | ||
| To limit the number of GPUs, use `--num-gpus`: | ||
|
|
||
| ```bash | ||
| # All visible GPUs | ||
| python -m cudf_polars.streaming.benchmarks.pdsh all \ | ||
| --frontend ray \ | ||
| --path "${DATA_PATH}" | ||
|
|
||
| # Specific devices | ||
| CUDA_VISIBLE_DEVICES=0,1,2,3 python -m cudf_polars.streaming.benchmarks.pdsh all \ | ||
| --frontend ray \ | ||
| --path "${DATA_PATH}" | ||
|
|
||
| # Limit to N GPUs | ||
| python -m cudf_polars.streaming.benchmarks.pdsh all \ | ||
| --frontend ray \ | ||
| --num-gpus 4 \ | ||
| --path "${DATA_PATH}" | ||
| ``` | ||
|
|
||
| ### Results | ||
|
|
||
| Results are written to `pdsh_results.jsonl` in the current directory by default (override with `-o`). | ||
| Each run appends one JSON line containing metadata and a `records` field with per-query, | ||
| per-iteration timings: | ||
|
|
||
| ```json | ||
| { | ||
| "engine_name": "cudf-polars", | ||
| "frontend": "spmd", | ||
| "dataset_path": "data/tables/scale-1000.0", | ||
| "scale_factor": 1000, | ||
| "records": { | ||
| "1": [ | ||
| {"query": 1, "iteration": 0, "duration": 0.79, "status": "success"}, | ||
| {"query": 1, "iteration": 1, "duration": 0.55, "status": "success"} | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| `duration` is in seconds. Running multiple frontends with the same `-o` file appends each as a | ||
| separate line, making it easy to compare CPU and GPU results in one file. | ||
|
|
||
| ### Tuning | ||
|
|
||
| The commands above use default settings, which gives a realistic baseline without manual tuning. The most impactful options to adjust are: | ||
|
|
||
| | Option | Description | | ||
| |--------|-------------| | ||
| | `--target-partition-size` | Target IO chunk size in bytes fed to the GPU. The most impactful lever; tune this first if query performance is below expectations. Default: `min(2.5% of smallest GPU memory, 1.5GB)`. | | ||
| | `--broadcast-limit` | Maximum table size in bytes for broadcast joins instead of shuffle. Increasing this can significantly speed up join-heavy queries. Default: `min(15% of smallest GPU memory, 16GB)`. | | ||
| | `--spill-device-limit` | GPU memory usage percentage before spilling to host. Lower this if hitting out-of-memory errors. Default: `80%`. | | ||
| | `--pinned-memory` / `--pinned-initial-pool-size` | Enable a pinned host memory pool for faster CPU-to-GPU transfers. Off by default. When enabled, the pool starts empty and grows up to 80% of host memory per GPU; set `--pinned-initial-pool-size` (bytes) to pre-allocate capacity upfront. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.