🎯 Загружено автоматически через бота:
🚫 Оригинал видео:
📺 Данное видео принадлежит каналу «Andrej Karpathy» (@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:
intro: Let’s reproduce GPT-2 (124M)
exploring the GPT-2 (124M) OpenAI checkpoint
SECTION 1: implementing the GPT-2
loading the huggingface/GPT-2 parameters
implementing the forward pass to get logits
sampling init, prefix tokens, tokenization
sampling loop
sample, auto-detect the device
let’s train: data batches (B,T) → logits (B,T,C)
cross entropy loss
optimization loop: overfit a single batch
data loader lite
parameter sharing wte and lm_head
model initialization: std , residual init
SECTION 2: Let’s make it fast. GPUs, mixed precision, 1000ms
Tensor Cores, timing the code, TF32 precision, 333ms
float16, gradient scalers, bfloat16, 300ms
, Python overhead, kernel fusion, 130ms
flash attention, 96ms
nice/ugly numbers. vocab size 50257 → 50304, 93ms
SECTION 3: hyperpamaters, AdamW, gradient clipping
learning rate scheduler: warmup cosine decay
batch size schedule, weight decay, FusedAdamW, 90ms
gradient accumulation
distributed data parallel (DDP)
datasets used in GPT-2, GPT-3, FineWeb (EDU)
validation data split, validation loss, sampling revive
evaluation: HellaSwag, starting the run
SECTION 4: results in the morning! GPT-2, GPT-3 repro
shoutout to llm.c, equivalent but faster code in raw C/CUDA
summary, phew, build-nanogpt github repo
Corrections:
I will post all errata and followups to the build-nanogpt GitH
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$
3 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
7 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
10 months ago 00:20:13 1
GPT-5: Everything You Need to Know So Far
12 months ago 00:14:07 1
“Что в имени тебе моем?“ Учимся генерировать новые имена у звездного разработчика Tesla и OpenAI.
12 months ago 00:59:48 21
Введение в большие языковые модели от Andrej Karpathy
1 year 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