Conversation
dfernandes83
added a commit
to dfernandes83/NeuralAmpModelerCore
that referenced
this pull request
Sep 15, 2026
dfernandes83
added a commit
to dfernandes83/NeuralAmpModelerCore
that referenced
this pull request
Sep 18, 2026
sdatkinson#313) Merges upstream PR sdatkinson#313 on top of our sdatkinson#330 panel-caching commit: a2_fast's create() now tries the planar kernel first (NAM_A2_PLANAR, gated to __aarch64__ or __arm__+NEON+FMA at compile time) and falls back to the existing Eigen-panel-cached reference model everywhere else, including Windows/x86 where a2_planar.cpp compiles to an empty translation unit. Claimed bit-identical to a2_fast (2.0-2.47x on Apple M2, 1.4-2.9x on Cortex-A17/A76), contingent on the compiler contracting a*b+c into an FMA in the scalar reference -- true under GCC/Clang, not under MSVC/fp:precise, and on ARMv7 additionally contingent on FPSCR.FZ being set by the host. Not yet verified on our own hardware; C.2 of the tone3000 NAM evolution plan needs this run through nam-inference-cpu-benchmark on real Apple Silicon before/after before it's trusted.
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.
This reduces the CPU cost of A2-Full at small host buffer sizes by caching Eigen's packed 8x8 weight panels and reusing them for 32- and 64-sample blocks.
The changing input side is still packed per callback, and the calculation uses Eigen's existing
gebpkernel so the accumulation order stays the same. Other block sizes continue through the existing Eigen path. A2-Lite is unchanged, and builds using external BLAS keep the original dispatch.On an Apple M1 Release build, three runs against the current
mainbaseline measured:Validation against an untouched checkout of the current
main:The packed weights add roughly 45 KiB per A2-Full instance and are prepared when the model weights are loaded; there are no extra process-time heap allocations or audio buffers.
I also keep a version of the same optimization adapted to the older Core revision used by the current NAM plugin (
9c7b185) here:https://github.com/honkkis/NeuralAmpModelerCore/tree/perf/a2-small-block-prepack-9c7b185
That branch is only for testing/integration against the older plugin-pinned Core. This PR targets current
main.