Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The SIMD implementations preserve the scalar operation, handle tails correctly, and retain existing architecture fallbacks.
Review effort: Balanced
Findings: None
What changed in this PR
Vectorizes attention value accumulation while preserving scalar fallback and existing model behavior.
Changes:
- Adds AVX2/FMA and NEON AXPY paths with scalar tails.
- Uses the helper during attention value accumulation.
| File | Description |
|---|---|
Core_CPP/niyah_core.c |
Adds SIMD value accumulation and integrates it into inference. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch was successfully 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.
Vectorizes the remaining scalar attention V-accumulation loop using the existing AVX2+FMA and NEON paths, with scalar tails/fallback preserved.
Scope deliberately stays narrow:
kvh = (h * n_kv_heads) / n_headspreserved)Observed before change: attention score already routes through SIMD
dot_f32, so it was not rewritten.Verification performed locally from current
origin/main(4504604):bash scripts/build.sh --arch generic --smokePASSbash scripts/build.sh --arch x86_64 --smoke --benchPASS, self-check reports AVX2+FMAbash scripts/build.sh --debug --arch generic --smokePASS with ASan+UBSan buildgit diff --checkPASSAd-hoc long-context attention benchmark on the same machine/config (embed=256, heads=8, kv_heads=2, head_dim=32, ctx=512, one layer) improved median throughput from ~9,971 tok/s to ~15,328 tok/s (~1.54x). This benchmark was temporary and not added to the repository.
AArch64 cross-syntax verification could not be completed because the available clang lacks an AArch64 libc/sysroot; the NEON implementation uses the same existing
vfmaq_f32/load/store intrinsics already used elsewhere in this file.