feat(fastlanes): compute kernels for BitPackedV2 - #9751
Conversation
Merging this PR will degrade performance by 14.48%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | slice_tight_loop_vortex[65536] |
59.3 µs | 121.8 µs | -51.32% |
| ❌ | Simulation | slice_empty_tight_loop_vortex |
41.2 µs | 71.3 µs | -42.26% |
| ❌ | Simulation | bitwise_and_vortex_buffer[128] |
3.9 µs | 6.4 µs | -39.33% |
| ❌ | Simulation | bitwise_or_vortex_buffer[128] |
3.9 µs | 6.4 µs | -38.8% |
| ❌ | Simulation | take_fsl_f16_force_per_index[2048, 10] |
361.1 µs | 581 µs | -37.84% |
| ❌ | Simulation | take_fsl_f16_force_per_index[1024, 10] |
209.4 µs | 320.2 µs | -34.59% |
| ❌ | Simulation | bitwise_not_vortex_buffer[128] |
4.7 µs | 6.8 µs | -31.27% |
| ❌ | Simulation | random_i8[0.5] |
67.3 µs | 96.5 µs | -30.29% |
| ❌ | Simulation | cached_indices_i32[0.01] |
36.2 µs | 52 µs | -30.23% |
| ❌ | Simulation | take_fsl_f16_force_per_index[512, 10] |
134.1 µs | 189.1 µs | -29.11% |
| ❌ | Simulation | in_place_nullable[16384] |
36.2 µs | 50.9 µs | -28.89% |
| ❌ | Simulation | bitand_owned_lhs_vortex_buffer[128] |
4.6 µs | 6 µs | -23.41% |
| ❌ | Simulation | take_fsl_f16_force_per_index[256, 10] |
94.5 µs | 122.7 µs | -23.03% |
| ❌ | Simulation | bitand_owned_lhs_vortex_buffer[1024] |
4.8 µs | 6.2 µs | -22.73% |
| ❌ | Simulation | bitand_owned_lhs_vortex_buffer[2048] |
5 µs | 6.4 µs | -21.89% |
| ❌ | Simulation | new_raw_prim_test_between[i32, 2048] |
61.3 µs | 78.1 µs | -21.45% |
| ❌ | Simulation | chunked_constant_i32_append_to_builder[(10, 100)] |
62.4 µs | 79.2 µs | -21.2% |
| ❌ | Simulation | slice_vortex_buffer |
6.6 µs | 8.2 µs | -19.81% |
| ❌ | Simulation | bitwise_and_vortex_buffer[1024] |
4.2 µs | 5.2 µs | -18.98% |
| ❌ | Simulation | bitwise_or_vortex_buffer[2048] |
4.6 µs | 5.6 µs | -17.81% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing mk/bitpacked-v2-kernels (34bd0f3) with mk/bitpacked-v2 (7de5950)
Footnotes
-
284 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
A new fastlanes.bitpacked_v2 encoding that packs every 1024-element chunk at its own width. Widths are chosen per chunk from the chunk's histogram using its exact packed-block cost plus the exceptions left behind, and the histogram, width choice, exception gathering and packing all happen while the chunk is in cache. Values that do not fit their chunk's width become patches, as in BitPacked. Serde carries one width byte per chunk. This is the array only: encode, decode, scalar_at, validity and serde. Compute kernels follow in a separate change, so filter, take, compare and slice fall back to canonicalisation for now. BitPacked is unchanged and nothing writes v2 yet. Signed-off-by: Matt Katz <mhkatz97@gmail.com>
a1347d9 to
7de5950
Compare
Port slice (reduce and execute), take, filter, fused compare, between, streaming predicate, cast and is_constant to BitPackedV2, indexing each chunk's packed block through the width table, and register them alongside the v1 kernels. Signed-off-by: Matt Katz <mhkatz97@gmail.com>
5124963 to
34bd0f3
Compare
7de5950 to
b5b9d6d
Compare
|
Superseded: the stack now follows the one-array model (one in-memory BitPacked, two wire formats) in #9750, so the kernels are edited in place there instead of ported to a second encoding. |
Summary
Stacked on #9750. Ports the
BitPackedcompute kernels toBitPackedV2so the new encoding no longer falls back to canonicalisation for slice, take, filter, compare, between, cast andis_constant.compute/: slice (reduce and execute), take, filter, fused compare against a constant, between, streaming predicate, cast (nullability-only reduce and widening execute),is_constant.vtable:reduce_parentrules for slice and cast, kernel registration ininitialize, and theis_constantaggregate kernel.unpack_itergains back the chunk-walking helpers only the kernels use (for_each_packed_chunk,for_each_unpacked_chunk,decode_map_into) andbitpack_decompressthe mapped unpack used by cast.Each kernel is the v1 kernel with the chunk lookup changed to go through the per-chunk width table; after renaming, the non-test kernel code differs from v1 by 2 to 19 lines per file. The fused compare additionally handles zero-width chunks, which v1 could only see as a whole-array degenerate case.
Tests
The v1 kernel tests are carried over, including the fused-compare sweeps that assert the streaming kernel engages rather than falling back, plus the slice tests that go through
reduce_parent. The per-chunk behavioural suite from #9750 now exercises the kernels instead of the fallbacks.Validation
cargo nextest run -p vortex-fastlanes(463 tests)cargo clippy -p vortex-fastlanes --all-targets --all-features,cargo +nightly fmt --all