PyTorch 2.14 is finally here but is NVGEMM actually faster?

DevNomad Novice 2d ago 553 views 13 likes 2 min read

The latest PyTorch 2.14 drop is mostly about squeezing more performance out of the hardware and making distributed training less of a nightmare. The headline act is NVGEMM, which brings CuTeDSL-generated CUTLASS kernels into Inductor. On paper, this means better epilogue fusion and support for NVFP4 GEMM. I'm skeptical about how much "autotuning" actually helps in real-world workloads versus just adding overhead, but if you're pushing low-precision math, this is where the gains are.

Distributed and Fault Tolerance

The move to the nccl2 backend (ported from torchcomms) is a big deal for anyone running massive clusters. They've implemented the full collective contract with nonblocking communicators. More importantly, fault tolerance is now a "first-class c10d concept." The addition of a Flight Recorder that works across any backend—not just NCCL—should make debugging those random node failures in a 100-GPU cluster slightly less painful.

Apple Silicon and Local Dev

If you're developing on a Mac, the native linear algebra support is a welcome change. We finally get Jacobi-kernel SVD, eigh, QR, and Cholesky. It's about time MPSGraph moved more kernels to Metal. It doesn't turn a MacBook into an H100, but it makes local prototyping of complex linear algebra much more viable.

New Logic and Shape Handling

There are a few API changes that actually impact the AI workflow:

  • torch.switch: This generalizes torch.cond for multi-way branching.
  • torch.while_loop: This can now be captured in a CUDA graph, which is a huge win for efficiency in iterative algorithms.
  • Declarative Dynamic Shapes: They've introduced @dynamic_spec. This is supposed to be shared across torch.compile, torch.export, and make_fx.

For those experimenting with complex-valued tensors, there is now experimental torch.compile support. It works by decomposing complex operations into real and imaginary parts so the compiler can actually optimize them.

Hardware and Compatibility

The compatibility list has expanded again. ROCm 7.14 wheels are now available via the TheRock pip SDK, and Inductor now targets Rubin (sm_107). Intel XPU also added native graph capture.

If you're planning to upgrade, I'd suggest testing your CUDA graphs first. With torch.while_loop now being capturable, you might find some old bottlenecks disappearing, but always verify the precision when moving to NVFP4.

For a basic deployment check, you can verify your version and backend status with a quick script:

import torch

# Check version to ensure 2.14 is active
print(f"PyTorch Version: {torch.__version__}")

# Test for MPS linear algebra support on Mac
if torch.backends.mps.is_available():
    # Example: Testing if a Cholesky decomposition runs on MPS
    try:
        a = torch.randn(3, 3, device="mps")
        # Construct a positive-definite matrix
        pd_matrix = torch.matmul(a, a.T)
        l = torch.linalg.cholesky(pd_matrix)
        print("MPS Cholesky successful")
    except Exception as e:
        print(f"MPS Error: {e}")

This release is the result of 2,995 commits from nearly 500 contributors. While the "production-ready" claim is loud, the real test will be how nccl2 handles eager communicator splitting in the wild.

AI ProgrammingAI Coding
Step-by-step guides and pitfalls for this path are in an AI side-hustle playbook, with plenty of directly applicable cases.

All Replies (3)

M
Max75 Advanced 2d ago
Worth mentioning that you might need to update your drivers first for the gains to kick in.
0 Reply
S
Sam46 Advanced 2d ago
still waiting for it to actually fix my CUDA versioning nightmares, but the speed is okay.
0 Reply
J
Jamie67 Novice 2d ago
Does anyone know if NVGEMM actually scales better with smaller batch sizes or just big ones?
0 Reply

Write a Reply

Markdown supported