diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..0086358 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/new-kernel.yml b/.github/ISSUE_TEMPLATE/new-kernel.yml new file mode 100644 index 0000000..7495a8a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-kernel.yml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/wrong-result.yml b/.github/ISSUE_TEMPLATE/wrong-result.yml new file mode 100644 index 0000000..7619f2e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/wrong-result.yml @@ -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 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..86706d5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## Problem + + + +## Change + + + +## Testing + + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..ed8ef2c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 470567a..350b620 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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). diff --git a/README.md b/README.md index 49efc5a..f8771f4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..32fa17f --- /dev/null +++ b/SECURITY.md @@ -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.