🎯 Загружено автоматически через бота:
🚫 Оригинал видео:
📺 Данное видео принадлежит каналу (@AndrejKarpathy). Оно представлено в нашем сообществе исключительно в информационных, научных, образовательных или культурных целях. Наше сообщество не утверждает никаких прав на данное видео. Пожалуйста, поддержите автора, посетив его оригинальный канал.
✉️ Если у вас есть претензии к авторским правам на данное видео, пожалуйста, свяжитесь с нами по почте support@, и мы немедленно удалим его.
📃 Оригинальное описание:
We reproduce the GPT-2 (124M) from scratch. This video covers the whole process: First we build the GPT-2 network, then we optimize its training to be really fast, then we set up the training run following the GPT-2 and GPT-3 paper and their hyperparameters, then we hit run, and come back the next morning to see our results, and enjoy some amusing model generations. Keep in mind that in some places this video builds on the knowledge from earlier videos in the Zero to Hero Playlist (see my channel). You could also see this video as building my nanoGPT repo, which by the end is about 90% similar.
Links:
- build-nanogpt GitHub repo, with all the changes in this video as individual commits:
- nanoGPT repo:
- llm.c repo:
- my website:
- my twitter:
- our Discord channel:
Supplementary links:
- Attention is All You Need paper:
- OpenAI GPT-3 paper: - OpenAI GPT-2 paper: The GPU I’m training the model on is from Lambda GPU Cloud, I think the best and easiest way to spin up an on-demand GPU instance in the cloud that you can ssh to:
Chapters:
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
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 , 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 , 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
Corrections:
I will post all errata and followups to the build-nanogpt GitHub repo (link above)
SuperThanks:
I experimentally enabled them on my channel yesterday. Totally optional and only use if rich. All revenue goes to to supporting my work in AI Education.
1 view
0
0
2 months ago 04:01:25 11
[Andrej Karpathy] Let’s reproduce GPT-2 (124M)
2 months ago 00:27:13 2
But what is a GPT? Visual intro to transformers | Chapter 5, Deep Learning
2 months ago 00:44:17 1
No Priors Ep. 80 | With Andrej Karpathy from OpenAI and Tesla
2 months ago 00:18:11 53
НОВОСТИ ИИ: Подписка на ChatGPT за 2000$
2 months ago 00:26:10 1
Attention in transformers, visually explained | Chapter 6, Deep Learning
3 months ago 00:06:53 1
Elon Musk says losers use LiDAR. [Explanation video]
4 months ago 00:47:27 1
Projeto Secreto da OpenAI: Descubra as Últimas Inovações da IA e Fique Super Atualizado no IA News#6
4 months ago 00:07:41 1
Educação 100% com IA, FBI invade celular, Hype das IA no fim, e muito mais
6 months ago 00:40:08 1
The Most Important Algorithm in Machine Learning
6 months ago 00:08:29 1
CATL’s sodium hybrid battery will be 30% cheaper & revolutionise the world
7 months ago 00:08:55 1
Tesla reveals timelline for massive electric Semi production at $ factory
8 months ago 00:26:53 1
Vedal & Neuro Build A Language Model From Scratch
8 months ago 00:03:19 2
How To Study Hard - Richard Feynman
9 months ago 00:16:39 1
Phi-1: A ’Textbook’ Model
9 months ago 00:20:13 1
GPT-5: Everything You Need to Know So Far
11 months ago 00:14:07 1
“Что в имени тебе моем?“ Учимся генерировать новые имена у звездного разработчика Tesla и OpenAI.
12 months ago 00:59:48 21
Введение в большие языковые модели от Andrej Karpathy
12 months ago 00:03:51 1
ČENDEŠ - Karpaty, Karpaty [OFFICIAL 2017 4K]
1 year ago 00:30:09 1
Andrej Karpathy - AI for Full-Self Driving at Tesla
1 year ago 01:03:42 3
[SafeCode Live] ML в AppSec
1 year ago 00:05:48 3
Advice for machine learning beginners | Andrej Karpathy and Lex Fridman
1 year ago 03:28:47 25
Andrej Karpathy Tesla AI, Self-Driving, Optimus, Aliens, and AGI Lex Fridman Podcast #333
1 year ago 03:08:46 1
George Hotz: Tiny Corp, Twitter, AI Safety, Self-Driving, GPT, AGI & God | Lex Fridman Podcast #387
1 year ago 00:07:56 11
[Lex Clips] How to hack the simulation | Andrej Karpathy and Lex Fridman