~/talk

How To Write C++ Extensions in 2026

Talkat PyTorch Conference Europe 2026 · 2026-04-07..04-08· [python, machine-learning]
name:Jane Xu
links:none on file
links:none on file
slides:none on file

Shows how to build a real C++ custom op (a fused multiply‑add with a CUDA kernel) that compiles against the stable ABI so one binary replaces an M×N wheel matrix and runs on torch ≥2.10 and multiple CPython builds. Uses torch::stable::Tensor and the C shim wrappers, registers via the stable torch library + torch box, and enforces CPython compatibility with py_limited_api and TORCH_TARGET_VERSION. Example repo and real users (FA3, xformers, torchao, torchaudio) exist.

AI-written summary · about

  1. 0:00C++ extensions in PyTorch
  2. 1:47Why write C++ extensions
  3. 7:30Stable ABI benefits
  4. 12:45CUDA kernel with stable APIs
  5. 16:13Registering and compiling
  6. 21:05Calling from Python
  7. 22:48Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.