Show HN: 80% faster, 50% less memory, 0% loss of accuracy Llama finetuning (opens in a new tab)github.com
385 points1. Manual autograd engine - hand derived backprop steps.
2. QLoRA / LoRA 80% faster, 50% less memory.
3. All kernels written in OpenAI's Triton language.
4. 0% loss in accuracy - no approximation methods - all exact.
5. No change of hardware necessary. Supports NVIDIA GPUs since 2018+. CUDA 7.5+.
6. Flash Attention support via Xformers.
7. Supports 4bit and 16bit LoRA finetuning.
8. Train Slim Orca fully locally in 260 hours from 1301 hours (5x faster).
9. Open source version trains 5x faster or you can check out Unsloth Pro and Max codepaths for 30x faster training!
https://www.reddit.com/r/LocalLLaMA/comments/188197j/80_fast... has more info about Unsloth!
Hopefully you can try it out! Wrote a blog post at https://unsloth.ai/introducing if you want to learn more about our manual hand derived backprop or Triton kernels and stuff! Thanks once again!
Comments (119) 20 threads
Show all comments
Showing thread 1 of 20
So in GPUs the goal is to saturate the GPU with matrix multiplies instead of data movement. I'll write a more detailed blog but approximately:
1. Flash Attention v2 reduces the time taken by 17% or so
2. RoPE Triton kernels: -7.1%
3. RMS Layernorm in Triton: -3.1%
4. Cross Entropy in Triton: -1%
5. Manual autograd for MLP: -4%
6. Manual QKV autograd: -2%
7. Manual O autograd: -2%
8. Smart cache evictions and reduced data duplications etc: -30%
9. And other tricks in the Max and Pro versions makes it 30x faster
You can see it's just tricks in each step, which accumulate together to make to go faster.
I'll write up a blog post to detail it all in the future!!!
Continue this thread — 21 replies
Whatever advantage they have I don’t see how they would be able to to keep it for long as part of their closed source “pro” version.
If it’s low hanging fruit the open source equivalents are bound to snipe them before long.
Best of luck and all success to you!
Continue this thread — 1 reply
If you don't believe the timings, I was the author of Hyperlearn https://github.com/danielhanchen/hyperlearn which makes ML faster - I also listed the papers which cite the algos.
I also used to work at NVIDIA making TSNE 2000x faster on GPUs and some other algos like Randomized SVD, sparse matrix multiplies etc.
If you have any suggestions on a more appropriate pricing strategy - I'm all ears!!
I really don't know much about pricing and the open core model, so I'm making stuff up literally.
Continue this thread — 1 reply
Continue this thread — 2 replies
But for now - our goal is somehow to get revenue ourselves via some cool AI products, and trying to shrink the expenses to 0 (like via our fast training methods)
That's how I would make profit from what you're doing as many big tech companies have already achieved (and more) of what you claim.
I know this as I work in such a company. However, I'd bet they'd pay a fair amount for new solutions that differ from their own.
I worked myself in the past at NVIDIA making algos faster, so it's not a done deal big tech companies have all the tips and tricks. They have the best hardware, but software not so much.
The issue with licensing code is your revenue capture is minimal - maybe a training platform which provides everyone and not just big tech companies a cheap and efficient implementation sounds much better.
The issue with licensing is how much do you charge? How do you monitor usage? Etc