Repository navigation
CuMetal v0.8.0
CuMetal v0.8.0
CuMetal 0.8.0 strengthens software FP64 and native builds. wide48 gains a
full-range double hypot, and exact ieee64 division is about 1.4x faster
while staying bit-identical to host division. VF64's arithmetic no longer
changes with the user's float math flags. Native executables can link
kernels from several .cu files, including static and
anonymous-namespace kernels. A test race behind most intermittent failures
under ctest -j is fixed.
Highlights
- wide48
hypot. Doublehypotunderwide48calls VF64's scaled
reduced-precision helper on the typed PTX and NVVM paths instead of
evaluating in binary32, so it keeps the full exponent range. It passes 49
analytic and MPFR vectors at max(2^-44 relative, one ulp); this is a
corpus gate, not correct rounding (#203). - Faster exact division.
ieee64value-only round-to-nearest division
uses VF64's certified table reciprocal for normal operands and falls back
to the restoring divider for everything else. On Apple M4 Pro the division
benchmark runs 1.41x faster for dependent chains and 1.47x for independent
chains (median of 21 timed runs). The newfp64_division_domainprobe
checks 676,650 operand pairs bit for bit against host binary64, for/
and__drcp_rn, over every exponent, overflow and subnormal results,
reciprocal-table edges, near-halfway quotients and special values. Two
injected leaf bugs each made it fail with tens of thousands of misrounded
results (#201, #203). - FP64 independent of user float flags.
--use_fast_mathused to reach
VF64 through Metal's module-wide fast math, sofast48/wide48sqrt
andwide48hypotreturned different bits with the flag, natively and
on the PTX JIT. VF64 support is now always compiled IEEE-safe without
contraction, andfunctional_fp64_math_flag_invariancerequires
identical FP64 bits across default,--use_fast_mathand-fmad=false
in all three modes. VF64's own pragmas no longer leak into user code, so
user float code in an FP64 kernel gets the-fmadcontraction and
fast-math flags it asked for.cumetalc --emit=metallibnow honours
both flags at all. - Native multi-unit builds. Kernels in more than one
.cufile link
into one executable throughnvcc -cand a final link; each object used
to export the same embedded-metallib symbols.staticand
anonymous-namespace kernels build and launch natively, including
same-named ones in different units, and the AMReX idiom fixture is back in
an anonymous namespace. - wide48 comparisons and signed zeros. Comparisons decode both reduced
significands, sowhile (t < target) t += target - t;terminates (#202),
andwide48addition and subtraction return correctly signed zeros. - Parallel tests. About twenty tests deleted and regenerated a shared
reference metallib in the source tree while others loaded it. Each now
builds a private copy: the affected tests failed 5 of 120 parallel runs
before and 0 of 360 after.
Verification
On Apple M4 Pro, macOS 26, at a57070c:
- Debug with the binary shim ON: 467 of 467 passed in a
-j 4run. - Debug with the binary shim OFF: 464 of 464 passed in a
-j 4run. - Skips in both runs need external checkouts not present on the build
machine (PhysX, the cuda-samples sweep and its vectorAdd sample, and the
multi-Clang backend matrix). - Phase 4: 192 of 192 in both configurations with zero skips.
- VF64 upstream
check-cumetal-integration.shpassesfast48,wide48and
ieee64against thefeeb6aepin. - The AMReX fixture change passed its functional test, the backend matrix,
and its typed-PTX and native-AOT corpus entries.
These totals are evidence for the enrolled test surfaces, not a
percentage of the complete CUDA ecosystem.
Post-release verification
On 2026-11-08, after tagging, the LAMMPS release gate was rerun on v0.8.0
(Release, binary shim off):
- LAMMPS
stable_30Sep2026/ Kokkos 5.2.1 completes the stock 32,000-atom,
100-step benchmark in both neighbour modes: maximum scaled CPU-double
error4.49e-6, cross-mode difference3.25e-7, within the5e-4gate. - 465 of 465 CTest gates pass with zero skips, including PhysX, the 83
enrolled cuda-samples (at theirb7c5481baseline) and the Clang
21/22/23 matrix.
That run found that the PhysX conformance gates had failed since 0.7.0
made cumetal-ir the default: the typed path refuses three PhysX kernels
and exceeds Metal's 32 KB threadgroup limit on three more. PhysX patch
0032 keeps those six on the legacy lowering, and the tests that read the
shared reference metallib now wait for it in a fresh checkout. These are
test-infrastructure and patch-series changes on main after the tag; the
v0.8.0 compiler and runtime are unchanged.
Important limits
wide48hypothas the reduced codec's rounding, special-value and
top-of-range limits and no exception flags; otherwide48
transcendentals still evaluate in binary32.- Under
--use_fast_math, a typed-backend kernel that uses software FP64 is
compiled as one safe-mode Metal module: its float code gets fast-math
operation flags but does not flush FP32 denormals or usefast::builtin
overloads. - Relocatable device code (
-rdc) remains unsupported.
Contributors
Thank you to the people who found, fixed and validated the work in this
release:
- Christopher Albert (@krystophny)
benchmarked exact FP64 division (#201), madewide48comparisons decode
their significands (#202), and contributed thewide48hypot, zero-sign
and certified table division work to VF64-metal and its CuMetal
integration (#203). - Harrison O'Connor-Hoover
(@harrisonoconnorhover)
reported and reproduced the native-AOT internal-linkage kernel failure
(#180).