Keller Jordan
Keller Jordan
@kellerjordan0
Dec 28 8 months ago 9 tweets Read on X

New training speed record for ’s 124M-parameter NanoGPT setup: 3.28 Fineweb validation loss in 3.7B training tokens

Previous record: 5B tokens
Changelog: new optimizer
1/8

Tweet image 1

The new optimizer is defined as follows. It is based on orthogonalizing the update given by SGD-Nesterov-momentum in an efficient way

Tweet image 1
Tweet image 2

It uses half the memory of AdamW and takes 3% extra wallclock time per step for this setup

Here's code to reproduce the result:

A variant of this optimizer also yielded a training speed record for CIFAR-10. Scaling it up to NanoGPT was surprisingly simple
4/8

@kellerjordan0
New CIFAR-10 speed record: 94% in 2.73 seconds on a single A100

Previous record: 3.09 seconds
Changelog: Implemented spectral gradient descent
https://t.co/0dmiqX4xnx

The optimizer's core design decisions are:
- For each parameter, orthogonalize the update *after* applying Nesterov momentum
- Use a fast iterative method for the orthogonalization. Quintic Newton-Schulz works well
- Run the iteration in bfloat16
5/8

And
- To minimize the number of Newton-Schulz steps, select the quintic coefficients aggressively to maximize slope at zero, even at the cost of some variance / non-convergence. There's an interesting tradeoff space here
6/8

I would like to thank & acknowledge for sending me his recent paper, which is where I learned about the crucial Newton-Schulz iteration method. He also had the insight that my initial quintic coefficients could be improved.
7/8

I'm still thinking about names for the optimizer, & there may be a full arXiv writeup at some point. I hope the community finds this intermediate result interesting; critiques are welcomed
8/8

@kellerjordan0
There are some simple ways that all optimizer research can go wrong: e.g., my AdamW baseline could be poorly tuned. So I hereby invite anyone to try to get a better AdamW baseline than I did in this setup; I'll happily boost/RT your result if you can
https://t.co/nPuMoq2CGX

Missing some Tweet in this thread? You can try to Update

More Threads by @kellerjordan0

1 tweets • 26 days ago
Read Thread
3 tweets • 1 month ago
Read Thread
1 tweets • 2 months ago
Read Thread
1 tweets • 3 months ago
Read Thread
6 tweets • 3 months ago
Read Thread

Unroll Another Thread

Convert any Twitter threads to an easy-to-read article instantly

Have you tried our Twitter bot?

You can now unroll any thread without leaving Twitter/X. Here's how to use our Twitter bot to do it.

  • Give us a follow on Twitter. follow us
  • Drop a comment, mentioning us @unrollnow on the thread you want to Unroll.
  • Wait For Some Time, We will reply to your comment with Unroll Link.
UnrollNow Twitter Bot
Modal Image
0:00 / 0:00