Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions .github/workflows/bench-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ jobs:
extra_args: "--off-cpu-threshold=0.03" # Personally tuned by @brancz

- name: Run ${{ matrix.benchmark.name }} benchmark
continue-on-error: true
shell: bash
env:
RUST_BACKTRACE: full
FLAT_LAYOUT_INLINE_ARRAY_NODE: true
run: |
bash scripts/bench-taskset.sh target/release_debug/${{ matrix.benchmark.id }} -d gh-json -o results.json

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ jobs:
extra_args: "--off-cpu-threshold=0.03" # Personally tuned by @brancz

- name: Run ${{ matrix.benchmark.name }} benchmark
continue-on-error: true
shell: bash
env:
RUST_BACKTRACE: full
FLAT_LAYOUT_INLINE_ARRAY_NODE: true
run: |
bash scripts/bench-taskset.sh target/release_debug/${{ matrix.benchmark.id }} --formats ${{ matrix.benchmark.formats }} -d gh-json -o results.json

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/sql-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ jobs:

- name: Run ${{ matrix.name }} benchmark
if: matrix.remote_storage == null || github.event.pull_request.head.repo.fork == true
continue-on-error: true
shell: bash
env:
FLAT_LAYOUT_INLINE_ARRAY_NODE: true
OTEL_SERVICE_NAME: "vortex-bench"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_EXPORTER_OTLP_ENDPOINT: "${{ (inputs.mode != 'pr' || github.event.pull_request.head.repo.fork == false) && secrets.OTEL_EXPORTER_OTLP_ENDPOINT || '' }}"
Expand All @@ -212,8 +214,10 @@ jobs:

- name: Run ${{ matrix.name }} benchmark (remote)
if: matrix.remote_storage != null && (inputs.mode != 'pr' || github.event.pull_request.head.repo.fork == false)
continue-on-error: true
shell: bash
env:
FLAT_LAYOUT_INLINE_ARRAY_NODE: true
AWS_REGION: "us-east-1"
OTEL_SERVICE_NAME: "vortex-bench"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
Expand Down
4 changes: 4 additions & 0 deletions encodings/bytebool/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ impl vortex_array::arrays::dict::take::TakeExecute for vortex_bytebool::ByteBool

pub fn vortex_bytebool::ByteBool::take(array: vortex_array::array::view::ArrayView<'_, Self>, indices: &vortex_array::array::erased::ArrayRef, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>

impl vortex_array::arrays::filter::kernel::FilterReduce for vortex_bytebool::ByteBool

pub fn vortex_bytebool::ByteBool::filter(array: vortex_array::array::view::ArrayView<'_, Self>, mask: &vortex_mask::Mask) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>

impl vortex_array::arrays::slice::SliceReduce for vortex_bytebool::ByteBool

pub fn vortex_bytebool::ByteBool::slice(array: vortex_array::array::view::ArrayView<'_, Self>, range: core::ops::range::Range<usize>) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
Expand Down
2 changes: 2 additions & 0 deletions encodings/bytebool/src/rules.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

use vortex_array::arrays::filter::FilterReduceAdaptor;
use vortex_array::arrays::slice::SliceReduceAdaptor;
use vortex_array::optimizer::rules::ParentRuleSet;
use vortex_array::scalar_fn::fns::cast::CastReduceAdaptor;
Expand All @@ -12,4 +13,5 @@ pub(crate) static RULES: ParentRuleSet<ByteBool> = ParentRuleSet::new(&[
ParentRuleSet::lift(&CastReduceAdaptor(ByteBool)),
ParentRuleSet::lift(&MaskReduceAdaptor(ByteBool)),
ParentRuleSet::lift(&SliceReduceAdaptor(ByteBool)),
ParentRuleSet::lift(&FilterReduceAdaptor(ByteBool)),
]);
17 changes: 17 additions & 0 deletions encodings/bytebool/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ use std::ops::Range;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::IntoArray;
use vortex_array::arrays::filter::FilterReduce;
use vortex_array::arrays::slice::SliceReduce;
use vortex_error::VortexResult;
use vortex_mask::Mask;

use crate::ByteBool;

Expand All @@ -22,3 +24,18 @@ impl SliceReduce for ByteBool {
))
}
}

impl FilterReduce for ByteBool {
fn filter(array: ArrayView<'_, Self>, mask: &Mask) -> VortexResult<Option<ArrayRef>> {
if array.buffer().is_on_host() && mask.true_count() * 2 > mask.len() {
return Ok(None);
}
Ok(Some(
ByteBool::new(
array.buffer().filter(mask, size_of::<u8>())?,
array.validity()?.filter(mask)?,
)
.into_array(),
))
}
}
2 changes: 1 addition & 1 deletion encodings/fastlanes/src/bitpacking/array/unpack_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<T: BitPacked> BitUnpackedChunks<T> {
pub fn try_new(array: &BitPackedData, len: usize) -> VortexResult<Self> {
Self::try_new_with_strategy(
BitPackingStrategy,
array.packed().clone().unwrap_host(),
array.packed().clone().try_into_host_sync()?,
array.bit_width() as usize,
array.offset() as usize,
len,
Expand Down
29 changes: 12 additions & 17 deletions encodings/fsst/src/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,23 @@ pub(crate) fn fsst_decode_views(
.execute::<PrimitiveArray>(ctx)?;

#[expect(clippy::cast_possible_truncation)]
let total_size: usize = match_each_integer_ptype!(uncompressed_lens_array.ptype(), |P| {
uncompressed_lens_array
.as_slice::<P>()
.iter()
.map(|x| *x as usize)
.sum()
});

// Bulk-decompress the entire array.
let decompressor = fsst_array.decompressor();
let mut uncompressed_bytes = ByteBufferMut::with_capacity(total_size + 7);
let len =
decompressor.decompress_into(bytes.as_slice(), uncompressed_bytes.spare_capacity_mut());
unsafe { uncompressed_bytes.set_len(len) };

// Directly create the binary views.
match_each_integer_ptype!(uncompressed_lens_array.ptype(), |P| {
let uncompressed_lengths = uncompressed_lens_array.as_slice::<P>();
let total_size: usize = uncompressed_lengths.iter().map(|x| *x as usize).sum();

// Bulk-decompress the entire array.
let decompressor = fsst_array.decompressor();
let mut uncompressed_bytes = ByteBufferMut::with_capacity(total_size + 7);
let len =
decompressor.decompress_into(bytes.as_slice(), uncompressed_bytes.spare_capacity_mut());
unsafe { uncompressed_bytes.set_len(len) };

// Directly create the binary views.
Ok(build_views(
start_buf_index,
MAX_BUFFER_LEN,
uncompressed_bytes,
uncompressed_lens_array.as_slice::<P>(),
uncompressed_lengths,
))
})
}
Expand Down
Loading
Loading