Repository navigation
Replace inner_product with generic dot - #87
Open
danieltowner wants to merge 1 commit into
Open
danieltowner wants to merge 1 commit into
danieltowner wants to merge 1 commit into
Conversation
danieltowner
force-pushed
the
dot-generic-stack
branch
from
December 1, 2026 11:24
09aeeed to
dbc3639
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
The statement that “FP16 inputs are accumulated in FP16” fordot(lhs, rhs)is likely incorrect:… · New Thedot(lhs, rhs)overload doesn’t constrain_Lhs::size() == _Rhs::size()even though the 3-arg… · New This test relies on implementation-defined conversions when casting potentially out-of-range… · New These performance scenario translation units use fixed-width integer types (std::int32_t,… · New
What changed in this PR
This PR replaces the FP16-only inner_product API with a generic dot(lhs, rhs, init) / dot(lhs, rhs) API, preserving FP32 accumulation for FP16+FP32-init while expanding dot support (and coverage) to integer combinations and adding performance scenarios/baselines.
Changes:
- Introduces a generic
dotimplementation (including integer wrapping semantics and scalar fallback) and updates the public API/docs accordingly. - Updates the x86 AVX10.2 FP16 specialized path from
inner_producttodot. - Adds/updates unit tests, performance scenarios, baseline expectations, and changelog entry for the new
dotAPI.
| File | Description |
|---|---|
| test/performance/scenarios/dot_u8_u8_i32.cpp | Adds a perf scenario entry point for u8·u8 → i32 dot with init. |
| test/performance/scenarios/dot_u8_i8_i32.cpp | Adds a perf scenario entry point for u8·i8 → i32 dot with init. |
| test/performance/scenarios/dot_u16_i16_i32.cpp | Adds a perf scenario entry point for u16·i16 → i32 dot with init. |
| test/performance/scenarios/dot_i8_i32.cpp | Adds a perf scenario entry point for i8·i8 → i32 dot with init. |
| test/performance/scenarios/dot_i16_i32.cpp | Adds a perf scenario entry point for i16·i16 → i32 dot with init. |
| test/performance/scenarios/dot_f16.cpp | Renames the perf scenario from inner_product to dot for FP16. |
| test/performance/baselines.json | Adds baselines for new dot scenarios and removes inner_product_f16 baseline. |
| test/TestSimdInnerProduct.cpp | Renames/extends tests to validate dot for FP16 and integer cases, plus overload resolution and constexpr. |
| include/xvec/x86/x86_impl.hpp | Renames AVX10.2 FP16 path to dot and constrains it to float init to avoid ambiguity. |
| include/xvec/generic/generic_impl.hpp | Adds generic dot implementation with wrapping integer accumulation, vectorizable and scalar fallback paths. |
| include/xvec/detail/std_numeric.hpp | Replaces the public inner_product API/docs with dot overloads (with/without init). |
| CHANGELOG.md | Documents the new dot API and behavior. |
Review effort: Lite
Copilot stopped reviewing on behalf of
danieltowner due to an error
December 1, 2026 11:57
danieltowner
force-pushed
the
dot-generic-stack
branch
from
December 3, 2026 09:25
dbc3639 to
1c0e3e4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Replace the FP16-only
inner_productAPI withdot(lhs, rhs, init)anddot(lhs, rhs). Preserve FP32 accumulation for FP16 inputs and add generic integer dot products, tests, and performance scenarios.