Repository navigation
Conversation
maleadt
force-pushed
the
fma-contraction
branch
from
December 2, 2026 08:44
694ab68 to
afd4dc3
Compare
Member
|
Thanks. Rebased, and I removed the preference; GPUCompiler.jl is not user-facing, so the back-end should drive this. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1134 +/- ##
==========================================
- Coverage 92.99% 87.31% -5.68%
==========================================
Files 32 32
Lines 8574 8525 -49
==========================================
- Hits 7973 7444 -529
- Misses 601 1081 +480 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PTX code generation always let the back-end contract multiply-add pairs, as nvcc does, so kernels could not reproduce CPU results bit for bit. The new `fma_contraction` field (default true) controls this for both the NVPTX and NVVM back-ends. It is part of the target's hash and therefore of the cache owner, so kernels compiled with and without contraction don't share results.
maleadt
force-pushed
the
fma-contraction
branch
from
December 2, 2026 19:54
afd4dc3 to
6e400b3
Compare
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.
Closes #1133.
PTX code generation always let the back-end contract multiply-add pairs, as nvcc does, so kernels could not reproduce CPU results bit for bit. The only workaround was redefining
mcgen, which the compiler cache cannot see.PTXCompilerTargetgetsfma_contraction::Bool = true. Withfalse, the NVPTX back-end is called withfma_contraction=falseand libNVVM with-fma=0. Plain multiplies and adds are then emitted with.rn, so ptxas cannot fuse them either, while operations the IR marks contractable (muladd,@fastmath) are still fused, as on the CPU. The field is part of the target's hash and of the cache owner, so kernels compiled with and without contraction don't share cached results.How to expose the option is up to the back-end packages. With CUDA.jl,
@cuda fma_contraction=falsealready works, because extra keywords are forwarded to the target.Tests in
test/ptx.jlcover both back-ends: the PTX with contraction off usesmul.rn/sub.rnand nofma, an explicitmuladdstill givesfma.rn, and the target hash and cache owner differ from the default.