# pytorch/extension-cpp

C++ extensions in PyTorch

Repository: https://github.com/pytorch/extension-cpp
Canonical: https://ross.abutalabs.com/products/extension-cpp
Language: Python
License Family: other
Last push: 2026-01-13T16:13:29+00:00

## Health v2 (maintenance only)
Score: 60/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 62, release rhythm 35, longevity 100
- inputs: {"age_days": 3105, "days_push": 232, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1203, forks 247 (observed 2026-08-28T04:03:58.704126+00:00)

## What it is
An official PyTorch example repository demonstrating how to write C++/CUDA extensions with custom ops. It includes two variants: one using the standard ATen/LibTorch API and one using the LibTorch Stable ABI.

## Use cases
- write custom C++ CUDA kernels for pytorch
- create a custom op in pytorch with cpu and cuda support
- learn how to build pytorch cpp extensions
- build a pytorch extension that works across pytorch versions
- speed up a slow python op with a c++ kernel

## When to choose
- you need a reference example for writing pytorch C++/CUDA custom ops
- you want to learn the standard ATen extension API or the new stable ABI
- you need a starting template for a pytorch extension project

## When to avoid
- you need a production library rather than example code
- you want prebuilt extensions without writing C++ yourself
- you need extensions for pytorch versions older than 2.10 with the stable ABI variant

## Facets
- artifact type: learning-resource
- maturity: active
- function: machine-learning, gpu-computing, developer-tools
- domain: deep-learning, developer-tools, gpu-computing
- platform: python, cpp, cross-platform
- tags: pytorch, cpp-extension, cuda, custom-ops, example-code, stable-abi, libtorch, gpu

## Member repositories
- pytorch/extension-cpp (main) score 60

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:58.704126+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:20:31.871436+00:00, confidence not recorded.
  - readme: https://github.com/pytorch/extension-cpp (fetched 2026-08-28T04:03:58.704126+00:00, sha 3e892100c36d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
