-
Notifications
You must be signed in to change notification settings - Fork 137
parquet bench + cuda changes to scan clickbench #6739
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
Draft
onursatici
wants to merge
14
commits into
os/gpu-scan-bench
Choose a base branch
from
os/parquet-bench
base: os/gpu-scan-bench
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f08430d
gpu scan bench
onursatici 15b87c4
parquet bench
onursatici 0a7058d
fix from impl
onursatici 6744166
tokio
onursatici 96d37fb
zstd
onursatici 36bbe76
ffor, datetimeparts
onursatici 9676670
constant
onursatici 8bbe843
tracing launch strategy only on perfetto
onursatici e474389
validate only on debug
onursatici c237031
use a cuda context per batch and add buffered
onursatici eb12dd9
data-gen can create vortex-cuda for benchmarks
onursatici c6e294f
stream parquet
onursatici 0780c87
cuda to have 128MB chunks
onursatici 4be081e
s3fs to uv
onursatici 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| [package] | ||
| name = "gpu-scan-bench" | ||
| authors = { workspace = true } | ||
| description = "CUDA GPU scan benchmarks for S3/NVMe" | ||
| edition = { workspace = true } | ||
| homepage = { workspace = true } | ||
| include = { workspace = true } | ||
| keywords = { workspace = true } | ||
| license = { workspace = true } | ||
| publish = false | ||
| repository = { workspace = true } | ||
| rust-version = { workspace = true } | ||
| version = { workspace = true } | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [dependencies] | ||
| clap = { workspace = true, features = ["derive"] } | ||
| futures = { workspace = true, features = ["executor"] } | ||
| object_store = { workspace = true, features = ["aws", "fs"] } | ||
| tokio = { workspace = true, features = ["macros", "full"] } | ||
| tracing = { workspace = true, features = ["std", "attributes"] } | ||
| tracing-perfetto = { workspace = true } | ||
| tracing-subscriber = { workspace = true, features = ["env-filter", "json"] } | ||
| url = { workspace = true } | ||
| vortex = { workspace = true, features = ["tokio", "zstd"] } | ||
| vortex-cuda = { workspace = true, features = ["_test-harness", "unstable_encodings"] } | ||
| vortex-cuda-macros = { workspace = true } |
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,101 @@ | ||
| #!/usr/bin/env -S uv run --script | ||
| # /// script | ||
| # requires-python = ">=3.12" | ||
| # dependencies = [ | ||
| # "cudf-cu12", | ||
| # "s3fs", | ||
| # ] | ||
| # | ||
| # [tool.uv] | ||
| # extra-index-url = ["https://pypi.nvidia.com"] | ||
| # /// | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright the Vortex contributors | ||
| # | ||
| # Benchmark reading a Parquet file into GPU memory using cuDF. | ||
| # This serves as the baseline for comparing against Vortex GPU scans. | ||
| # | ||
| # Usage: | ||
| # uv run bench_parquet.py dataset.parquet --iterations 5 | ||
|
|
||
| import argparse | ||
| import sys | ||
| import time | ||
|
|
||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser( | ||
| description="Benchmark cuDF GPU parquet reads", | ||
| ) | ||
| parser.add_argument("source", help="Path to parquet file") | ||
| parser.add_argument("--iterations", type=int, default=1, help="Number of scan iterations") | ||
| parser.add_argument( | ||
| "--row-group-batch-size", | ||
| type=int, | ||
| default=1, | ||
| help="Number of parquet row groups to read per cuDF call when streaming", | ||
| ) | ||
| parser.add_argument( | ||
| "--full-file-read", | ||
| action="store_true", | ||
| help="Read the full parquet file in one call (old behavior, can OOM)", | ||
| ) | ||
| args = parser.parse_args() | ||
|
|
||
| import cudf | ||
| import fsspec | ||
| import pyarrow.parquet as pq | ||
|
|
||
| source = args.source | ||
| if args.row_group_batch_size < 1: | ||
| raise ValueError("--row-group-batch-size must be >= 1") | ||
|
|
||
| fs, fs_path = fsspec.core.url_to_fs(source) | ||
| file_size = fs.size(fs_path) | ||
| file_size_mb = file_size / (1024 * 1024) | ||
|
|
||
| num_row_groups = None | ||
| if not args.full_file_read: | ||
| with fs.open(fs_path, "rb") as parquet_file: | ||
| num_row_groups = pq.ParquetFile(parquet_file).metadata.num_row_groups | ||
| print( | ||
| f"Streaming parquet by row groups: {num_row_groups} total, " | ||
| f"batch size={args.row_group_batch_size}", | ||
| file=sys.stderr, | ||
| ) | ||
|
|
||
| iteration_secs = [] | ||
| for i in range(args.iterations): | ||
| start = time.perf_counter() | ||
| if args.full_file_read: | ||
| df = cudf.read_parquet(source) | ||
| del df | ||
| else: | ||
| for rg_start in range(0, num_row_groups, args.row_group_batch_size): | ||
| row_groups = list( | ||
| range(rg_start, min(rg_start + args.row_group_batch_size, num_row_groups)) | ||
| ) | ||
| df = cudf.read_parquet(source, row_groups=row_groups) | ||
| del df | ||
| elapsed = time.perf_counter() - start | ||
| iteration_secs.append(elapsed) | ||
| print( | ||
| f"Iteration {i + 1}/{args.iterations}: {elapsed:.3f}s", | ||
| file=sys.stderr, | ||
| ) | ||
|
|
||
| avg_secs = sum(iteration_secs) / len(iteration_secs) | ||
| throughput_mbs = file_size_mb / avg_secs | ||
|
|
||
| print(file=sys.stderr) | ||
| print("=== Benchmark Results ===", file=sys.stderr) | ||
| print(f"Source: {source}", file=sys.stderr) | ||
| print(f"Iterations: {args.iterations}", file=sys.stderr) | ||
| print(f"Avg time: {avg_secs:.3f}s", file=sys.stderr) | ||
| print(f"File size: {file_size_mb:.2f} MB", file=sys.stderr) | ||
| print(f"Throughput: {throughput_mbs:.2f} MB/s", file=sys.stderr) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a standalone uv script to do the same scan we do on
gpu-scan-benchabove, but for parquet instead of vortex