Repository navigation
Conversation
This was referenced Oct 10, 2026
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.
CUDA may round F32 inputs through TF32 or quantize/round activations in other matmul paths, even when a model requests F32 accumulation. Phonon-2's duration decisions exposed this: text could match while word boundaries shifted by 80–240 ms.
This adds
ggml_backend_cuda_set_f32_matmul(backend, true), an opt-in policy owned by one CUDA backend context. It disables TF32 on that context's existing/future cuBLAS handles and selects existing F32 computation instead of paths that round or quantize activations. Configure it before graph preparation; policy changes after CUDA graph capture are rejected. Other instances retain their previous math mode and dispatch.No CUDA kernel implementation is replaced. HIP/MUSA retain their existing math-mode branch and reject this NVIDIA-specific control. Those platforms were not built/tested locally. This support is separate from the Phonon model PR, as CONTRIBUTING.md requires for GGML/backend changes.
Validation on Windows, MSVC 14.43, CUDA 12.4, RTX 3090:
cuda_matmul_precision_testpasses with F32, BF16 and Q8 weights at 8/64-column shapes; strict results match a double-accumulation reference within relative L21e-5(measured approximately7e-8–1.2e-7).Reproduce the GPU probe (the model is not needed):
Local evidence:
outputs/phonon2-pr-20261010/, including the integration matrix and combined-build CTest log. The separate Phonon model PR is #863; it contains the converter, real-weight/reference checks, timestamps, package documentation and measured memory use. Merge this support before enabling that model's strict CUDA path. Its committed validation report and portable JSON evidence record the downstream integration results.