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
{{ message }}
Repository navigation
Commit 77b024b
Browse filesBrowse the repository at this point in the historyBrowse files
Split the GPT into a model view and a separate loss
The model is the view logits; the cross-entropy loss is a LOSS of CTEs
that reads it, as nanoGPT's F.cross_entropy reads the model's logits. The
loss reads the view once, into a CTE, because DuckDB expands a view at
every read but computes a CTE read twice only once (232 operators and
0.097 s reading it twice, 126 and 0.06 s reading it once).
A DataFusion view keeps reading the tables that existed when it was
created (#271), so each step recreates the view after registering the
batch and the parameters.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NyN7idACeDMh94qrnFMu6h
Copy file name to clipboardExpand all lines: benchmarks/ml/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ array programs.
18
18
| # | Script | Model | What it measures |
19
19
|---|---|---|---|
20
20
| 01 |[`01_attention.py`](01_attention.py)| causal softmax attention, the core of a transformer, as a view (the model) in einfold's window and `GROUP BY` spellings, and a loss that reads it | the naive plan, which stores every score, for [FlashAttention](https://arxiv.org/abs/2205.14135)'s tiled plan to beat; gradients with respect to Q, K and V; masked pairs as absent rows; a control that isn't attention, the Nadaraya–Watson kernel average |
21
-
| 02 |[`02_nanogpt.py`](02_nanogpt.py)|[nanoGPT](https://github.com/karpathy/nanoGPT)'s GPT-2 model, at 1 layer and 4,416 parameters, on Tiny Shakespeare | the loss on each host; training steps with SGD or, as nanoGPT trains, AdamW, every parameter table checked after every step |
21
+
| 02 |[`02_nanogpt.py`](02_nanogpt.py)|[nanoGPT](https://github.com/karpathy/nanoGPT)'s GPT-2 model, at 1 layer and 4,416 parameters, as a view, and a cross-entropy loss that reads it, on Tiny Shakespeare | the loss on each host; training steps with SGD or, as nanoGPT trains, AdamW, every parameter table checked after every step |
22
22
| 03 |[`03_graphcast.py`](03_graphcast.py)| a miniature [GraphCast](https://arxiv.org/abs/2212.12794), DeepMind's graph neural network for weather forecasting, over [ERA5](https://www.ecmwf.int/en/forecasts/dataset/ecmwf-reanalysis-v5) reanalysis in Zarr | a global against a regional forecast; the gradient of the forecast error; the receptive field of a region |
23
23
24
24
The SQL favors legibility over speed. Each model reads like its definition,
0 commit comments