Armando (@arpesenti) header
Armando (@arpesenti) profile picture

https://teapaw.org/t.co/HdTU08Rc2m

London, England
Joined February 2007
Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)Photo by Armando (@arpesenti)
📽️ New 4 hour (lol) video lecture on YouTube: "Let’s reproduce GPT-2 (124M)" youtu.be/l8pRSuU81PU The video ended up so long because it is... comprehensive: we start with empty file and end up with a GPT-2 (124M) model: - first we build the GPT-2 network - then we optimize it to train very fast - then we set up the training run optimization and hyperparameters by referencing GPT-2 and GPT-3 papers - then we bring up model evaluation, and - then cross our fingers and go to sleep. In the morning we look through the results and enjoy amusing model generations. Our "overnight" run even gets very close to the GPT-3 (124M) model. This video builds on the Zero To Hero series and at times references previous videos. You could also see this video as building my nanoGPT repo, which by the end is about 90% similar. Github. The associated GitHub repo contains the full commit history so you can step through all of the code changes in the video, step by step. github.com/karpathy/build-na… Chapters. On a high level Section 1 is building up the network, a lot of this might be review. Section 2 is making the training fast. Section 3 is setting up the run. Section 4 is the results. In more detail: 00:00:00 intro: Let’s reproduce GPT-2 (124M) 00:03:39 exploring the GPT-2 (124M) OpenAI checkpoint 00:13:47 SECTION 1: implementing the GPT-2 nn.Module 00:28:08 loading the huggingface/GPT-2 parameters 00:31:00 implementing the forward pass to get logits 00:33:31 sampling init, prefix tokens, tokenization 00:37:02 sampling loop 00:41:47 sample, auto-detect the device 00:45:50 let’s train: data batches (B,T) → logits (B,T,C) 00:52:53 cross entropy loss 00:56:42 optimization loop: overfit a single batch 01:02:00 data loader lite 01:06:14 parameter sharing wte and lm_head 01:13:47 model initialization: std 0.02, residual init 01:22:18 SECTION 2: Let’s make it fast. GPUs, mixed precision, 1000ms 01:28:14 Tensor Cores, timing the code, TF32 precision, 333ms 01:39:38 float16, gradient scalers, bfloat16, 300ms 01:48:15 torch.compile, Python overhead, kernel fusion, 130ms 02:00:18 flash attention, 96ms 02:06:54 nice/ugly numbers. vocab size 50257 → 50304, 93ms 02:14:55 SECTION 3: hyperpamaters, AdamW, gradient clipping 02:21:06 learning rate scheduler: warmup + cosine decay 02:26:21 batch size schedule, weight decay, FusedAdamW, 90ms 02:34:09 gradient accumulation 02:46:52 distributed data parallel (DDP) 03:10:21 datasets used in GPT-2, GPT-3, FineWeb (EDU) 03:23:10 validation data split, validation loss, sampling revive 03:28:23 evaluation: HellaSwag, starting the run 03:43:05 SECTION 4: results in the morning! GPT-2, GPT-3 repro 03:56:21 shoutout to llm.c, equivalent but faster code in raw C/CUDA 03:59:39 summary, phew, build-nanogpt github repo
391
2,147
414
15,201
1,529,291
Starship will make life multiplanetary
16,393
28,518
2,822
437,826
51,794,663
. @wizzair the only company asking you for a ransom to get refund/compensation for denied boarding. Quoting: “As we checked reservation was cancelled due to underpaid booking. You need to pay 115 EUR to finish reservation.” One how can even underpay when booking online?
1
1
197
Discovered that my @wizzair booking was cancelled without any notice apparently because the flight was severly overbooked. Never again with @wizzair
2
1
2
402
Is @wizzair the worst airline? I have a flight today and I can't do the online checking because my booking disappeared! I have already spent 50+ euro on the call center
1
77
so happy we can finally call them quarter pounders and not 454 grammers
1,005
3,311
663
37,178
If anyone is interested this is the full list of participants to the 2022 Ride London 100 @RideLondon sorted by finish time drive.google.com/file/d/1GJ2…
3
Wow, times have changed: Microsoft & the UK government discussing in quite some detail the UK Covid dashboard (Open Source!) implementation: techcommunity.microsoft.com/…
2
4
Armando retweeted
Paw · The most advanced REST & GraphQL API client for Mac paw.cloud · Our crazy🤯 2021 Black Friday offer: Retweet this and get a free Paw license (worth $49.99) 💙
213
2,645
268
721
‘Exercise your best judgement’ says Boris Johnson to country that elected him Prime Minister.
301
7,228
370
48,689
Thanks @Apple Mail, I suppose it'll take a while to read all those messages... 🤦‍♂️
1
#Haveyoudownloaded? The #NHSCOVID19app is now available to download in England and Wales, a vital tool in helping you protect the ones you love. 📱Download now: ➡️Google Play Store: play.google.com/store/apps/d… ➡️Apple App Store: apps.apple.com/us/app/id1520… ➡️covid19.nhs.uk/
172
672
255
496
What we need now is some clarity... #montypython #stayathome
111
2,267
644
4,928
Great video from @3blue1brown - Exponential growth and epidemics youtu.be/Kas0tIxDvrg
Panic buying is a symptom of a dysfunctional society diseased with individualism To those with litres of soap at home- do you realise that to slow the transmission of COVID-19 you need other people to be cleaning their hands too?! A fortress of toilet paper will not protect you
2,082
66,977
2,783
299,276