Execute primitive numeric operators with RowFn - #9345
Conversation
Merging this PR will degrade performance by 16.25%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
ab0697a to
b63ded4
Compare
## Rationale for this change Lets indexed lane sources return borrowed or otherwise non-`Copy` items. RowFn needs this for typed row inputs without adding a second kernel abstraction. - Progress towards: #9129 ## What changes are included in this PR? Removes the `Copy` bound from `IndexedSource::Item`. It also makes `LaneZip` fields private, validates lengths once in `LaneZip::new`, and removes the repeated assertion from its inline `len` method. This is a prerequisite only. The first production RowFn adopter is in #9345, so there is no meaningful RowFn performance comparison at this layer. ## What APIs are changed? Are there any user-facing changes? `LaneZip` must now be constructed with `LaneZip::new` instead of tuple syntax. The workspace has no direct field construction outside this module. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
e0e1c45 to
f8670a8
Compare
Route primitive numeric kernels through RowFn while retaining Binary as the public scalar function identity. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
f8670a8 to
f108cdd
Compare
|
Here are the local arithmetic benchmark results from the final Rust 1.97.1 run. The comparison used a The machine was an AMD Ryzen 9 7950X running Linux. The build used rustc 1.97.1, LLVM 22.1.6, one CGU, fat LTO, and Negative changes are faster. The values are medians across the seven paired runs. The main results are:
A separate comparison covered the later naming and structural cleanup. All 24 RowFn matrix cases remained between 2.59% faster and 1.09% slower. RowFn arithmetic matrix: 24 cases
Existing arithmetic cases and controls: 28 cases
|
Rationale for this change
Makes primitive arithmetic the first production user of
RowFn.Binarykeeps its registered identity and existing scalar-function hooks.RowFnover Vortex arrays #9130What changes are included in this PR?
Checked add, subtract, and multiply reduce compact failure evidence outside their vector loops. Integer division stops at the first failure and writes directly into uninitialized output. Decimal arithmetic remains on its existing columnar path.
Rust 1.97.1 and LLVM 22.1.6 measurements used one CGU, fat LTO, and
target-cpu=native. Large per-row-by-per-row add, subtract, and multiply range from 2.7% faster to 4.8% slower. LLVM 22 does not vectorize the mixed-constant add and subtract loops: those cases are 4.6–5.2x slower, and the existingmul_i32_constantcase is 7.5x slower. This is documented as a compiler limitation rather than hidden by framework plumbing.What APIs are changed? Are there any user-facing changes?
There are no public API changes. Primitive arithmetic delegates execution to the private
NumericBinaryrow kernel.