Skip to content

Revert A2 fast optimizations#295

Merged
sdatkinson merged 2 commits into
mainfrom
revert-277
Jun 20, 2026
Merged

Revert A2 fast optimizations#295
sdatkinson merged 2 commits into
mainfrom
revert-277

Conversation

@sdatkinson

Copy link
Copy Markdown
Owner

Summary

This PR reverts the NAM/wavenet/a2_fast.cpp changes from #277 and adds example_models/A2.nam as an example A2 model.

Context

Follow-up testing in #290 showed that the #277 A2 fast-path optimizations are highly compiler/target dependent. Some compiler contexts see speedups, while others regress significantly.

On Apple M1 + AppleClang 16, benchmarking example_models/A2.nam against the parent of #277 showed:

  • slim=1.0 / 8ch: ~29% slower by mean, ~30% slower by median
  • slim=0.0 / 3ch: ~2% faster by mean, ~3% faster by median

Given the 8-channel regression, this restores the prior a2_fast.cpp implementation while we decide whether to reintroduce these paths behind compiler/configuration flags.

Changes

Validation

Built benchmodel successfully with:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target benchmodel

diff

% git diff 9c7b185 -- NAM/wavenet/a2_fast.cpp 
diff --git a/NAM/wavenet/a2_fast.cpp b/NAM/wavenet/a2_fast.cpp
index 8fd8fc1..67093c8 100644
--- a/NAM/wavenet/a2_fast.cpp
+++ b/NAM/wavenet/a2_fast.cpp
@@ -66,10 +66,10 @@ public:
   ~A2FastModel() override = default;
 
   void process(NAM_SAMPLE** input, NAM_SAMPLE** output, int num_frames) override;
+  int GetPrewarmSamples() override { return _prewarm_samples; }
 
 protected:
   void SetMaxBufferSize(int maxBufferSize) override;
-  int PrewarmSamples() override { return _prewarm_samples; }
 
 private:
   struct Layer

@sdatkinson sdatkinson merged commit b5a68c3 into main Jun 20, 2026
4 checks passed
@sdatkinson sdatkinson deleted the revert-277 branch June 20, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant