You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-12Lines changed: 28 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3

4
4
5
-
Optimized version of [Karpathy's microgpt](https://karpathy.ai/microgpt.html) — the most atomic way to train and inference a GPT in pure, dependency-free Python.
5
+
Optimized version of [Karpathy's microgpt](https://karpathy.ai/microgpt.html), the most atomic way to train and inference a GPT in pure, dependency-free Python.
6
6
7
7
**293 lines, 0 dependencies.** All optimizations preserve the original simplicity.
8
8
@@ -12,34 +12,50 @@ Optimized version of [Karpathy's microgpt](https://karpathy.ai/microgpt.html)
12
12
|---|---|---|
13
13
| Direct `__truediv__` implementation | +8 |~20-30% fewer computation graph nodes per step |
-**`microgpt_cuda.cu`** - CUDA/C++ port with full train/val/inference loop
34
+
-**`microgpt_optimized.html`** - Syntax-highlighted 3-column view with change annotations
35
+
-**`CMakeLists.txt`** - CMake entrypoint for CUDA build
34
36
35
37
## Quick Start
36
38
37
39
```bash
38
40
python microgpt.py
39
41
```
40
42
41
-
It will auto-download `input.txt` (names dataset) on first run, train for 500 steps with periodic validation, then generate samples via top-k sampling.
43
+
It auto-downloads `input.txt` on first run, trains for 500 steps with periodic validation, then generates samples via top-k sampling.
44
+
45
+
## CUDA Build
46
+
47
+
```bash
48
+
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
Original by [@karpathy](https://github.com/karpathy)—[microgpt](https://karpathy.ai/microgpt.html) | [Gist](https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95)
61
+
Original by [@karpathy](https://github.com/karpathy)-[microgpt](https://karpathy.ai/microgpt.html) | [Gist](https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95)
0 commit comments