Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/new-kernel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Propose a kernel
description: A new CUDA or Triton kernel, or a NumPy reference for an existing one
title: "Add "
body:
- type: markdown
attributes:
value: |
A new kernel comes with a NumPy reference that checks the same algorithm on the CPU, so CI can test it. CONTRIBUTING.md has the steps.
- type: textarea
id: algorithm
attributes:
label: Kernel and algorithm
description: What the kernel computes, and how the work is split across threads and blocks (tiles, loop order or reduction tree).
validations:
required: true
- type: textarea
id: reference
attributes:
label: Reference check
description: The plain NumPy expression the reference compares against, and the tolerance you expect.
validations:
required: true
- type: dropdown
id: kind
attributes:
label: Kind
options:
- CUDA kernel (cuda/)
- Triton kernel (triton/)
- NumPy reference only (reference/)
validations:
required: true
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/wrong-result.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Report a wrong result
description: A kernel or reference fails, does not build, or prints a number that does not match the README
body:
- type: input
id: file
attributes:
label: File
placeholder: cuda/08-softmax.cu
validations:
required: true
- type: textarea
id: output
attributes:
label: Command and output
description: The command you ran (nvcc, the binary, or python3) and everything it printed.
render: shell
validations:
required: true
- type: input
id: setup
attributes:
label: GPU, CUDA and Python versions
placeholder: RTX 4090, CUDA 12.6, Python 3.12 (or no GPU, reference only)
validations:
required: true
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Problem

<!-- What was missing or wrong? Link the issue, for example: Fixes #3 -->

## Change

<!-- Each file you added or changed, and what it does. -->

## Testing

<!-- Paste the PASS line of the NumPy reference, the last line of `python3 check_all.py`, and the nvcc build
command you ran. If you ran the kernel on a GPU, paste its PASS line and name the GPU and CUDA version. -->
11 changes: 11 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Code of conduct

This repo is a place to learn how GPU kernels work, so questions at every level are welcome.

- Be kind and patient. Assume good intent, and explain instead of judging.
- Keep review comments about the code and the maths, not the person.
- No harassment, insults or personal attacks, in issues, pull requests or anywhere else tied to this repo.
- Say where a number, a formula or an idea came from, and credit other people's work.

If someone breaks these rules, email the maintainer at bindubhargavareddy@gmail.com. Reports stay private. The maintainer may
edit or remove comments, lock threads, or block accounts that break these rules.
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ If you have a GPU, run the binary and paste its PASS line in the pull request.
and int8 GEMM (`triton/10-int8-matmul.py`).
- A GPU test for the Triton kernels that compares each one with PyTorch and skips when there is no GPU.

Open an issue first if you want to discuss an idea before writing it.
Open an issue first, with the **Propose a kernel** form, if you want to discuss an idea before writing it.

## Pull requests

- One kernel or topic per pull request.
- Say what the reference compares against, and paste its PASS line.
- If you add timings, say which GPU, CUDA version and problem size they come from.
- The pull request template asks for the PASS line and the last line of `check_all.py`.
- Everyone here follows the [code of conduct](CODE_OF_CONDUCT.md). Report a security problem by email, as
[SECURITY.md](SECURITY.md) says, not in a public issue.
- By contributing you agree that your work is released under the [MIT License](LICENSE).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ kernel and a Python function that launches it on PyTorch CUDA tensors, for examp

Contributions are welcome: a new kernel, a NumPy check for one of the Triton-only kernels, or a fix. A new
kernel comes with a NumPy check, so CI can test it. See [CONTRIBUTING.md](CONTRIBUTING.md) for the steps and a
list of open ideas.
list of open ideas. Issues and pull requests have short templates, and everyone here follows the [code of conduct](CODE_OF_CONDUCT.md).

## License

Expand Down
7 changes: 7 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security

This repo is CUDA, Triton and NumPy teaching code. It runs no server, reads no secrets and makes no network calls, so most bugs
here are wrong results, not security problems. Please report those in a normal issue.

If you do find a security problem, for example in the CI workflow, do not open a public issue. Email
bindubhargavareddy@gmail.com with the file, what goes wrong and how to reproduce it.
Loading