# godweiyang/NN-CUDA-Example

Several simple examples for popular neural network toolkits calling custom CUDA operators.

Repository: https://github.com/godweiyang/NN-CUDA-Example
Canonical: https://ross.abutalabs.com/products/nn-cuda-example
Language: Python
License: Apache-2.0
License Family: permissive
Topics: pytorch, tensorflow, cuda, cpp, python, neural-network
Last push: 2021-04-29T10:10:08+00:00

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

## Adoption (not part of the score)
Stars 1538, forks 206 (observed 2026-08-28T04:05:00.249489+00:00)

## What it is
A collection of simple example projects showing how to write custom CUDA operators and call them from PyTorch and TensorFlow. It demonstrates three compilation approaches (JIT, setuptools, CMake) along with kernel timing and model training code.

## Use cases
- learn how to write a custom CUDA kernel for PyTorch
- compile and call custom CUDA operators from TensorFlow
- compare performance of custom CUDA kernels against built-in torch ops
- set up CMake builds for CUDA extensions
- benchmark CUDA kernel execution time
- implement custom backward propagation in PyTorch

## When to choose
- you are learning to integrate custom CUDA kernels with PyTorch or TensorFlow
- you want minimal, readable reference code for CUDA extension compilation
- you need examples of kernel timing and training with custom ops

## When to avoid
- you need production-ready, maintained CUDA extension tooling
- you use CUDA versions or frameworks other than the pinned environment (CUDA 11.0, PyTorch 1.7, TF 2.4)
- you want a library or API rather than example code

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: machine-learning, gpu-computing, developer-tools, benchmarking
- domain: deep-learning, gpu-computing, tutorials, developer-tools
- platform: python, cpp
- tags: cuda-kernels, pytorch, tensorflow, custom-operators, example-code, jit-compilation, cmake, setuptools, linux, gpu

## Member repositories
- godweiyang/NN-CUDA-Example (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:00.249489+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-30T04:30:57.543445+00:00, confidence not recorded.
  - readme: https://github.com/godweiyang/NN-CUDA-Example (fetched 2026-08-28T04:05:00.249489+00:00, sha c2f18caeeb5d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
