GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pytorch/extension-cpp: C++ extensions in PyTorch

BranchesTags
Open more actions menu

Latest commit

 

History

53 Commits
53 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
extension_cpp
extension_cpp
 
 
extension_cpp_stable
extension_cpp_stable
 
 
test
test
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

C++/CUDA Extensions in PyTorch

This repository contains two example C++/CUDA extensions for PyTorch:

  1. extension_cpp - Uses the standard ATen/LibTorch API
  2. extension_cpp_stable - Uses the LibTorch Stable ABI

Both extensions demonstrate how to write an example mymuladd custom op that has both custom CPU and CUDA kernels.

extension_cpp (Standard ATen API)

Uses the full ATen/LibTorch API. This is the traditional way of writing PyTorch extensions. See this tutorial for more details.

extension_cpp_stable (Stable ABI)

Uses the LibTorch Stable ABI to ensure that the extension built can be run with any version of PyTorch >= 2.10.0, without needing to recompile for each PyTorch version.

The extension_cpp_stable examples require PyTorch 2.10+.

Building

To build extension_cpp (standard API):

cd extension_cpp
pip install --no-build-isolation -e .

To build extension_cpp_stable (stable ABI):

cd extension_cpp_stable
pip install --no-build-isolation -e .

Testing

To test both extensions:

python test/test_extension.py

Authors

Peter Goldsborough, Richard Zou

About

C++ extensions in PyTorch

Resources

Readme
Activity
Custom properties

Stars

1.2k stars

Watchers

34 watching

Forks

248 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.