News for hackers. Stuff that matters.
Re:Llama 3.1 Official Launch by cchance on Tuesday July 23, 2024 @11:26AM (#41046980)
Super cool, though sadly 405b will be outside most personal usage without cloud providers which sorta defeats the purpose of opensource to some extent atleast sadly, because .. nvidia's rampup of consumer VRAM is glacial
Re:Llama 3.1 Official Launch by gkk on Tuesday July 23, 2024 @11:33AM (#41047088)
If you think of open source as a protocol through which the ecosystem of companies loosely collaborate, then it's a big deal. E.g. Groq can work on inference without a complicated negotiations with Meta. Ditto for Huggingface, and smaller startups.

I agree with you on open source in the original, home tinkerer sense.

Re:Llama 3.1 Official Launch by loudmax on Tuesday July 23, 2024 @11:58AM (#41047456)
I agree that 405B isn't practical for home users, but I disagree that it defeats the purpose of open source. If you're building a business on inference it can be valuable to run an open model on hardware that you control, without the need to worry that OpenAI or Anthropic or whoever will make drastic changes to the model performance or pricing. Also, it allows the possibility of fine-tuning the model to your requirements. Meta believes it's in their interest to promote these businesses.

I'd think of the 405B model as the equivalent to a big rig tractor trailer. It's not for home use. But also check out the benchmark improvements for the 70B and 8B models.

Re:Llama 3.1 Official Launch by aabhay on Tuesday July 23, 2024 @11:32AM (#41047069)
Zoom out a bit. There’s a massive feeder ecosystem around llama. You’ll see many startups take this on and help drive down inference costs for everyone and create competitive pressure that will improve the state of the art.
Re:Llama 3.1 Official Launch by monkeydust on Tuesday July 23, 2024 @12:09PM (#41047604)
Great for Groq whos already hosting it but at what cost I guess.
Re:Llama 3.1 Official Launch by niutech on Friday July 26, 2024 @07:09PM (#41083132)
Groq provides a limited free tier for now: https://wow.groq.com/now-available-on-groq-the-largest-and-m...
Re:Llama 3.1 Official Launch by duchenne on Tuesday July 23, 2024 @11:32AM (#41047061)
Most SMBs would be able to run it. This is already a huge win for decentralized AI.
Re:Llama 3.1 Official Launch by kingsleyopara on Tuesday July 23, 2024 @11:31AM (#41047056)
You might be able to get away with running a heavily quantizied 405b model using CPU inference at a blistering fast token every 5 seconds on a 7950x.
Re:Llama 3.1 Official Launch by wuschel on Tuesday July 23, 2024 @11:39AM (#41047178)
OK, I am curious now: What kind of hardware would I need to run such a model for a couple of users with decent performance?

Where could I get a mapping of token / time vs hardware?

Re:Llama 3.1 Official Launch by angoragoats on Tuesday July 23, 2024 @12:45PM (#41048124)
Unsure if anyone has specific hardware benchmarks for the 405b model yet, since it's so new, but elsewhere in this thread I outlined a build that'd probably be capable of running a quantized version of Llama 3.1 405b for roughly $10k.

The $10k figure is likely roughly the minimum amount of money/hardware that you'd need to run the model at acceptable speeds, as anything less requires you to compromise heavily on GPU cores (e.g. Tesla P40s also have 24GB of VRAM, for half the price or less, but are much slower than 3090s), or run on the CPU entirely, which I don't think will be viable for this model even with gobs of RAM and CPU cores, just due to its sheer size.

Re:Llama 3.1 Official Launch by bick_nyers on Tuesday July 23, 2024 @02:51PM (#41049482)
Energy costs are an important factor here too. While Quadro cards are much more expensive upfront (higher $/VRAM), they are cheaper over time (lower Watts/Token). Offsetting the energy expense of a 3090/4090/5090 build via solar complicates this calculation but generally speaking can be a "reasonable" way of justifying this much hardware running in a homelab.

I would be curious to see relative failure rates over time of consumer vs Quadro cards as well.

Re:Llama 3.1 Official Launch by angoragoats on Tuesday July 23, 2024 @03:42PM (#41049979)
Agree 100% that energy costs are important. The example system in my other post would consume somewhere around 300W at idle, 24/7, which is 219 kWh per month, and that's assuming you aren't using the machine at all.

I don't have any actual figures to back this up, but my gut tells me that the fact that enterprise GPUs are an order of magnitude (at least) more expensive than, say a, 3090, means that the payback period of them has got to be pretty long. I also wonder whether setting the max power on a 3090 to a lower than default value (as I suggest in my other post) has a significant effect on the average W/token.

Re:Llama 3.1 Official Launch by bick_nyers on Wednesday July 24, 2024 @12:01PM (#41058401)
Agreed, but there are other costs associated with supporting 10-16x GPUs that may not necessarily happen with say 6 GPUs. Having to go from single socket (or Threadripper) to dual socket, PCIE bifurcation, PLX risers, etc.

Not necessarily saying that Quadros are cheaper, just that there's more to the calculation when trying to run 405B size models at home

Re:Llama 3.1 Official Launch by angoragoats on Wednesday July 24, 2024 @03:41PM (#41061067)
The system I outlined in my other post [0] has ten GPUs and does not require dual socket CPUs as far as I'm aware. It could likely scale easily to 14 GPUs as well (assuming you have sufficient power), with an x8/x8 bifurcation adapter installed in each PCIe slot. This is pushing the limits of the PCIe subsystem I'm sure, but you could also likely scale up to 28 GPUs, again assuming sufficient power, by simply bifurcating at x4/x4/x4/x4 vs x8/x8.

I think it should work as-is with the components listed, but if you disagree please let me know!

[0] https://news.ycombinator.com/item?id=41047689

Re:Llama 3.1 Official Launch by lostmsu on Tuesday July 23, 2024 @07:17PM (#41052030)
I don't think this is correct. 5 years power usage of 4090 is $2600 giving TCO of ~$4300. RTX 6000 Ada starts at $6k for the card itself.

https://gpuprices.us

Re:Llama 3.1 Official Launch by bick_nyers on Wednesday July 24, 2024 @01:00PM (#41059158)
To be fair, you need 2x 4090 to match the VRAM capacity of an RTX 6000 Ada. There is also the rest of the system you need to factor into the cost. When running 10-16x 4090s, you may also need to upgrade your electrical wiring to support that load, you may need to spend more on air conditioning, etc.

I'm not necessarily saying that it's obviously better in terms of total cost, just that there are more factors to consider in a system of this size.

If inference is the only thing that is important to someone building this system, then used 3090s in x8 or even x4 bifurcation is probably the way to go. Things become more complicated if you want to add the ability to train/do other ML stuff, as you will really want to try to hit PCIE 4.0 x16 on every single card.

Re:Llama 3.1 Official Launch by lostmsu on Wednesday July 24, 2024 @01:11PM (#41059291)
With 2x 4090 you will have 2x speed of RTX 6000 A. So same energy per token.

Will need more space, true.

Re:Llama 3.1 Official Launch by angoragoats on Wednesday July 24, 2024 @03:42PM (#41061084)
Yeah, after digging more into RTX 6000 Ada cards, I don't see any way they'd be more economical even over many years, no matter how you slice it.
Re:Llama 3.1 Official Launch by danieldk on Tuesday July 23, 2024 @02:57PM (#41049533)
You can run the 4-bit GPTQ/AWQ quantized Llama 405B somewhat reasonably on 4x H100 or A100. You will be somewhat limited in how many tokens you can have in flight between requests and you cannot create CUDA graphs for larger batch sizes. You can run 405B well on 8x H100 and A100, either with the mixed BFloat16/FP8 checkpoint that Meta provided or GPTQ/AWQ-quantized models. Note though that the A100 does not have native support for FP8, but FP8 quantized weights can be used through the GPTQ-Marlin FP8 kernel.

Here are some TGI 405B benchmarks that I did with the different quantized models:

https://x.com/danieldekok/status/1815814357298577718

The 405B model is very useful outside direct use in inference though. E.g. for generating synthetic data for training smaller model:

https://huggingface.co/blog/synthetic-data-save-costs

Re:Llama 3.1 Official Launch by risho on Tuesday July 23, 2024 @05:06PM (#41050863)
how much vram do you need for 4-bit llama 405?
Re:Llama 3.1 Official Launch by zargon on Tuesday July 23, 2024 @09:22PM (#41052772)
405 billion * 4 bits = approximately 200 GB. Plus extra for the amount of context you want.
Re:Llama 3.1 Official Launch by stuckinhell on Tuesday July 23, 2024 @12:53PM (#41048242)
100% reddit is full of people trying to solder more vram
Re:Llama 3.1 Official Launch by gaogao on Tuesday July 23, 2024 @01:43PM (#41048770)
I've been wondering if you could just attach a chunk of vram over NVLink, since that's very roughly what FSDP is doing here anyways.
Re:Llama 3.1 Official Launch by bick_nyers on Tuesday July 23, 2024 @02:59PM (#41049545)
The best NVLINK you can reasonably purchase is for the 3090, which is capped somewhere around 100 Gbit/s. This is too slow. The 3090 has about 1 TB/s memory bandwidth, and the 4090 is even faster, and the 5090 will be even faster.

PCIE 5.0 x16 is 500 Gbit/s if I'm not mistaken, so using RAM is more viable an alternative in this case.

Edit: 3090 has 1 TB/s, not terabits

Re:Llama 3.1 Official Launch by paxys on Tuesday July 23, 2024 @03:03PM (#41049594)
You don't need a model of this scale for personal use. Llama 3.1 8B can easily run on your laptop right now. The 70B model can run on a pair of 4090s.
Re:Llama 3.1 Official Launch by api on Tuesday July 23, 2024 @03:45PM (#41050012)
I have the 70b model running quantized just fine on an M1 Max laptop with 64GiB unified RAM. Performance is fine and so far some Q&A tests are impressive.

This is good enough for a lot of use cases... on a laptop. An expensive laptop, but hardware only gets better and cheaper over time.

Re:Llama 3.1 Official Launch by buu700 on Tuesday July 23, 2024 @04:52PM (#41050684)
I don't have the hardware to confirm this, so I'd take it with a grain of salt, but ChatGPT tells me that a maxed out M3 MacBook Pro with 128 GB RAM should be capable of efficiently running Llama 3.1 405B, albeit with essentially no ability to multitask.

(It also predicted that a MacBook Air in 2030 will be able to do the same, and that for smartphones to do the same might take around 20 years.)

Re:Llama 3.1 Official Launch by hmottestad on Tuesday July 23, 2024 @05:30PM (#41051142)
I’ve run the Falcon 180B on my M3 Max with 128 GB of memory. I think I ran it at 3-bit. Took a long time to load and was incredibly slow at generating text. Even if you could load the Llama 405B model it would be too slow to be of much use.
Re:Llama 3.1 Official Launch by buu700 on Tuesday July 23, 2024 @05:49PM (#41051318)
Ah, that's a shame to hear. FWIW, ChatGPT did also suggest that there was a lot of room for improvement in the MPS backend of PyTorch that would likely make it more efficient on Apple hardware in time.
Re:Llama 3.1 Official Launch by nl on Tuesday July 23, 2024 @07:51PM (#41052274)
Most "local model runners" (Llama.CPP, Llama-file etc) don't use Pytorch and instead implement the neural network directly themselves optimized for whatever hardware they are supporting.

For example here's the list of backends for Llama.cpp: https://github.com/ggerganov/llama.cpp?tab=readme-ov-file#su...

Re:Llama 3.1 Official Launch by buu700 on Tuesday July 23, 2024 @08:10PM (#41052380)
Ah okay, interesting, thanks.
Re:Llama 3.1 Official Launch by Klaus23 on Tuesday July 23, 2024 @06:39PM (#41051757)
You fundamentally misunderstand the bottleneck of large LLMs. It is not really possible to make gains that way.

A 405B LLM has 405 billion parameters. If you run it at full "prescision", each parameter takes up 2 bytes, which means you need 810GB of memory. If it does not fit in RAM or GPU memory it will swap to disc and be unusably slow.

You can run the model at reduced prescision to save memory, called quantisation, but this will degrade the quality of the response. The exact amount of degradation depends on the task, the specific model and its size. Larger models seem to suffer slightly less. 1 byte per parameter is pretty much as good as full precision. 4 bits per parameter is still good quality, 3 bits is noticeably worse and 2 bits is often bad to unusable.

With 128GB of RAM, zero overhead and a 405B model, you would have to quantize to about 2.5 bits, which would noticeably degrade the response quality.

There is also model pruning, which removes parameters completely, but this is much more experimental than quantisation, also degrades response quality, and I have not seen it used that widely.

Re:Llama 3.1 Official Launch by buu700 on Tuesday July 23, 2024 @07:04PM (#41051939)
I appreciate the additional information, but I'm not sure what you're claiming is a fundamental misunderstanding on my part. I was referring to running the model with quantization, and was clear that I hadn't verified the accuracy of the claims.

The comment about the MPS PyTorch backend was related to performance, not whether the model would fit at all. I can't say whether it's accurate that the MPS backend has significant room for optimization, but it is still publicly listed as in beta.

Re:Llama 3.1 Official Launch by Klaus23 on Tuesday July 23, 2024 @07:41PM (#41052202)
Yes my mistake, I read your answer to mean that you think that the model could fit into the memory with the help of efficiency gains.

I would be sceptical about increasing efficiency. I'm not that familiar with the subject, but as far as I know, LLMs for single users (i.e. with batch size 1) are practically always limited by the memory bandwidth. The whole LLM (if it is monolytic) has to be completely loaded from memory once for each new token (which is about 4 characters). With 400GB per second memory bandwidth and 4-bit quantisation, you are limited to 2 tokens per second, no matter how efficiently the software works. This is not unusable, but still quite slow compared to online services.

Re:Llama 3.1 Official Launch by buu700 on Tuesday July 23, 2024 @07:50PM (#41052264)
Got it, thanks, that makes sense. I was aware that memory was the primary bottleneck, but wasn't clear on the specifics of how model sizes mapped to memory requirements or the exact implications of quantization in practice. It sounds like we're pretty far from a model of this size running on any halfway common consumer hardware in a useful way, even if some high-end hardware might technically be able to initialize it in one form or another.
Re:Llama 3.1 Official Launch by Klaus23 on Tuesday July 23, 2024 @09:18PM (#41052747)
GPU memory costs about $2.5/GB on the spot market, so that is $500 for 200GB. I would speculate that it might be possible to build such a LLM card for $1-2k, but I suspect that the market for running larger LLMs locally is just too small to consider, especially now that the datacentre is so lucrative.

Maybe we'll get really good LLMs on local hardware when the hype has died down a bit, memory is cheaper and the models are more efficient.

Re:Llama 3.1 Official Launch by diffeomorphism on Wednesday July 24, 2024 @04:21AM (#41054766)
Just for reference, the current version of that laptop costs 4800€ (14 inch macbook pro, m3 max, 64gb of ram, 1TB of storage). So price-wise that is more like four laptops.
Re:Llama 3.1 Official Launch by evilduck on Wednesday July 24, 2024 @11:59AM (#41058386)
I think they were referring to the form factor not the price. But even then the price of four laptops is not out of line for enthusiast hobby spending.

Ever priced out a four wheeler, a jet-ski, a filled gun safe, what a "car guy" loses in trade in values every two years, what a hobbyist day-trader is losing before they cut their losses or turn it around, or what a parent who lives vicariously through their child and drags them all over their nearby states for overnight trips so they can do football/soccer/ballet/whatever at 6am on Saturdays against all the other kids who also won't become pro athletes? What about the cost of a wingsuit or getting your pilots license? "Cruisers" or annual-Disney vacationers? If you bought a used CNC machine from a machine shop? But spend five grand on a laptop to play with LLMs and everyone gets real judgmental.

Re:Llama 3.1 Official Launch by karolist on Wednesday July 24, 2024 @11:39AM (#41058163)
I have the same machine, may I ask which model file and program are you using? Is it partial GPU offload?
Re:Llama 3.1 Official Launch by Aurornis on Tuesday July 23, 2024 @05:34PM (#41051177)
> sorta defeats the purpose of opensource to some extent

Not in the slightest. They even have a table of cloud providers where you can host the 405B model and the associated cost to do so on their website: https://llama.meta.com/ (Scroll down)

"Open Source" doesn't mean "You can run this on consumer hardware". It just means that it's open source. They also released 8B and 70B models for people to use on consumer gear.

Re:Llama 3.1 Official Launch by diego_sandoval on Tuesday July 23, 2024 @06:57PM (#41051880)
The fact that it takes $20k to run your own SOTA model, instead of the $2B+ that it took until yesterday, is significant.
Re:Llama 3.1 Official Launch by lostmsu on Tuesday July 23, 2024 @07:12PM (#41051994)
You can probably run it on your local PC at 1 token/minute.