README.md 2.88 KB
Newer Older
whlwhlwhl's avatar
whlwhlwhl committed
1
# KernelPilot Kernel Knowledge
2

whlwhlwhl's avatar
whlwhlwhl committed
3
4
5
This directory backs the KernelPilot knowledge skills, including
`lightop-kernel-knowledge` and `triton-kernel-knowledge`. For DCU kernel work,
use evidence in this order:
6

whlwhlwhl's avatar
whlwhlwhl committed
7
8
9
1. Local target source, wrappers, bindings, config tables, tests, and
   benchmarks. For Triton work this includes vLLM/SGLang source or a
   user-specified direct Triton file and its harness.
10
11
2. ROCm/DCU official docs and upstream source: SourceFind DCU/DTK docs,
   ROCm/HIP, MIOpen, rocBLAS, hipBLASLt, Composable Kernel, Triton AMD,
whlwhlwhl's avatar
whlwhlwhl committed
12
13
14
15
16
   PyTorch ROCm, SGLang/vLLM AMD paths, AITER, AOTriton, Conch, FlagGems,
   Liger Kernel, Hugging Face kernels, Triton-distributed, the Hygon HIP
   optimizer reference, protected DCU Toolkit AMD knowledge-base pointer, plus
   bundled MR evidence from SourceFind LightOp and DCU Toolkit
   flash-attention-cutlass.
17
18
19
20
21
22
3. The bundled CUDA-oriented PR corpus, only as cross-platform inspiration
   after translating and validating the idea on DCU.

The existing corpus is still available:

- PR pages under `sources/prs/`
whlwhlwhl's avatar
whlwhlwhl committed
23
- Source reference pages under `sources/refs/`
24
25
26
27
28
29
30
31
32
33
34
- PR evidence bundles under `evidence/pull-bundles/`
- Candidate ledgers under `candidates/`
- Metadata under `data/`
- Query and materialization scripts under `scripts/`

Run local PR queries from this directory:

```bash
python3 scripts/query.py "<keywords>" --compact --limit 30
python3 scripts/query.py "lightop dcu <operator>" --repo sourcefind-lightop --compact --limit 20
python3 scripts/query.py "flash attention dcu" --repo flash-attention-cutlass --compact --limit 20
whlwhlwhl's avatar
whlwhlwhl committed
35
36
python3 scripts/query.py "hygon dcu mmac" --type source-reference --compact --limit 20
python3 scripts/query.py "amd knowledge base dcu" --type source-reference --compact --limit 20
whlwhlwhl's avatar
whlwhlwhl committed
37
38
39
40
41
python3 scripts/query.py "aiter triton mla rocm" --type source-reference --compact --limit 20
python3 scripts/query.py "conch triton paged attention" --type source-reference --compact --limit 20
python3 scripts/query.py "flaggems triton pytorch operator" --type source-reference --compact --limit 20
python3 scripts/query.py "liger triton rmsnorm swiglu" --type source-reference --compact --limit 20
python3 scripts/query.py "triton distributed allreduce gemm" --type source-reference --compact --limit 20
42
python3 scripts/search-pr-diffs.py <term1> <term2> [--any] [--limit 100]
whlwhlwhl's avatar
whlwhlwhl committed
43
python3 scripts/get_page.py <page-id>
44
45
46
47
48
49
```

When CUDA evidence shapes a LightOp implementation, record that it is
inspiration, cite the source path/URL and commit/version, and explain the DCU
translation: HIP API, CU/wavefront/LDS/MFMA/resource/config differences.

whlwhlwhl's avatar
whlwhlwhl committed
50
51
52
53
54
Protected source pointers, such as the DCU Toolkit AMD knowledge base, are
index entries only until authenticated content is synced. Do not cite them as
direct implementation evidence without the imported file path, commit/version,
and license/notice details.

55
56
57
58
59
Validate the bundled corpus with:

```bash
python3 scripts/validate.py
```