News for hackers. Stuff that matters.
Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by fancyfredbot on Saturday June 29, 2024 @05:48AM (#40829033)
Can someone knowledgeable please put these numbers in context with a comparison to an H100? For example they say 1053 tokens per second throughput with batch size 4 on llama2 70b. Is that good?
Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by qeternity on Saturday June 29, 2024 @06:07AM (#40829107)
Where do you see 1053 t/s for L2 70b?

From their benchmark table, they achieve 1.8s response time at bs=4 for 256 output tokens, which would be 569 t/s throughput.

At bs=1 you are memory bandwidth bound. So as a simple ceiling we divide the memory bandwidth by the model size (70b is roughly 140gb at fp16). That would yield roughly 24 t/s for H100 and 39 t/s for MI300x.

I'm not really sure how GEMM optimizations alone would yield these sort of improvements at fp16. With quantization, where dequant overheads start to become compute bound, or at very high batch sizes, it makes sense and there has been a lot of work with various kernels in this area. But I'm a bit confused at fp16 and bs=1.

Maybe someone smarter can chime in?

EDIT: Ok I watched their video, which shows 39.75 t/s in the unoptimized (which checks out given the above rough maths) and 313.95 t/s for the optimized. I'm not really sure what's going on here.

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by fancyfredbot on Saturday June 29, 2024 @06:50AM (#40829304)
I found 1053 t/s in cell G18 in the throughput tab of the full results sheet they linked to: https://docs.google.com/spreadsheets/u/0/d/1hHd9riWh-hQJnNOz...
Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by qeternity on Saturday June 29, 2024 @07:14AM (#40829470)
Hmm the post now links to this doc where I got my figures from: https://docs.google.com/spreadsheets/d/1hHd9riWh-hQJnNOzEI_Z...

This sheet only lists the response latency, but it does look more recent than the one you listed.

In any event, the sheet you link to shows generation speed and throughput (generation speed is cell E18 which shows 527 t/s). G18 is perhaps prefill + gen but even that doesn't add up.

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by fancyfredbot on Saturday June 29, 2024 @02:14PM (#40832455)
I noticed column G is always 2x column E. So I think they are counting both input and output tokens in the throughput for G but not for E.

There's only one Google doc and you are linking to the same one I mentioned and the same one in the article... Not sure why you only see latency - there's definitely a throughput tab too.

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by qeternity on Saturday June 29, 2024 @02:17PM (#40832469)
It's not though, it's close, but it's not.

E18 is 527.75. 2 * 527.75 = 1055.5.

G18 is 1053.16.

So yeah, I have no idea.

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by Lindon4290 on Saturday June 29, 2024 @10:08AM (#40830715)
Right. On that track, I want to confirm something. Maybe I am doing my math wrong or don't understand how transformers work.

There is a video about the bs=1 case, i.e. a single prompt with input 256 tokens and output 256 tokens with a Llama-2 70B model, on a single MI300X (no tensor parallelism). The optimized result is giving 314 t/s and completes the entire request in 1.63s.

Now, the Llama-2 70B is a an autoregressive decoded-only model. So, that means the entire model weights are processed for every generated token.

The model weights are 128.48 GB (also shown in the video, and can be confirmed from HuggingFace). The card has 192GB of HBM, and the model entirely fits on the card. The HBM memory bandwidth for this card is 5.3 TB/s.

Even assuming the prompt 256 tokens took no time, to generate 256 tokens, we'd need roughly 6s even at ideal memory bandwidth. (256 * 128.48e9) / (5.3e12).

What's going on here?

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by latchkey on Saturday June 29, 2024 @10:23AM (#40830827)
https://chipsandcheese.com/2024/06/25/testing-amds-giant-mi3...

Take that article and increase it by the gemm gains.

At the end of the day, MI300x is outperforming an H100.

More importantly is that you need 2xH100 to do 70B and only 1xMI300x.

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by Lindon4290 on Saturday June 29, 2024 @10:28AM (#40830873)
Going by the results from the article/video, a single MI300X is even outperforming a Groq system [1]

The video shows that the optimized run with Llama-2 70B gives 314 tokens/s for a bs=1 with 256 prompt + 256 generation. The Groq system is also a bs=1 apparatus and gets you around 300 tokens/s. Wild!

[1] https://wow.groq.com/groq-sets-new-large-language-model-perf...

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by latchkey on Saturday June 29, 2024 @10:35AM (#40830921)
Someone else on reddit [0] noticed this as well.

Groq does not talk about how many cards they need to get those results. Someone replied to me with this comment [1] a while ago...

[0] https://www.reddit.com/r/AMD_MI300/comments/1dqhrbn/comment/...

[1] https://news.ycombinator.com/item?id=39966620

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by Lindon4290 on Saturday June 29, 2024 @10:47AM (#40831002)
Yeah, the rumours(?) are a groq system required to produce 300+ t/s on a Llama-2 70B (bs=1) requires 576 chips (9 racks) [1]

So, that's like $10M+ for serving bs=1 Llama-2 70B vs whatever a single MI300X costs?

[1] https://twitter.com/swyx/status/1759759125314146699

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by latchkey on Saturday June 29, 2024 @11:16AM (#40831174)
The exact cost of a mi300x is closely guarded by amd. I buy them and do not know how much they are. That said a whole chassis of 8x is far far far less than 10m.
Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by Lindon4290 on Saturday June 29, 2024 @12:21PM (#40831632)
You should make a whole post about this! Like how a single MI300X outperforms groq at bs=1.

300 tokens/s with bs=1 for a llama-2 70B on a single card is no joke.

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by latchkey on Saturday June 29, 2024 @02:45PM (#40832605)
This is why I sponsored doing the chipsandcheese tests on my hardware. That instigated Elio to up the game even further.

All open source by the way.

Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by fancyfredbot on Monday July 01, 2024 @04:26PM (#40850275)
Thank you for sponsoring this. There's so little buzz about this hardware despite the fact it's clearly amazing for AI use cases. I don't understand why not. Maybe this is why Nvidia is the most valuable company in the world - nobody can be bothered to try a competitor.
Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by fancyfredbot on Saturday June 29, 2024 @02:09PM (#40832425)
I can't square the numbers in the two articles at all. Other sources seem closer to their optimised results than their unoptimised results:

  llama3-70b throughput:
   Chips and Cheese: 4800 tok/sec (?!)
   This article:  849 tok/sec (fastest optimized)

  Mixtral 7B latency:
    Chips and cheese: 1.17s
    This article: 2.04s (fastest unoptimised) / 0.81 (fastest optimised)

  And then finally comparing mixtral 8x7b to the Reddit article using batch size 1...

  Reddit: 157 tok/sec
  This article: 165 tok/sec (optimized) or 141 tok/sec (unoptimised)
Re:AMD MI300x GPUs with GEMM tuning improves throughput and ... by fancyfredbot on Saturday June 29, 2024 @07:02PM (#40833891)
For mixtral 7B latency, I think the explanation is just that chips and cheese used 128 token requests, and in the article it is 256 token requests

I still can't explain throughput differences though