272 points · by gyre007 · 2y ago · 90 comments
They want you to read this as "we spent $100k compared to Meta's spending billions", but that's not actually what this says. It says that they spent $100k and Meta has the resources to spend billions if they wanted to.
We don't know what Facebook spent on training LLaMA 2, but they say that it took them 184320 A100-80GB GPU-hours to train the 7B model [0]. AWS charges $14.46/hour for an instance that has 8 of those [1], which amounts to $1.81/GPU/hr.
At that rate and assuming they paid something resembling AWS's list price, LLaMA 2 7B cost ~$333k. That's more than $100k, but not by orders of magnitude, and it's likely that Facebook wasn't paying the full price AWS is charging today.
[0] https://github.com/meta-llama/llama/blob/main/MODEL_CARD.md#...
The Mistral guys specifically mention that training speed (due to not needing as much compute) was one of the reasons Mixtral was released so soon after Mistal 7b.
- People hear "mixture of experts" and they think "N specialists" - but ex. think how much know you need to know to autocomplete "Two plus two is "
- Fundamental thing of ML is you define functions and give it data, and the more data you give it to the better. Once youre at "I will simply give it the training data needed to be good enough at the task and wall off that part of the implementation" you're outside ML and have a chicken and egg problem
- We don't know GPT-4 is MoE
- MoE in practice is fundamentally about trading off runtime vs. static size properties to gain inference speed. I.e. 7x8 stored and picking 7x2 at runtime means youre somewhere between 7x2 and 7x3 in quality, inference at 7x2 speed, and have to train and store and load 7x8. You don't reach for it to increase quality, you reach for it to increase inference speed at the expense of inference ram and total model size.
I am pretty damn sure I could build a 8 GPU Intel Xeon E5-2686 v4 (Broadwell) (that's what Amazon uses - it's $30 to $75 on eBay) server for less than that and come out ahead on electricity even at full throttle. RTX 4090 are just under $2000 each on eBay.
8 GPU × $2000 (RTX 4090) + $1000 (for the rest of the computer) = $17,000
If pulling 2kW continuously at 15 cents per kW*hr for 1 year that's 2000 watts × 365 days × (0.15/(kW×hr)) or $2,628
In total the computer will cost $19,628 if you throw it in the dumpster at the end of each calendar year of using it.
If you stack internet cost of $200 a month on top, that's $2400 a year, which raises your annual cost to: $22,028
This is still $124,334 cheaper per year than one AWS 8-GPU server if you fully depreciate your own hardware at the end of year 1 to $0.
I could hire an engineer in America to babysit it with the money left over.
These kind of things are usually only selectively shared.
What is the training data anwyay? Books? (Is it legal to use non public domain, wait whom am I kidding) Reddit posts scrapped from the site? (Without clean up there are lots of bad subreddits) Wikipedia?
Of course I understand why labour costs + employee cost related costs are ignored.
ChatGPT used a crawl of the internet and patches things up with alignment and DPO. Big boys like Microsoft might have deals with publishers to get textbooks in bulk.
Contents from sites with moderation can be filtered using the platform's mechanism, e.g., only include text with a certain length and count of upvotes.
LLMs can be used to generate and filter data as well. Humans have been used to do this, they might have to do this less in the future. Mostly to review what the LLMs are suggesting.
More important, we let an awful lot of self-promotion from the big guys slide around here.
I can live with the guys and gals doing this on a shoestring getting a little of that sweet hype love. This seems pretty legit.
If they had tried to replicate Llama 2 identically with their hardware setup, it'd cost a little bit less than twice their MoE model.
[1] https://github.com/meta-llama/llama/blob/main/MODEL_CARD.md#...
[2] https://blog.ori.co/choosing-between-nvidia-h100-vs-a100-per...
> If two apples cost 2 dollars and 1 apple costs 1.20, what is the discount you're getting
> To calculate the discount, you need to compare the original price of the apples to the price after the discount.
> The original price for two apples is: 2 apples * $1.20/apple = $2.40
> The price for one apple after the discount is: 1 apple * $2.00/apple = $2.00
> Now, let's calculate the discount for one apple: > Original price for one apple - Discounted price for one apple = Discount amount > $2.40 - $2.00 = $0.40
> The discount for one apple is $0.40. Since you're buying two apples, you'll get the discount on both: > Discount amount for two apples = 2 * $0.40 = $0.80
> So, the discount you're getting for two apples is $0.80.
It's good to see MoE being attempted at the smaller sizes, and it may scale well downwards as well given their results. But regardless, 1.25T is very little training data compared to the 6T that Mistral 7B received and even that makes it barely usable and likely not yet saturated. Before it, the sub-13B size class was considered basically an academic exercise.
Interestingly Llama2:13b objects that there is no discount until I clarify: "the discount you're getting [with 2 apples]"
It's not just math though it's any kind of complex reasoning and ambiguity. Comparing to humans is always complex, but humans for the most part wouldn't balk at me asking what discount you're getting without specifying that it's the 2 apples that have the discount in this example. A more advanced model often states the assumptions.
There are lots of nuances in this question as well. I'm still paying 80c more than buying one apple, so I should only buy two apples if I would use two apples.
I mean, you're an idiot of a PI if you have $500K/year of grants and spend it on 5 students and no compute.
> Sally (a girl) has three brothers. Each of her brothers has two sisters. How many sisters does Sally have?
Sally (a girl) has three brothers. Each of her brothers has two sisters. How many sisters does Sally have?
Sally has two sisters. Here's the reasoning: Sally has three brothers. Each of her brothers has two sisters. Since her brothers are the ones who have two sisters each, and we know there are three brothers, we can conclude that each brother has two sisters. Therefore, there are two sisters in total (one for each brother). So, Sally has two sisters.
ollama run llama2:13b
>>> Sally (a girl) has three brothers. Each of her brothers has two sisters. How many sisters does Sally have?
This is a classic lateral thinking puzzle that requires you to think outside the box and challenge your assumptions. The answer is not what you might expect at first glance.
To solve this puzzle, we need to break it down step by step:
1. Sally has three brothers. 2. Each of her brothers has two sisters.
So, let's count the number of sisters that each of Sally's brothers has:
Brother 1: 2 sisters Brother 2: 2 sisters Brother 3: 2 sisters
Now, let's add up all the sisters that Sally has:
Sister 1 + Sister 2 + Sister 3 + Sister 4 + Sister 5 = 2 + 2 + 2 + 2 + 2 = 8
Therefore, Sally has 8 sisters.
Looking at the repo, there is no training or data processing code.
I guess it is good that they mentioned some of it, but yeah, that isn't exceptionally helpful when making claims of it being 100% open source.
I'm not sure why they feel the need to be so secretive if all of the sources are open.
To preempt other queries, maybe just paste the `set` output.
FAANG AI Lab
Lambda Reserved Cloud [1] starts at $1.89 per H100 per hour.
It could be possible to get the cost down to a lower amount:
$1.89 * 96GPUs * 24hours * 14days = ~$61k
Just had a quick chat about kubernetes, very simple discussion. It held well
The Facebook budget includes money to pay off people they've ripped off (in private settlements) and money for lawyers to shield the developers so they can feel free to rip off copyrighted content without having to pay personal penalty or be imprisoned for infringement. It also includes the price of buying lobbyists to alter laws to let this practice continue.
Also, unless the authors work inside Facebook, they have no idea how much Facebook spent on training that model specifically.