Lurker News
Hi HN! I'm just sharing a project I've been working on during the LLM Efficiency Challenge - you can now finetune Llama with QLoRA 5x faster than Huggingface's original implementation on your own local GPU. Some highlights:

1. 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

Earlier comments
yunohn1 reply#
This seems very interesting, but I’m very confused why you have gated the /max/imum speedup version for enterprise-only? It would make more sense to have only the Free and Paid plans differing in performance, and Enterprise getting support/etc.
danielhanchen1 reply#
Good point - we thought about this - we're still figuring out the pricing as we go along - so all suggestions are welcome!

I'm all very new to this, so I'm literally making stuff as I go along!!
Apologies!

yunohn1 reply#
No worries, just my 2c!

Given the current state of AI performance, I’d imagine that those without 100s of GPUs but looking to maximise the performance of what they do have, would be a great demographic for the Paid plan.

danielhanchen2 replies#
Interesting! I did have some chats from interested people who have say 2 or 4 or 8 GPUs who are willing to somehow buy the Pro plan - the issue is now how do we price it, do we make a training platform? etc

Continue this thread — 2 replies

0x6c6f6c2 replies#
I see this mentions 2018+ GPUs, but I'm curious why this wouldn't work on say a 1080Ti. My cursory look at the hardware specs shows this has support for CUDA8+ and this states 7.5

Would someone be able to tell me more about this?

zargon#
1080 Ti has CUDA capability version 6.1.
danielhanchen1 reply#
Sorry about 1080 Ti - sadly Triton and Xformers support Cuda 7.0, so unless if OpenAI and Meta makes it support Cuda 6.0, we sadly don't support it.

The main reason is because from Turing, Tensor Cores got provided, and so the matrix matmuls are all different in Tensor Cores

3abiton1 reply#
Any source recommendations on howto find out the minimum hw requirementsto train LLM with Xbit and YB parameters?
danielhanchen#
Great question - I'm actually not sure - I'll probably write up some minimum requirements - I know QLoRA's paper https://arxiv.org/pdf/2305.14314.pdf has an approximate calculation of the weights size, but not the gradient updates
gentleman112 replies#
Isnt llama proprietary? Why not dine tune one of the truly open models instead?
danielhanchen#
Llama is generally OSS, except for some gating to large companies - but as a first try I made it work for Llama since the architecture is replicated in other models like Mistral or Yi.
selfhoster111 reply#
There's a tremendous open source ecosystem in place for Llama already. This is a huge deal for beginners and model integrators alike.

Not to mention that other than beyond 7B models, your options drastically taper off. Mistral and most open base model projects only have models available up to 7 billion parameters or so, which is quite tiny if you are used to the relative ease of using un-finetuned GPT-4 to carry out your tasks of choice.
So what options are there? Falcon 40B and MPT-30B - sure, the weights license is all right, but many in the community have reservations about those models' underperformance, as you can get much more bang for your buck with newer models, in an equal number of weights in a newer base model. Subjectively speaking, it could be a waste of time.
Falcon 180B and Yi 34B weights are both issued under non-free licenses, just like Llama 2.
Is Llama 2 proprietary? For the vast majority of people, for the vast majority of purposes, no. I'm not a lawyer, but I think that Meta would be quite unlikely to do more than cut off your HuggingFace access to the repo where new models will be distributed.

danielhanchen#
Thanks to Meta for open sourcing Llama!!! Ye sadly the HFF leaderboard doesn't have a high opinion for Falcon. MPT's long context via Alibi did work, just less so when compared to RoPE scaling.

All thanks to Llama - the LLM community is now vibrant and alive!

foota1 reply#
There are a number of papers on optimizing xor chains for cauchy reed Solomon computation, it sounds like a superficially similar problem?
danielhanchen1 reply#
Hey! Oh noo we don't do any XOR chain optimizations or Cauchy Reed Solomon computations - I had to wikipedia it and learn about them - mroe reading to do!

It's mainly trying to reduce data movement, maximize FLOP utilization via matrix multiplies, and reducing FLOPs via manually deriving backpropagation equations + more!

foota1 reply#
I realize they're different, but it seems like there are some similarities. In both, you have some chain of operations you need to do, and you want to minimize their cost and optimize for cache benefits etc.,

This is a pretty good overview paper: https://arxiv.org/pdf/2108.02692.pdf (they claim to be better than the rest -- I haven't evaluated their claims in practice yet)
The techniques are mostly about ordering and common subexpression elimination for XOR operations and choosing "better" matrices to do the computation with. CRS codes can be used with many different matrices, but it turns out some are better than others for effiency (XOR operations are encoded by 1s in the CRS matrix, so if you choose a CRS matrix with fewer of them while meeting the requirements, you can do less operations and get the same results).

danielhanchen2 replies#
OHHH yes yes - sorry you're correct - apologies I'm not too familiar with this - thanks for the paper I'll read it through!!

Yep so the OSS version does have the reordering of operations - I'll write a blog post about it in the coming days!! We also have other tricks up our sleeve to make it go even faster!!

Continue this thread — 2 replies

Load more comments