Skip to content

Execute tensor product functions with RowFn - #9769

Merged
robert3005 merged 1 commit into
developfrom
ct/row-fn-tensor-products-v2
Sep 15, 2026
Merged

robert3005 merged 1 commit into
developfrom
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

codspeed Bot commented Sep 4, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 74.77%

⚠️ 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

⚡ 13 improved benchmarks
✅ 2185 untouched benchmarks
⏩ 218 skipped benchmarks1

Performance Changes

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

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

@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
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from 288aec3 to 4f0fa1a Compare September 4, 2026 18:57
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from 4f0fa1a to b37f665 Compare September 8, 2026 21:55
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from b37f665 to 4bd332d Compare September 10, 2026 20:50
@connortsui20
connortsui20 marked this pull request as ready for review September 14, 2026 20:36
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from 4bd332d to e12771e Compare September 14, 2026 20:37
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from e12771e to 444f3ee Compare September 14, 2026 20:41
Base automatically changed from ct/row-fn-tensor-l2-v2 to develop September 15, 2026 12:27
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from 444f3ee to 79a44f7 Compare September 15, 2026 12:27
@robert3005
robert3005 merged commit 3e2b65c into develop Sep 15, 2026
118 of 119 checks passed
@robert3005
robert3005 deleted the ct/row-fn-tensor-products-v2 branch September 15, 2026 12:48
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.

2 participants