Skip to content

Conversation

sandrohanea
Copy link
Contributor

Hello @ggerganov, @taronaeo,

While upgrading from whisper.cpp v1.8.0 → v1.8.1, I noticed that the non-SIMD (scalar) code path started producing incorrect results in whisper.net CI.
The last successful run was just before commit d83fef35, which introduced the new ggml_vec_cvar_f32 optimization (llama.cpp PR #15953).

After this change, the scalar branch wrote the squared residuals into y[i] instead of the centered values.
This caused normalization in ggml_compute_forward_norm_f32 to divide (x − mean)² by √(var + eps) instead of (x − mean), producing invalid activations (resulting in -inf logits and !!!!!! transcriptions).

The SIMD branches (AVX/SSE/NEON/VXE) were unaffected because they correctly stored the centered values before squaring for the sum.

This PR restores the correct behavior for the scalar path:

for (; i < n; ++i) {
    float d = x[i] - mean;
    y[i] = d;
    sum += (ggml_float)(d * d);
}

Verified in this pipeline run — whisper.net now produces expected transcriptions again.

@ggerganov
Copy link
Member

Yes, sorry about that. This was fixed recently in llama.cpp: ggml-org/llama.cpp#16558

Will sync it later tonight/tomorrow.

@sandrohanea
Copy link
Contributor Author

Missed that fix, thank you!

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.

2 participants