File size: 1,436 Bytes
8bfc5bb fc22188 8bfc5bb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ---
license: mit
library_name: tinygrad
tags:
- gpt2
- webgpu
- tinygrad
- logit-lens
---
# tinygpt-webgpu
GPT-2 124M compiled to WGSL compute kernels by [tinygrad]'s WebGPU exporter, for
running inference in the browser at <https://jik.wtf/tinygpt>.
This repository holds only the weight payloads. The compiled kernels and the
manifests that describe these blobs live in the site repository beside the
loader, because the offsets in a manifest are meaningful only against the exact
blob they were computed for.
| file | bytes | contents |
| --- | --- | --- |
| `weights-*.bin` | 495,399,936 | transformer weights, fp32, laid out for the exported graph |
| `lens-*.bin` | 30,670,848 | fitted J-lens Jacobians, 13 layers |
Weights are delivered as 16 MiB content-addressed chunks. Each file name carries
the SHA-256 of its own contents, so a chunk URL always refers to exactly one
sequence of bytes: safe to cache indefinitely, and impossible to pair with a
manifest describing a different packing. The manifests listing them live in the
site repository beside the loader.
The decode graph is compiled for a fixed 256-slot KV cache and emits both logits
and all 13 residual stream taps, so both lenses read from one forward pass.
Greedy decoding reproduces the native tinygrad oracle token for token:
`"The capital of France is"` continues `" the capital of the French"`.
[tinygrad]: https://github.com/tinygrad/tinygrad
|