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

Show all comments

Showing thread 16 of 20

squigz3 replies#
What is the motivation behind open sourcing code at all if you're not going to open source it all? I don't mean this to be an asshole, as I truly want to understand the motivation.
sbierwagen1 reply#
Shareware. See the open source preview, pay a million dollars for the full version.
danielhanchen#
I wouldn't characterize it exactly as "shareware", since the OSS version is fully functional, trains 5x faster on a single GPU.

The paid version just makes it train 30x faster on multi GPU platforms - it's more of an open core approach.

ShamelessC1 reply#
This is, I believe, part of the Y Combinator playbook. You want to get as much growth as possible using any means you can think of then flip the pricing (or tracking) on as soon as it peaks. Alternatively you can sell your company or go public.

The company here does seem less sinister however - don't think they've accepted VC investment yet? Could be wrong.

danielhanchen1 reply#
No we don't have any funding! I'm grateful to my family to supporting us till now.

We're open to VC investment now, except we truly believe in bootstrapping it - we have tonnes of other products in the pipeline like a Recession predictor, a Data Science Consultant, our own trained chatbot via DPO and our fully cleaned datasets and more!

ShamelessC1 reply#
Refreshing to see, especially on this forum! Best of luck.

Continue this thread — 1 reply

danielhanchen3 replies#
Good point - the main issue is we encountered this exact issue with our old package Hyperlearn (https://github.com/danielhanchen/hyperlearn).

I OSSed all the code to the community - I'm actually an extremely open person and I love contributing to the OSS community.
The issue was the package got gobbled up by other startups and big tech companies with no credit - I didn't want any cash from it, but it stung and hurt really bad hearing other startups and companies claim it was them who made it faster, whilst it was actually my work. It hurt really bad - as an OSS person, I don't want money, but just some recognition for the work.
I also used to accept and help everyone with coding up their startup's software, but I never got paid or even any thanks - sadly I didn't expect the world to be such a hostile place.
So after a sad awakening, I decided with my brother instead of OSSing everything, we would first OSS something which is still very good - 5X faster training is already very reasonable.
I'm all open to other suggestions on how we should approach this though! There are no evil intentions - in fact I insisted we OSS EVERYTHING even the 30x faster algos, but after a level headed discussion with my brother - we still have to pay life expenses no?
If you have other ways we can go about this - I'm all ears!! We're literally making stuff up as we go along!

kristopolous1 reply#
There's a variety of licenses some of which protect you from this problem. Maybe those would be appropriate?
danielhanchen2 replies#
Sadly I've tried GPL3 for Hyperlearn and AGPL3 - those licenses only work for UI or Database based OSS - eg MongoDB, Gitlab etc.

I still haven't figured out how to open source algorithms which don't have an UI or database - maybe a training or inference platform?
But if we made a training / inference platform, then there won't be any OSS code.
We're currently stuck in the middle - do you have any suggestions on this?

Jayakumark1 reply#
Sell binaries without code for individuals/enterprises who can train on private data , Get some GPUs and sell training platforms similar to together.ai for enterprises with data privacy guarantee. just make it super simple , give a google like sheet to fill or dump a folder with text files and you can use ml to make it in structured format. User gives

Input - > excel, txt etc
Select model base -> mystal, llama2
output --> fine trained model.
Give a fixed cost based on data you got .. say it will take $50 to train on this ? for 25 hours of GPU with your markup.
User Pays the bill and get PEFT llama model out.
The big problem i see in Finetuning for GPU Poor is no one gives an estimate on how much it will cost for your data on a given model.
have a calculator for x words or Bytes and y epochs, here is the cost we are estimating..
Once you make your $x million in terms of 50x your pay for the time you invested, you can open source it, but we are greedy when it comes to money.. so opensource model at your will. In the mean time hope no one catches your technique.

danielhanchen#
Ye a training platform!

Ye for hobbyists - it's hard to price.
But I agree some sort of platform for training could in theory work

Zuiii3 replies#
> I still haven't figured out how to open source algorithms

You're not supposed to be able to restrict algorithms (i.e. math), and copyright (e.g. open source licenses) is definitely not the right tool. If you want to do it anyway, You'll have better chances by abusing the patent system.

Continue this thread — 3 replies

squigz1 reply#
Thanks for your response, and for open sourcing things at all :)

> The issue was the package got gobbled up by other startups and big tech companies with no credit
I understand that this is frustrating, but are you open sourcing things for recognition? The fact is companies are going to use 100s of open source packages and aren't going to credit them all, or even any.
At any rate, I appreciate how difficult your position must be, and wish you luck.

danielhanchen#
Thanks! :)

I agree, but generally as a researcher / OSS even a nice citation is nice :) There are some cool people who do just that, but some do not.
But thanks once again!

nikolayasdf1232 replies#
> gobbled up by other startups and big tech companies with no credit

true. saw this myself too for my projects. big tech / startups would use your project internally and give you nothing back. sadly happens often.

danielhanchen#
:( Very sad
MyFirstSass1 reply#
I feel like free open source without paying is for tinkerers, startups, smaller orgs, but as soon as you become a "big company" with wealthy owners you need to either contribute or pay up.

This also incentives contributing to open source, because you'd potentially get compensated if the code was used by some big corporation.
Why isn't this a thing?

Continue this thread — 1 reply