ChatGPT Hardware: A look at 8x NVIDIA A100 powering the tool
servethehome.com
servethehome.com
nVidia’s top management did amazing job with their strategy. They have spent decades, and millions of dollars, developing and promoting CUDA. Now this motivates people to spend that amount of money on nVidia’s hardware.
I don’t believe the trend continues for ML inference, at least not for long. Unlike traditional HPC stuff like FEM or fluid dynamics, the GPU code of ML inference is not that complicated. The complexity is limited to the data being processed, these ML models.
It’s not terribly hard to port the inference to other hardware architecture or software stack, reusing the models. I think it’s only a matter of time until AI companies like OpenAI will start porting their code from CUDA to VulkanCompute or some other vendor-agnostic stack, to avoid buying or renting such $100k computers. Don’t get me wrong, these computers are awesome, just very expensive.
For training, yeah. But at least in some cases, inference can be optimized to use less memory.
For their large Whisper model, OpenAI says they need 10GB of VRAM: https://github.com/openai/whisper#available-models-and-langu...
My DirectCompute port of that uses slightly over 4GB of VRAM, see the last column in that table: https://github.com/Const-me/Whisper/blob/master/SampleClips/... I haven’t actually optimized memory usage I only did the DirectCompute port, the memory savings were achieved by Georgi Gerganov in whisper.cpp project, which I ported to Windows.
https://nlpcloud.com/gpt-3-open-source-alternatives-gpt-j-gp...
though TBH just making cards with more RAM to fit these kind of models seems easier than being at absolute cutting edge of performance
I also wonder how this metric translates to something like Apple Silicon 'unified memory'... latest MBP have 32GB RAM, I wonder if anyone managed to run GPT-J there yet?
https://github.com/ggerganov/ggml/tree/master/examples/gpt-j
it's CPU-only and runs inference at "about ~6 words per second" on an M1 MBP
These models are obviously nerfed, but you can run them on budget ARM hardware and get legible, paragraph-length responses in less than 10 seconds.
Thank you for your work.
For the A100, A6000s, and H100s you are paying for the memory and the upcharge for being a server card. AMD isn't really competing in this space, but they are moving in that direction if you look at the exascale machines[0,1]
[0] https://www.top500.org/system/180047/
[1] https://www.amd.com/en/products/server-accelerators/instinct...
How much time is saved?
If you've got a 12GB card at 5x speed vs. a 96GB card at 1x speed (so 5x slower), is the former still competitive? How much faster does the 12GB card need to be to get the same quality results with less memory (and smaller batches)?
What if the faster card has 24GB of memory?
a larger Batch size can help keep the gpu fed but usually that’s not a problem with these larger models.
In classification batch is going to help a ton (including stability) and you may not even get top results without a high batch, so infinite in that case. More realistically, consider that batch also helps with GPU I/O. I/O slows things down quite a lot, so if you're moving stuff in and out of the accelerator a lot then you can easily be I/O bound.
For generation the conversation gets more complicated. For GANs the smaller card could do better if you can fit a proper batch size there (probably not tbh but often closer to 16 or 24 so that may be better here). Here distributed tends to help more. For VAEs, Diffusion, Autoregressive, etc are more stable and can also hugely benefit from large batches.
So the truth is an unsatisfying "it depends." I know that may not be the answer you're looking for, but it is the real one. It takes a lot of work and tricks to scale (as anyone working in non-ML HPC will tell you very similar stories about scaling). But also note that the clock speeds aren't as big of a gap as you note though the memory gaps are.
This software is mostly supplied by vendor, and it mostly cares about vendor's tech, and will usually require special features exposed by the hardware, so, won't work with consumer-grade GPUs.
Between the two mentioned cards, though, it really does come down to performance. The cards are simply not interchangeable for large scale model training.
That smaller task is way more manageable. It shouldn’t take a decade, maybe a month or two. Vulkan ain’t some new tech, the API arrived years ago and is widely used by game developers.
Thanks to Valve work on DXVK 2.0, there’s even an implementation of MS DirectCompute GPU API over Vulkan on Linux. I’m not saying doing that is necessarily the best approach for the job, just one of the many options.
https://www.techpowerup.com/gpu-specs/h100-sxm5-96-gb.c3974
With the MI300, which has 128GB and more compute power (at least on paper):
https://www.techpowerup.com/gpu-specs/radeon-instinct-mi300....
A100 can be compared with MI250, perhaps. It also has 128GB.
https://www.servethehome.com/microsoft-azure-at-sc22-and-the...
Sounds like a job for AI. Universal translator and all that.
You could say that about some of nvidia's other GPUs too. A better comparison would be AMD's server offerings, which are priced comparably.
> Unlike traditional HPC stuff like FEM or fluid dynamics, the GPU code of ML inference is not that complicated.
It's complicated enough relative to the problem ML people are trying to solve. That's why in ML, all these tools have emerged specifically to let practitioners not care about the GPU code. People writing pytorch code don't want to think about CUDA vs vulkan at all. It's more of a question for the people writing the foundational libraries like pytorch.
I sincerely hope that tools like openai's triton make it easier to support a variety of GPUs.
Technically, yes. Practically, nVidia forbids to deploy their other GPUs in data centers, in the EULA of their drivers: https://www.datacenterdynamics.com/en/news/nvidia-updates-ge...
May or may not be enforceable, probably depends on jurisdiction, but I’m pretty sure that EULA gonna scare some people.
> People writing pytorch code don't want to think about CUDA vs vulkan at all.
Well, there’re also other people. OpenAI’s CEO doesn’t necessarily write pytorch code, but he described the compute costs of ChatGPT as “eye-watering”.
> I sincerely hope that tools like openai's triton make it easier to support a variety of GPUs.
I’ll believe it when I see it. Performance portability across GPU architectures ain’t trivial. For instance, in my Whisper implementation, the most expensive compute shader is the one which computes product of 2 matrices.
nVidia version: https://github.com/Const-me/Whisper/blob/master/ComputeShade...
AMD version: https://github.com/Const-me/Whisper/blob/master/ComputeShade...
These two compute shaders have little in common, they even use different memory layout for the arguments, despite both compute shaders are doing the same math.
What we would like to do is what has usually been done with the cache hierarchy where you bring the data as needed to the GPU. As this would allow to only need a lot less memory, as we could stream parameters from RAM or disk as needed.
But there is a bottleneck at the pcie interface ( 32GB/s for pcie 4.0x16 ), and you can't feed the GPU fast enough. Which means you can't leverage cheap memory directly.
30 years ago, there was a consensus x86 architecture was only good for small computers, while servers need faster specially-designed processors like IBM Power or Dec Alpha. Then AMD64 was introduced, after a while they took server market too.
15 years ago, Intel was making specialized HPC co-processors called Xeon Phi. The chips were actually good, exceeded 1 TFlop of FP64, and weren’t terribly hard to program. I think it were consumer-grade graphic cards which made it obsolete. Despite much harder to program, the raw performance numbers were better, and cost efficiency in flops/$ was an order of magnitude better.
I wonder how long it'll be until A100's depreciate that amount.
I see articles from "Serve The Home" pop up now often and I've yet to see one discussing hardware that I've ever come across in... someone's home.
We do have some content for homes. Check out our TinyMiniMicro series as an example.
I have never (until reading this) thought of it in that context. Was that the original meaning for the name, or did it shift over time?
I always get confused by why folks ask why we have server content. The Wall Street Journal covers more than just one road in NYC.
It's probably possible to engineer a home-scale inferencing network like that, but I've had plenty of success just running GPT-Neo on off-the-shelf ARM chips. It's not worth the extra $800, exploding power bill and engineering effort to get diminishing returns.
I do also look at various benchmarks and comparisons over and over because I would like to build a home gpu server for some machine learning fun and I find it interesting that the TFLOPS/$ numbers always come out very much linear... A card that gives 2x performance costs 2x more.... if cards depreciate 50%, it's because new cards have been launched that have double performance for the same price... etc... Even simpler, the CUDA cores-per-dollar is pretty much a constant.
What isn't taken into account there is various optimizations new cards have that speed up training or inference, like better use of the tensor cores. At some point incompatibility with newer CUDA compute levels makes the older cards much less useable.
Faster, cheaper, crippled by AMDs poor software support.
You're just not visiting the right homes ...
They even have community fiber! https://www.chelanpud.org/my-pud-services/residential-servic...
I think I have DiffusionBee installed but I haven't updated it for months
Doubtful. As an example, OpenAI released Triton, a programming language explicitly for optimizing models. For the scale they're at they'd be crazy not to throw an engineer or two at optimizing the models they're going to send to production.
I would bet that we can do better than GPT3 with less computing resources but that would need a different model architecture.
Our brains outperform GPT-3 with only 30w of power. The potential for software optimization may be many orders of magnitude.
Has anyone done benchmarks to show what the tradeoff calculations are for various use cases?
You can watch this LTT video to get an idea: https://youtu.be/zBAxiQi2nPc
Probably if you run them full time in a enterprise environment the power consumption will be the bulk of your cost?
There is no such thing, you either use multiple RTX GPU cards and 'bend' them for ML training, or you buy A100 40GB at about 125K or A100 80GB at about 250K, which is far beyond my budget.
Google's TPU could be used to assist ML training, but then it does not have the CUDA ecosystem for software, plus, it kept its new TPU for inhouse use only as far as I can tell.
AWS ML EC2 are very expensive to me which is why I want to build one for mid-sized ML trainings.
With all of that said, you are 100% right that many startups have used consumer cards for years. For example, Andrej Karpathy talked about how our DeepLearning11 build (8x 1080 Ti's) had a ~3 month payback period versus AWS https://twitter.com/karpathy/status/924340245478256640
In 2017. Currently you can rent 8xA100 server for $8.8/hr: https://lambdalabs.com/service/gpu-cloud
At this price the payback stretches to about 3 years (taking into account average energy costs in US, and assuming 24/7 operation for the whole 3 years).
The 80GB A100's will run you $12.0/hr for 8 of them.
How do I justify the purchase of DGX-1 as a hobby programmer? Call it my mid-life crisis purchase? I mean, its not that much more than a mid-range 2023 Corvette Stingray.
[0] https://timdettmers.com/2023/01/30/which-gpu-for-deep-learni...
As others have pointed out, vRAM is the killer here. this big of a machine is mostly for vRAM coherence, which is a specific usecase.
For almost every other type of job lots of single GPUs with shared disk storage will do (particle sim, rendering, oil and gas, etc.)
But in recent years Nvidia has added harder gating in between their products, the biggest being SLI or NVLink support reduced starting with Pascal and now entirely dropped in the latest Ada Lovelace generation. Effectively forcing you to buy the professional chips.
A different angle - how long before Google, Microsoft, and Amazon design and deploy their own "GPUs" instead of buying from Nvidia? They've all started with their own ARM SOCs so surely it's inevitable.
But you might be right, chatGPT is insanely popular right now.
https://news.microsoft.com/source/features/ai/openai-azure-s...
Also the successor H100 is already released and at least 2x as powerful.
Checks eBay for used A100s...will not be getting one soon. :-)
not sure how many concurrent users that could support, but I'd imagine the public service has a whole bunch of these racks
from what I read... GPT-J at 6B params is too big to load on any consumer GPU (needs ~25GB)
and then GPT-3 is 175B params or ~29x larger, so maybe needing 7-800GB RAM
8x 80GB A100s would give 640GB RAM, so its approx the right ballpark
You can load that on M1/M2 Macs, which have unified GPU memory up to 128GB.
https://news.microsoft.com/source/features/ai/openai-azure-s...
https://www.zdnet.com/article/microsoft-builds-a-supercomput...
On the other hand, we're not counting energy saved by people using it.. What if some scientist uses it and ends up solving fusion power? Or, say, making copywriters and programmers redundant (who I assume would go on to become subsistence farmers) - many energy savings to be had!
Not what heatsinks do.