Skip to content

Commit bb3989f

Browse files
authored
GPU Scan (#5012)
GPU specific readers Signed-off-by: Robert Kruszewski <[email protected]>
1 parent 797160d commit bb3989f

File tree

40 files changed

+1435
-310
lines changed

40 files changed

+1435
-310
lines changed

Cargo.lock

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/testfiles/Cargo.lock

Lines changed: 6 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vortex-file/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ all-features = true
1919
[dependencies]
2020
async-trait = { workspace = true }
2121
bytes = { workspace = true }
22+
cudarc = { workspace = true, optional = true }
2223
flatbuffers = { workspace = true }
2324
futures = { workspace = true, features = ["std", "async-await"] }
2425
# Needed to pickup the "wasm_js" feature for wasm targets from the workspace configuration
@@ -44,6 +45,7 @@ vortex-expr = { workspace = true }
4445
vortex-fastlanes = { workspace = true }
4546
vortex-flatbuffers = { workspace = true, features = ["file"] }
4647
vortex-fsst = { workspace = true }
48+
vortex-gpu = { workspace = true, optional = true }
4749
vortex-io = { workspace = true }
4850
vortex-layout = { workspace = true }
4951
vortex-metrics = { workspace = true }
@@ -76,3 +78,10 @@ tokio = [
7678
"vortex-scan/tokio",
7779
]
7880
zstd = ["dep:vortex-zstd", "vortex-layout/zstd"]
81+
gpu = [
82+
"dep:cudarc",
83+
"dep:vortex-gpu",
84+
"vortex-gpu/cuda",
85+
"vortex-layout/gpu",
86+
"vortex-scan/gpu",
87+
]

vortex-file/src/file.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ impl VortexFile {
9090
Ok(ScanBuilder::new(self.layout_reader()?).with_metrics(self.metrics.clone()))
9191
}
9292

93+
#[cfg(feature = "gpu")]
94+
pub fn gpu_scan(
95+
&self,
96+
ctx: Arc<cudarc::driver::CudaContext>,
97+
) -> VortexResult<vortex_scan::gpu::GpuScanBuilder<vortex_gpu::GpuVector>> {
98+
let segment_source = self.segment_source();
99+
let gpu_reader = self
100+
.footer
101+
.layout()
102+
.new_gpu_reader("".into(), segment_source, ctx)?;
103+
104+
Ok(vortex_scan::gpu::GpuScanBuilder::new(gpu_reader))
105+
}
106+
93107
/// Returns true if the expression will never match any rows in the file.
94108
pub fn can_prune(&self, filter: &ExprRef) -> VortexResult<bool> {
95109
let Some((stats, fields)) = self

vortex-gpu/benches/gpu_bitunpack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ fn benchmark_gpu_for_bp_jit_decompress_kernel_only(c: &mut Criterion) {
204204
let mut total_time = Duration::ZERO;
205205
for _ in 0..iters {
206206
// This only measures kernel execution time, not memory transfers
207-
let (_result, kernel_time) = create_run_jit_kernel(ctx.clone(), array).unwrap();
208-
total_time += kernel_time;
207+
let (_result, kernel_time) = create_run_jit_kernel(&ctx, array).unwrap();
208+
total_time += kernel_time.elapsed().unwrap();
209209
}
210210
total_time
211211
});

0 commit comments

Comments
 (0)