Optimizing a GPT-2-Class Transformer on a GPU — Martin S. Kristiansen
Session notes: taking a GPT-2-small-class transformer from a naive CUDA port at 78ms to a tuned hybrid at 1.60ms on an RTX 3080 Ti — past torch.compile — then batching to 136K tokens/s and turning the method itself into a search program.
martinkristiansen.com