diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index b61df171865..f9b5f3552b8 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -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 @@ -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: >- diff --git a/vortex-cuda/benches/onpair_cuda.rs b/vortex-cuda/benches/onpair_cuda.rs index 0aa716f0c0a..d02fdc37663 100644 --- a/vortex-cuda/benches/onpair_cuda.rs +++ b/vortex-cuda/benches/onpair_cuda.rs @@ -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; @@ -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, @@ -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();