Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ jobs:
--bench date_time_parts_cuda \
--bench dict_cuda \
--bench fsst_cuda \
--bench onpair_cuda \
--bench runend_cuda \
--profile bench
- name: Package CUB shared library
Expand All @@ -255,7 +256,7 @@ jobs:
include:
- { shard: 1, name: "Bitpacked", benches: "bitpacked_cuda" }
- { shard: 2, name: "Dynamic dispatch", benches: "dynamic_dispatch_cuda" }
- { shard: 3, name: "Standalone kernels", benches: "alp_cuda date_time_parts_cuda dict_cuda fsst_cuda runend_cuda" }
- { shard: 3, name: "Standalone kernels", benches: "alp_cuda date_time_parts_cuda dict_cuda fsst_cuda onpair_cuda runend_cuda" }
name: "Benchmark with Codspeed (CUDA Shard #${{ matrix.shard }} - ${{ matrix.name }})"
timeout-minutes: 30
runs-on: >-
Expand Down
35 changes: 35 additions & 0 deletions vortex-cuda/benches/onpair_cuda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ use vortex::dtype::Nullability;
use vortex::error::VortexExpect;
use vortex_cuda::CudaDispatchMode;
use vortex_cuda::CudaSession;
use vortex_cuda::VarBinExportLayout;
use vortex_cuda::arrow::DeviceArrayExt;
use vortex_cuda::arrow::release_device_array;
use vortex_cuda::executor::CudaArrayExt;
use vortex_cuda_macros::cuda_available;
use vortex_cuda_macros::cuda_not_available;
Expand All @@ -37,6 +40,14 @@ use crate::timed_launch_strategy::TimedLaunchStrategy;
// other kernels benchmark.
const BENCH_SIZES: &[(usize, &str)] = &[(10_000_000, "10M")];

fn session_with_varbin_layout(layout: VarBinExportLayout) -> vortex::session::VortexSession {
vortex::array::array_session().with_some(
CudaSession::try_default()
.vortex_expect("failed to create CUDA session")
.with_varbin_export_layout(layout),
)
}

struct OnPairBenchFixture {
array: ArrayRef,
uncompressed_size: u64,
Expand Down Expand Up @@ -92,6 +103,30 @@ fn benchmark_onpair_cuda_decompress(c: &mut Criterion) {
});
},
);

group.bench_with_input(
BenchmarkId::new("cuda/onpair/decompress_to_varbin", len_str),
&fixture.array,
|b, onpair_array| {
b.iter_custom(|iters| {
let timed = TimedLaunchStrategy::default();
let timer = timed.timer();
let session = session_with_varbin_layout(VarBinExportLayout::VarBin);
let mut cuda_ctx = CudaSession::create_execution_ctx(&session)
.vortex_expect("failed to create execution context")
.with_dispatch_mode(CudaDispatchMode::StandaloneOnly)
.with_launch_strategy(Arc::new(timed));

for _ in 0..iters {
let mut exported =
block_on(onpair_array.clone().export_device_array(&mut cuda_ctx))
.vortex_expect("export OnPair device array");
release_device_array(&mut exported);
}
Duration::from_nanos(timer.load(Ordering::Relaxed))
});
},
);
}

group.finish();
Expand Down
Loading