I use training benchmarks to compare how efficiently different implementations reach a fixed model-training target. These results connect my work on affordable model training with low-level implementation work such as cuda training implementation.
I praised @kellerjordan0 for adapting the nanoGPT/llmc PyTorch training code into a benchmark that trains a 124M Transformer to a fixed validation loss target.
I reported the current SOTA as 3.8X more token-efficient training (2.7B vs. 10B tokens).
I described modded-nanogpt as achieving the same GPT-2 (124M) training result in 45 min on 8xH100 to only 5 min.
I praised the modded-nanogpt repo as 600 LOC.
I enabled fp8 training for +4.3% improvement to "time to GPT-2", down to 2.91 hours now.
At 8XH100 spot-instance prices, I estimated that this GPT-2 reproduction costs ~$20.
I noted that fp8 on H100 offers 2X the FLOPS on paper, but the realized speedup is smaller because the run is not fully compute-bound and scale conversions add overhead.
I found that with rowwise scaling, fp8 and bf16 loss curves were quite close but it was stepping net slower.
With tensorwise scaling, the loss curves separated more, but the configuration produced a speedup of ~7.3%.
After experimenting with recipes and training horizons, I ended up with an overall ~5% speedup.
The torchao paper reports a 25% fp8 training speedup for Llama3-8B, compared with my ~7.3% without taking into account capability; Llama3-8B is a lot bigger model.
I described GPT-2 as my favorite LLM because it was the first time the LLM stack comes together in a recognizably modern form, and said it had become a weird and lasting obsession to train a model to GPT-2 capability for much cheaper.
I expect it should be possible to bring the GPT-2 training time well below 1 hr.
I said fp8 was more tricky than I anticipated and that I was not 100% sure if it's a great idea because of less overall support for it.
I said potential improvements include picking and choosing which layers to apply it on exactly; being more careful with the numerics across the network.
Related: llm training research, training compute and efficiency, nano gpt quick start