Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pytorch/extension-cpp
C++ extensions in PyTorch
https://github.com/pytorch/extension-cpp
Last synced: 7 days ago
JSON representation
C++ extensions in PyTorch
- Host: GitHub
- URL: https://github.com/pytorch/extension-cpp
- Owner: pytorch
- Created: 2018-03-03T10:46:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-07T02:24:53.000Z (5 months ago)
- Last Synced: 2024-12-19T21:07:00.276Z (14 days ago)
- Language: Python
- Size: 43 KB
- Stars: 1,033
- Watchers: 35
- Forks: 216
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-pytorch-list-CNVersion - extension-cpp
- Awesome-pytorch-list - extension-cpp
README
# C++/CUDA Extensions in PyTorch
An example of writing a C++/CUDA extension for PyTorch. See
[here](https://pytorch.org/tutorials/advanced/cpp_custom_ops.html) for the accompanying tutorial.
This repo demonstrates how to write an example `extension_cpp.ops.mymuladd`
custom op that has both custom CPU and CUDA kernels.The examples in this repo work with PyTorch 2.4+.
To build:
```
pip install .
```To test:
```
python test/test_extension.py
```To benchmark Python vs. C++ vs. CUDA:
```
python test/benchmark.py
```## Authors
[Peter Goldsborough](https://github.com/goldsborough), [Richard Zou](https://github.com/zou3519)