News for hackers. Stuff that matters.
Re:Running large language models like ChatGPT on a single GPU by muttled on Monday February 20, 2023 @01:08PM (#34870839)
This is cool! But I wonder if it's economical using cloud hardware. The author claims 1.12 tokens/second on the 175B parameter model (arguably comparable to GPT-3 Davinci). That's about 100k tokens a day on the GCP machine the author used. Someone double check my numbers here, but given the Davinci base cost of $0.02 per 1k tokens and GCP cost for the hardware listed "NVIIDA T4 (16GB) instance on GCP with 208GB of DRAM and 1.5TB of SSD" coming up to about $434 on spot instance pricing, you could simply use the OpenAI API and generate about 723k tokens a day for the same price as running the spot instance (which could go offline at any point due to it being a spot instance).

Running the fine-tuned versions of OpenAI models are approximately 6x more expensive per token. If you were running a fine-tuned model on local commodity hardware, the economies would start to tilt in favor of doing something like this if the load was predictable and relatively constant.

Re:Running large language models like ChatGPT on a single GPU by breckenedge on Monday February 20, 2023 @01:35PM (#34871146)
Thanks for running the cloud numbers on this. I ran some DIY numbers and they indicate less than a week to break even with the cloud, including all hardware and electricity costs. The cloud seems stupid expensive compared to running your own hardware for this kind of task.
Re:Running large language models like ChatGPT on a single GPU by throwawayapples on Monday February 20, 2023 @03:06PM (#34872251)
The cloud is always stupid expensive compared to running your own hardware for almost any sort of task that isn't highly variable upon one or more axis (cpu, ram, etc), but less than a week to break even is truly shocking.
Re:Running large language models like ChatGPT on a single GPU by p1esk on Monday February 20, 2023 @04:37PM (#34873262)
The cloud has been cheaper to train large models for a couple years now. Compare buying 8xA100 server vs renting one on Lambda Labs. At least 3 years to break even - if you are using it non-stop 24/7. Longer if not.
Re:Running large language models like ChatGPT on a single GPU by cardine on Monday February 20, 2023 @04:51PM (#34873437)
This is not true - the break even period is closer to 6-7 months.
Re:Running large language models like ChatGPT on a single GPU by p1esk on Monday February 20, 2023 @05:05PM (#34873578)
A single 8xA100 server is ~150k. On demand cost to rent it is $8.8/hour. Do the math and don't forget the energy costs.
Re:Running large language models like ChatGPT on a single GPU by cardine on Monday February 20, 2023 @06:20PM (#34874236)
I'd suggest finding a cheaper vendor if that is the lowest price you can get for an 8xA100 server. We spend a lot on both and colo our servers so I've definitely done the math!
Re:Running large language models like ChatGPT on a single GPU by p1esk on Monday February 20, 2023 @06:38PM (#34874393)
Six months ago I've contacted 12 different vendors, the quotes for four 8xA100 servers ranged from 130k to 200k each. You probably wouldn't want to buy from the low end vendors.

Keep in mind, there are three important advantages of cloud:

1. You only pay for what you use (hourly). What is utilization of your on-prem servers?

2. You don't have to pay upfront - easier to ask for budget

3. You can upgrade your hardware easily as soon as new GPU models become available.

Re:Running large language models like ChatGPT on a single GPU by cardine on Monday February 20, 2023 @07:58PM (#34875082)
I know how much we paid and it is substantially less than what you were quoted - very likely from one of the 12 providers you contacted.

It is likely you just didn't realize how much margin these providers have and did not negotiate enough. How else do you think cloud providers are able to afford the rates they are giving? The way you describe it, places like Coreweave are operating as a charity. That isn't true - they just got better prices than you.

Our inference setup is 7 figures, has been running for a while (with new servers purchased frequently along the way) and there have been no issues - the cards, CPU, RAM, are all top of the line server hardware.

1. For inference (which is 80%+ of our need) our utilization is 100% 24/7/365. For stuff that is variable (like training) we often do use cloud - as I mentioned we do both.

2. I am the CEO so I am not sure who I'm asking for budget?

3. At this point we would have paid more for cloud than what we spent purchasing our own hardware. There is nothing stopping us from getting new hardware or cloud with newer cards while still getting to own our current hardware. In fact since our costs over the last year were lower due to us buying our own hardware it is actually easier for us to afford newer cards.

Re:Running large language models like ChatGPT on a single GPU by p1esk on Monday February 20, 2023 @10:27PM (#34876115)
Yes, obviously cloud providers get their hardware at a fraction of a cost I'm quoted, they are ordering thousands of servers. I was only buying four. No one would negotiate with me, I tried. I suppose if I had a 7 digit budget I could get a better deal.

I was mainly talking about training workloads, inference is a different beast. I'm actually surprised you have 100% inference utilization - customer load typically scales dynamically, so with on-prem servers you would need to over-provision.

CEOs don't usually order hardware, they have IT people for that, with input from people like me (ML engineers) who could estimate the workloads, future needs, and specific hw requirements (e.g. GPU memory). And when your people come to you asking for budget, while you're trying to raise the next round, you're more likely to approve the 'no high upfront cost' option, right?

In my situation, when asked about buy vs rent my initial reaction was "definitely buy", but when I actually looked at the numbers, the 3 years break even period, no upfront costs for cloud, and no need to provision storage and networking, made it an easy recommendation. The cost of cloud GPUs has come down dramatically in the last couple of years.

Though I would like to have at least a couple of local GPU servers for quick experimentation/prototyping, because sometimes the overhead of spinning up a new instance and copying datasets is too great relative to the task.

Re:Running large language models like ChatGPT on a single GPU by cardine on Tuesday February 21, 2023 @08:47AM (#34881045)
> I suppose if I had a 7 digit budget I could get a better deal.

We got our "deal" when buying just a single server and have since bought many more with the same provider. We didn't spend 7 figures all at once, we did it piece-meal over time. There is nothing stopping you from getting much better prices.

> I'm actually surprised you have 100% inference utilization - customer load typically scales dynamically, so with on-prem servers you would need to over-provision.

It is pretty easy to achieve 100% inference utilization if you can find inference work that does not need to be done on-demand. We have a priority queue and the lower priority work gets done during periods with lower demand.

> CEOs don't usually order hardware, they have IT people for that, with input from people like me (ML engineers) who could estimate the workloads, future needs, and specific hw requirements (e.g. GPU memory).

Judging by this conversation it seems like "people like you" may not be the best people to answer this question since the best hardware quote you could get was at a >100% markup! At a startup that specializes in ML research and work the CEO is going to be intimately familiar with ML workloads, needs, and hardware requirements.

> And when your people come to you asking for budget, while you're trying to raise the next round, you're more likely to approve the 'no high upfront cost' option, right?

If the break even point is 6-7 months and our runway is longer than 6-7 months why would this matter?

Re:Running large language models like ChatGPT on a single GPU by p1esk on Tuesday February 21, 2023 @10:29AM (#34882204)
the best hardware quote you could get was at a >100% markup!

Now I’m really curious - if you can share - how much did you pay, and when was it? Are you talking about 40GB or 80GB cards? How did you negotiate? Any attempts I made were shut down with simple “no, that’s our final price”. What’s the secret?

At a startup that specializes in ML research and work the CEO is going to be intimately familiar with ML workloads, needs, and hardware requirements.

I work at a startup which builds hardware accelerators, primarily for large NLP models. It’s a large part of my job is to be intimately familiar with ML workloads, needs, and hardware requirements. Our CEO definitely doesn’t have enough of that knowledge to choose the right hardware for our ML team. In fact even most people on our ML team don’t have deep up to date knowledge about GPUs, GPU servers, or GPU server clusters. I happen to know because I always had interest in hardware and I’ve been building GPU clusters since grad school.

Re:Running large language models like ChatGPT on a single GPU by cardine on Wednesday February 22, 2023 @05:17PM (#34903757)
As mentioned in another comment, the contract has very clear language not to share it - likely because they are offering different prices to different companies.

So I don't feel comfortable sharing any specifics, especially since this account is directly tied to my name.

With that being said, the negotiation process was pretty straightforward: - Emailed several vendors telling them we are a small startup, we are looking to make many purchases, but right now we are starting with one. We told everyone our purchasing decision was solely based on cost (given equivalent hardware) and to please put your best quote forward.

- Got back all of our prices. Went to the second cheapest one and told them they were beat and offered them the ability to go lower, which they did. We went with that vendor.

- For our next purchase, we went to the original lowest vendor (who got beat out), told them they lost out to price, and if they can go lower than that we would go with them and continue to give them business moving forward. They went quite a bit lower than what they originally offered, and what the vendor we first purchased from gave. We bought our second order from them and have used them ever since.

Re:Running large language models like ChatGPT on a single GPU by lostmsu on Tuesday February 21, 2023 @06:39PM (#34889368)
> We got our "deal" when buying just a single server and have since bought many more with the same provider. We didn't spend 7 figures all at once, we did it piece-meal over time. There is nothing stopping you from getting much better prices.

If it is as easy as you make it sound, why would you not just share the vendor name? I personally would love an 8xH100 machine for transformer experiments, but $100k+ pricing makes it a non-starter.

Re:Running large language models like ChatGPT on a single GPU by p1esk on Tuesday February 21, 2023 @10:36PM (#34891317)
8xH100 machine is ~300k I’ve heard.
Re:Running large language models like ChatGPT on a single GPU by lostmsu on Tuesday February 21, 2023 @11:07PM (#34891501)
Well, the person above claims 8xA100 significantly under $130k. I am curious to hear more.
Re:Running large language models like ChatGPT on a single GPU by p1esk on Wednesday February 22, 2023 @12:51AM (#34892140)
Sure, but you mentioned H100 machine, and those are about 2.5x more expensive.
Re:Running large language models like ChatGPT on a single GPU by cardine on Wednesday February 22, 2023 @05:13PM (#34903695)
The contract has very clear language not to share it - likely because they are offering different prices to different companies.

(And as p1esk mentioned, there is no way you are getting H100s for under $100k).

Re:Running large language models like ChatGPT on a single GPU by cypress66 on Monday February 20, 2023 @01:19PM (#34870956)
This is most likely aimed at people running models locally.

And a homelab with 3090s/4090s is one or two orders of magnitude cheaper than GCP, if you use them continuously.

Re:Running large language models like ChatGPT on a single GPU by SomeHacker44 on Monday February 20, 2023 @03:12PM (#34872308)
I do not know anyone offhand with a 200+GB RAM home computer. The GPU is not all that is needed; you need to keep the parameters and other stuff in memory too.
Re:Running large language models like ChatGPT on a single GPU by Filligree on Monday February 20, 2023 @03:21PM (#34872410)
Running it off a fast NVMe apparently works. I don't know what the performance is like, though.
Re:Running large language models like ChatGPT on a single GPU by zargon on Monday February 20, 2023 @04:02PM (#34872868)
256gb of ddr4 rdimms only costs about $400 right now. $200 for ddr3. Not uncommon in homelabs.

I don't think 200gb ram is actually required, that's just what that cloud vm was spec'd with. Though the 175b model should see benefit with ram even beyond 200gb.

Re:Running large language models like ChatGPT on a single GPU by woadwarrior01 on Monday February 20, 2023 @05:59PM (#34874062)
I own a two year old headless home computer with 256GB of RAM and two 3090s. I ssh into it from my mac to run ML training jobs.
Re:Running large language models like ChatGPT on a single GPU by hedgehog0 on Tuesday February 21, 2023 @06:18AM (#34879683)
What’s the price may I ask
Re:Running large language models like ChatGPT on a single GPU by alex_sf on Tuesday February 21, 2023 @12:11PM (#34883656)
I have a similar setup. GPUs were $1.6k US, rest of the system was another ~$1k. This includes 256GB RAM and dual Xeons.
Re:Running large language models like ChatGPT on a single GPU by zac_hudson on Tuesday February 21, 2023 @04:41PM (#34887863)
I bought an old server from ebay, and ripped the guts out to make a desktop computer. 128GB of ddr3 ram and 48 E5 v2 xeons for 300$.
Re:Running large language models like ChatGPT on a single GPU by swatcoder on Monday February 20, 2023 @01:18PM (#34870935)
Sometimes control is more important than cost.
Re:Running large language models like ChatGPT on a single GPU by pclmulqdq on Monday February 20, 2023 @01:27PM (#34871059)
Cloud accelerators carry a huge price premium because there aren't very many of them available and they aren't as fungible as CPUs. Comparing to a local GPU would likely be favorable for the local machine.
Re:Running large language models like ChatGPT on a single GPU by ImprobableTruth on Monday February 20, 2023 @01:59PM (#34871458)
You've made one huge mistake: Davinci's $0.02 is not just per 1k tokens generated but also context tokens consumed. So if you generate 50 tokens per request with 1k context, the price is actually 20 times as large at $0.40 per 1k tokens generated - much less palatable, costing 3 times as much as the cloud hosted version of this.

And that's not even taking into account the gigantic markup cloud services have.

Re:Running large language models like ChatGPT on a single GPU by yorwba on Monday February 20, 2023 @02:33PM (#34871878)
Most of the computational cost of producing an output token is spent on consuming input tokens (including previous output tokens that are fed back in); only the final unembedding matrix could be eliminated if you don't care about the output logits for the context.

So it's not correct to only modify OpenAI's prices to account for the ratio of context tokens to output tokens. Both of them get multiplied by 20 (if that's what your ratio is).

Re:Running large language models like ChatGPT on a single GPU by ImprobableTruth on Monday February 20, 2023 @02:49PM (#34872057)
No, because they're already taking that into account.

>Metric: generation throughput (token/s) = number of the generated tokens / (time for processing prompts + time for generation).

(Though they're doing batching, so this is an unfair comparison. Would be interesting to get single batch speed.)

Re:Running large language models like ChatGPT on a single GPU by borzunov on Monday February 20, 2023 @08:04PM (#34875143)
I'm afraid that, unlike proprietary APIs and Petals, this system can't be used for single-batch inference of 175B models with interactive speeds - the thing you actually need for running ChatGPT and other interactive LM apps. See https://news.ycombinator.com/item?id=34874976