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 regress 25 benchmarks

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

⚡ 12 improved benchmarks
❌ 25 regressed benchmarks
✅ 2150 untouched benchmarks
⏩ 218 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation compress_alp[f64, (1000, 0.0, 1.0)] 105 µs 159 µs -33.94%
Simulation compress_alp[f64, (1000, 0.0, 0.25)] 114.4 µs 168.2 µs -32%
Simulation compress_alp[f64, (1000, 0.0, 0.95)] 114.2 µs 167.2 µs -31.68%
Simulation compress_alp[f64, (1000, 0.1, 1.0)] 150.3 µs 211.9 µs -29.09%
Simulation compress_alp[f64, (1000, 0.01, 1.0)] 144.2 µs 201.1 µs -28.27%
Simulation alp_compress_f64 171.8 µs 237.8 µs -27.75%
Simulation compress_alp[f64, (1000, 0.01, 0.25)] 155.1 µs 211.9 µs -26.78%
Simulation compress_alp[f64, (1000, 0.1, 0.25)] 168.4 µs 228.9 µs -26.46%
Simulation compress_alp[f64, (1000, 0.1, 0.95)] 177.5 µs 237.3 µs -25.21%
Simulation compress_alp[f64, (1000, 0.01, 0.95)] 159.6 µs 213.2 µs -25.13%
Simulation compress_alp[f32, (1000, 0.0, 1.0)] 51.9 µs 63.4 µs -18.08%
Simulation compress_alp[f32, (1000, 0.0, 0.95)] 61.1 µs 73.1 µs -16.47%
Simulation compress_alp[f32, (1000, 0.0, 0.25)] 61.2 µs 73.3 µs -16.47%
Simulation compress_alp[f64, (10000, 0.0, 1.0)] 308.2 µs 361 µs -14.64%
Simulation compress_alp[f64, (10000, 0.0, 0.95)] 318.3 µs 370.9 µs -14.19%
Simulation compress_alp[f64, (10000, 0.0, 0.25)] 318.2 µs 370.7 µs -14.16%
Simulation compress_alp[f64, (10000, 0.01, 1.0)] 538.8 µs 616.2 µs -12.57%
Simulation compress_alp[f32, (1000, 0.1, 1.0)] 96.1 µs 109.5 µs -12.19%
Simulation compress_alp[f32, (1000, 0.01, 1.0)] 90.6 µs 103.1 µs -12.08%
Simulation compress_alp[f64, (10000, 0.1, 1.0)] 574 µs 652.6 µs -12.05%
... ... ... ... ... ...

ℹ️ 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 ct/row-fn-tensor-products-v2 (b37f665) with ct/row-fn-tensor-l2-v2 (5974184)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 (929ae6d) during the generation of this report, so da9d39c 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
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/row-fn-tensor-products-v2 branch from 4f0fa1a to b37f665 Compare September 8, 2026 21:55
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