Execute tensor product functions with RowFn - #9769
Conversation
Merging this PR will improve performance by 74.77%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | column_x_constant[2] |
457.8 µs | 131 µs | ×3.5 |
| ⚡ | Simulation | column_x_constant[32] |
393 µs | 131.8 µs | ×3 |
| ⚡ | Simulation | column_x_column[2] |
203.5 µs | 101.6 µs | ×2 |
| ⚡ | Simulation | column_x_constant[256] |
593.7 µs | 311.4 µs | +90.66% |
| ⚡ | Simulation | nullable[2] |
593.3 µs | 324.4 µs | +82.9% |
| ⚡ | Simulation | non_nullable[2] |
593.7 µs | 328.6 µs | +80.68% |
| ⚡ | Simulation | column_x_extension_constant[2] |
247.3 µs | 146.7 µs | +68.65% |
| ⚡ | Simulation | nullable[2] |
631.4 µs | 417 µs | +51.41% |
| ⚡ | Simulation | column_x_extension_constant[256] |
418.8 µs | 277.3 µs | +51% |
| ⚡ | Simulation | non_nullable[2] |
630.7 µs | 419.3 µs | +50.43% |
| ⚡ | Simulation | column_x_extension_constant[32] |
171.2 µs | 134.6 µs | +27.22% |
| ⚡ | Simulation | column_x_column[32] |
94.7 µs | 76.6 µs | +23.57% |
| ⚡ | Simulation | column_x_column[256] |
88.8 µs | 75.1 µs | +18.33% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ct/row-fn-tensor-products-v2 (79a44f7) with develop (d0a42e6)2
Footnotes
-
218 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. ↩
-
No successful run was found on
develop(47c76eb) during the generation of this report, so d0a42e6 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
f280e27 to
9a47353
Compare
9a47353 to
fa4e555
Compare
6e3be68 to
288aec3
Compare
288aec3 to
4f0fa1a
Compare
4f0fa1a to
b37f665
Compare
b37f665 to
4bd332d
Compare
4bd332d to
e12771e
Compare
e12771e to
444f3ee
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
444f3ee to
79a44f7
Compare
Summary
Moves inner product and cosine similarity to RowFn without changing their arithmetic contracts.
Changes
Inner product keeps the existing left-to-right multiply-and-sum order. Cosine computes that dot product followed by both L2 norms and the existing zero-denominator guard, with no encoded reduction, reassociation, or constant-norm shortcut. Tests cover nulls, empty and zero-width rows, IEEE overflow and underflow, and bitwise agreement between constant encodings and materialized rows.