Skip to content

Execute tensor product functions with RowFn - #9769

Draft
connortsui20 wants to merge 1 commit into
ct/row-fn-tensor-l2-v2from
ct/row-fn-tensor-products-v2
Draft

Execute tensor product functions with RowFn#9769
connortsui20 wants to merge 1 commit into
ct/row-fn-tensor-l2-v2from
ct/row-fn-tensor-products-v2

Conversation

@connortsui20

@connortsui20 connortsui20 commented Sep 4, 2026

Copy link
Copy Markdown
Member

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.

@connortsui20 connortsui20 added the changelog/skip Do not list PR in the changelog label Sep 4, 2026
@codspeed-hq

codspeed-hq Bot commented Sep 4, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 77.54%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 14 improved benchmarks
✅ 2173 untouched benchmarks
⏩ 218 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation column_x_constant[2] 486.9 µs 127.7 µs ×3.8
Simulation column_x_constant[32] 422.2 µs 128.5 µs ×3.3
Simulation column_x_constant[256] 637.6 µs 309.6 µs ×2.1
Simulation column_x_column[2] 205.3 µs 101 µs ×2
Simulation column_x_extension_constant[256] 540.2 µs 277.6 µs +94.56%
Simulation nullable[2] 592.5 µs 323.2 µs +83.32%
Simulation non_nullable[2] 594 µs 327.4 µs +81.41%
Simulation column_x_extension_constant[2] 235.4 µs 144.3 µs +63.09%
Simulation nullable[2] 630.5 µs 417.1 µs +51.15%
Simulation non_nullable[2] 631 µs 419.3 µs +50.5%
Simulation column_x_extension_constant[32] 191.7 µs 132.6 µs +44.58%
Simulation column_x_column[32] 96.2 µs 76.8 µs +25.25%
Simulation column_x_column[256] 90.6 µs 74.6 µs +21.47%
Simulation allocate_drop_bytes[0] 520.2 ns 466 ns +11.62%

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 (4f0fa1a) with develop (a997c3f)2

Open in CodSpeed

Footnotes

  1. 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.

  2. No successful run was found on ct/row-fn-tensor-l2-v2 (5974184) during the generation of this report, so develop (a997c3f) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from f280e27 to 9a47353 Compare September 4, 2026 17:35
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from 9a47353 to fa4e555 Compare September 4, 2026 17:59
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch 2 times, most recently from 6e3be68 to 288aec3 Compare September 4, 2026 18:53
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from 288aec3 to 4f0fa1a Compare September 4, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/skip Do not list PR in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant