Skip to content

CuMetal v0.8.0

Choose a tag to compare

@Lulzx Lulzx released this 08 Nov 14:27
· 59 commits to main since this release

CuMetal v0.8.0

Release index

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. Double hypot under wide48 calls 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. ieee64 value-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 new fp64_division_domain probe
    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_math used to reach
    VF64 through Metal's module-wide fast math, so fast48/wide48 sqrt
    and wide48 hypot returned different bits with the flag, natively and
    on the PTX JIT. VF64 support is now always compiled IEEE-safe without
    contraction, and functional_fp64_math_flag_invariance requires
    identical FP64 bits across default, --use_fast_math and -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 -fmad contraction and
    fast-math flags it asked for. cumetalc --emit=metallib now honours
    both flags at all.
  • Native multi-unit builds. Kernels in more than one .cu file link
    into one executable through nvcc -c and a final link; each object used
    to export the same embedded-metallib symbols. static and
    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, so while (t < target) t += target - t; terminates (#202),
    and wide48 addition 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 4 run.
  • Debug with the binary shim OFF: 464 of 464 passed in a -j 4 run.
  • 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.sh passes fast48, wide48 and
    ieee64 against the feeb6ae pin.
  • 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
    error 4.49e-6, cross-mode difference 3.25e-7, within the 5e-4 gate.
  • 465 of 465 CTest gates pass with zero skips, including PhysX, the 83
    enrolled cuda-samples (at their b7c5481 baseline) 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

  • wide48 hypot has the reduced codec's rounding, special-value and
    top-of-range limits and no exception flags; other wide48
    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 use fast:: 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), made wide48 comparisons decode
    their significands (#202), and contributed the wide48 hypot, 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).