Inside the Fast NAM Engine
Soundshed Guitar 1.7.0 added the Fast NAM Engine, and it's on by default. It runs Neural Amp Modeler captures roughly 2.5 to 3.5 times faster than our previous versions, using the models you already have.
What stays the same
Fast NAM runs the same network in full 32-bit floating point, with no quantisation or pruning. Its output matches the reference NAM engine within ordinary floating-point rounding: the two agree to between 108 and 140 dB. All of the speed comes from arranging the arithmetic differently for the CPU.
Where the time was going
NAM models are tiny neural networks, with only 4, 8 or 16 channels per layer. The reference engine runs every layer through a general-purpose matrix library, which reorganises its inputs before each multiplication. That pays off for big matrices, but at NAM's sizes the reorganising costs more than the multiplying. When we profiled it, the CPU was doing only a fraction of the maths it's capable of, and the narrow 4- and 8-channel layers were the worst. Faster instructions wouldn't have done much about overhead like that, so we changed the data layout instead.
How Fast NAM works
Each SIMD register holds 8 consecutive audio samples from one channel, so the registers are full however few channels a layer has. The reference engine packs channels into registers, which leaves most of each register empty on the narrow layers.
The dilated convolutions, the 1×1 mixes and the output head all run through one small register-tiled matrix routine. When a model loads, its weights are packed into the order that routine reads, so each layer's dilated convolution becomes a single multiply with nothing reorganised per block. The activation, the input mix and the output sum happen in the same pass.
Each layer keeps its past samples in a power-of-two ring buffer whose first few slots are mirrored past the end. Every read is then one contiguous slice whatever the dilation, and the inner loop never has to check for wrap-around. Large host buffers are processed 128 samples at a time, so the working data stays in the CPU's L1 cache.
Loading got faster too. A WaveNet has no feedback loop, so after silence each layer settles to a constant state. Fast NAM calculates that state directly instead of running silence through the model, which cut the time to load a model and get it ready from about 15 to 24 ms to about 0.4 ms. Every instance, both stereo channels and the oversampling copies share one read-only set of packed weights, and each copy keeps only its own small buffers.
Results
At 48 kHz with 64-sample buffers, per mono block, compared with Soundshed Guitar 1.6.0:
| Model | 1.6.0 | Fast NAM |
|---|---|---|
| Standard WaveNet | 56 µs | 21 µs |
| A2 | 52 µs | 18 µs |
A standard capture now uses under 2% of the time available for each audio block. Smaller architectures gain more: "nano" and "feather" models run 3.5 to 4.6 times faster.
Fast NAM runs every WaveNet in our 2,460-model test library, including both sizes inside A2 models. Other architectures, such as LSTM and ConvNet, fall back to the reference engine automatically.
There are separate kernels for x86 (AVX2 with FMA, plus an SSE fallback) and ARM (NEON). On ARM it measured 1.7 to 2.4 times faster on Apple Silicon and Linux, and 5 to 6.6 times faster on Windows on ARM. We haven't timed Android yet.
The output is bit-identical whatever buffer size your DAW uses. The reference engine's output varies slightly with buffer size.
With Use Multiple CPU Cores on, stereo NAM processes the second channel on a helper thread. We keep that thread off the audio thread's own core, including its hyperthread twin, so stereo costs about 1.4 times mono instead of twice.
Your own savings will depend on your platform, settings and signal chain.
Try it
To compare Fast NAM with the reference engine by ear, switch it off in Settings > DSP Performance > Fast NAM Engine.
Get the latest version from the Downloads page.
Feedback
If a capture sounds different or misbehaves with Fast NAM on, send the model, your platform and selected build, DAW, and audio interface to [email protected].