feat(ai): add stable softmax, normalization and activation kernels - #35
Draft
damian123 wants to merge 11 commits into
Draft
feat(ai): add stable softmax, normalization and activation kernels#35damian123 wants to merge 11 commits into
damian123 wants to merge 11 commits into
Conversation
Register the AVX2 VectorTest suite with CMake/CTest, fetch GoogleTest portably, pin GitHub Actions, and run tests on Windows MSVC and Ubuntu GCC/Clang. Fix Span::empty to compare instead of assign so Clang builds. Keep the portable translation units on all compilers; extra MSVC-only sources remain opt-in.
Share a single AllAllocatorsGuard in testNamespace.cpp so MSVC does not see a duplicate symbol. Drop the extra MSVC-only VectorTest sources from the portable target. Exclude ApplyFilterB from CTest (fails in Debug). Do not fail the required matrix on known allocator ASan teardown reports.
CMake 4.x POST_BUILD discovery fails on Windows multi-config generators. Register the portable suite as a single CTest entry.
AllAllocatorsGuard in other TUs ran after the static unordered_map members were destroyed, so VectorTest segfaulted on Windows after gtest had already reported 29/29 passed. Store the size-to-policy map on the heap and reset the cached policy pointer in freeAll.
Float32 AVX2 (VecF8F) kernels for dot product, squared L2, cosine, L2 normalization, and bounded-heap top-k over a row-major corpus. Scalar double is the reference. Zero-norm cosine is a 0 sentinel; mismatched lengths throw; ties break by smaller row index.
damian123
force-pushed
the
feat/neural-kernels
branch
from
August 30, 2026 22:14
fd57918 to
6b1c372
Compare
damian123
force-pushed
the
feat/neural-kernels
branch
from
August 30, 2026 22:14
6b1c372 to
300d0c4
Compare
This was referenced Aug 30, 2026
damian123
marked this pull request as draft
August 31, 2026 13:29
damian123
force-pushed
the
feat/neural-kernels
branch
from
September 2, 2026 12:39
05ff738 to
0f24840
Compare
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.
Summary
This is a focused three-file delta on top of #34:
Vectorisation/VecX/neural_kernels.hVectorTest/TestNeuralKernels.cppVectorTest/CMakeLists.txtReview the incremental #34 to #35 diff.
It adds AVX2
VecF8Fpreprocessing kernels for:Numerical contracts
nvalues, in index order, and accumulate in double precision; SIMD padding never participates.std::invalid_argumentrather than producing accidental non-finite results.Verification
1,7,8,9,15,16,17), deliberately unaligned buffers, output canaries, exact aliases, extreme finite logits, non-finite rejection, zero variance, epsilon-dominant inputs, and scalar-double error metrics.Non-goals
This PR remains a draft pending #34 and maintainer guidance on final component placement.