Better HN
topnewbestaskshowjobs
Log inSign up

rfoo

2,493 karma · joined Feb 24, 2017 (9y ago) · 1,050 submissions

about
Submissions

comment 1y ago · link · parent

I don't think so. This looks like to be using an actual VM instead of container tech.

comment 1y ago · link · parent

Check out why Togerther.AI acquired CodeSandbox.

comment 1y ago · link · parent

I agree. Gamers are cursing Nvidia right now tho, and sadly university labs doing serious research on gaming cards is also a past :(

comment 1y ago · link · parent

I think we did release some of the optimized kernels but I don't think we have released any one with SASS black magic, at least not before I left. Already been sanctioned by BIS, better not annoy NVIDIA furthermore.

comment 1y ago · link · parent

Yes.

These are very good and high profile public demonstrations of where $NVDA's moat is: that GPGPU is very flexible and you can program to do a lot of stuff that makes perfect sense but wasn't in the mind of hardware vendors.

Now, if you predict the future to eventually converge on more and more dedicated hardware support, to the point that there's no more software optimizations like these, then the so-called "CUDA moat" breaks.

To stay in this game, NVIDIA is breaking down their own moat :p

comment 1y ago · link · parent

> This stuff must be documented internally

Probably no. They are likely only documented in architectural design doc / spec etc which you surely do not want to share.

comment 1y ago · link · parent

Uh, three? I worked at $CORP where we had a three people sub-team, they reverse engineered most of Volta's SASS instruction encoding, built a working SASS assembler (before the open source one of course), with the ultimate goal of making GEMM / Conv faster. And they did it. Though it wasn't applied to a high-profile enough big picture so we never heard about it :>

If you don't believe me, previous open source SASS assemblers were mostly from university, they surely didn't have that many people.

comment 1y ago · link · parent

Well, let's enjoy free "sparsity" until it doesn't. Being able to train a really good model but in higher precision only is a research problem. Low precision training and inference is an engineering one.

We've been doing this since CNN days (9 years ago if not more), and I believe we have a good few years left.

comment 1y ago · link · parent

Gonna check what SASS it get translated to and whether it makes any sense.

I wonder if they had SASS assembler for Hopper (either by reverse engineering nvdisasm or by fuzzing instructions + nvdisasm + stare hard) and don't want to say it out :p

comment 1y ago · link · parent

For Llama 3 70B, batch size = 1, each MLP layer roughly takes 1x8192x26872x2 + 1x8192x26872x2 + 1x26872x8192x2 FLOPS ~= 1.31 GFLOPS, instead of ~1 TFLOPS.

Since the number differs by roughly 1024x, maybe you forgot that you just need to work on the last decoded token for MLP, too? Because you don't need hidden state for previous tokens in Attn now.

comment 1y ago · link · parent

Probably nothing.

Inference providers like Fireworks, or major clouds, can use this to reduce their cost, if they don't already have a replication with similar perf.

vLLM and SGLang may integrate this to be faster at serving DeepSeek-V2/V2.5/V3/R1 on H100/H800s.

I believe that's why they didn't release this back then, this is part of their "moat" (pretty weak tho) and it only benefits competitors.

Open sourcing this after being very popular may indicate that they don't want all the users to use their API/Chat and now want the world to serve it instead? Idk.

comment 1y ago · link · parent

Do they even have an optimized backward? It looks like optimizations like this aren't needed during training. Their V2 paper also suggests so.

comment 1y ago · link · parent

Thanks for your advice.

> different opinions

I won't argue with you so hard if it's your "opinions". What you described is not an opinion. And facts could be wrong. Plainly wrong.

> Maybe it's because it is not off?

Yeah, as I said earlier your number might be correct as an estimation for prefilling 1000 tokens on Llama 3 8B. That's not what everybody here called "decode". Your number shows that prefill is compute-bound. So what?

comment 1y ago · link · parent

For FlashMLA? No. The code here runs on one GPU only and do not have a builtin communication part.

comment 1y ago · link · parent

> Therefore the argument about loading the cached tensors doesn't make a difference at all.

Sorry, what? Who the fuck in this world runs decode without k/v cache??! If you run without k/v cache you are basically doing prefill for every token you generate and that's not what we called "decode". That's what we called "prefill".

k/v cache, while named "cache", is a lot more important than what people would perceive as a "cache". It's the essential part of the algorithm. If you lose your k/v cache you must run prefill again. If you run prefill for every token you generate it's not O(n^2), it's going to be O(n^3).

And yeah, you can run prefill 1000 times to generate a 1000 tokens output. Or you can run prefill once and with the persisted k/v cache run decode 1000 times. Tradeoff has to be made here but it simply makes no sense to drop a k/v cache in the middle of generating a response, as your number shows, recomputing is guaranteed to be slower than loading k/v cache.

> Please don't be so entitled.

When someone came up with a wrong number, I try to be nice and run the numbers myself and figure out why someone would end up with such a number and point out the specific mistake, instead of dumping a page of my own calculation. It's usually just a missing factor somewhere. Guess I shouldn't be so nice to retards who keep insisting that you can be fine without k/v cache during decoding. Also in this case I admit I failed to have a theory on why your number is so off because giving out prefill numbers and claiming it's decode isn't in my book.

Yeah, I know this sounds extremely mean, feel free to downvote, but I hope readers can feel my frustration now.

comment 1y ago · link · parent

You need to load cached k/v tensor, in addition to weights. It's going to take me some minutes to find out what's wrong in this napkin math. Will edit or reply this comment later.

comment 1y ago · link · parent

The wheel of CPU-only PyTorch 2.6.0 for Python 3.12 is ~170MiB in size.

It is indeed pretty silly that's not the default and you have to go to https://pytorch.org/get-started/locally/, copy the argument `--index-url https://download.pytorch.org/whl/cpu` to install CPU-only torch. But the alternative would be having the worlds scientists wondering why they can't use their GPUs after `pip install torch` so /shrug

comment 1y ago · link · parent

Apologize if I got it wrong, but:

> MLA, FlashAttention and similar optimizations will provide the benefits only when memory access time dominates

> Those would be [...] not the decode phase

This does sound like you are saying that memory access time does NOT dominate during the decode phase. But it does.

Reading your quotes, it looks like maybe you are talking about GPU utilization issues? (i.e. not launching enough threads). Due to the parallelization strategy of the original FA it indeed does not even keep the GPU busy if q*bs is too small. But this is not an inherent limitation of FA-style kernels and can be solved and people did solve it. Or you simply batch more. Now you can keep the GPUs busy at 100% waiting for memory access, but memory access time still dominates, hence "memory-access-bound". And here comes MLA.

> FWIW there are certainly model shapes that are compute-bound in the decode phase

Yeah. But so far all I read don't really work ("work" means being at least just slightly worse than alternatives) under same wall-clock time compute budget. Do you have any pointer to a working example, even on smaller 3B-ish models?

comment 1y ago · link · parent

Speaks more about how many low hanging fruits remaining in "NOOOOO I DON'T WANT TO DOWNLOAD 200MiB PYTORCH I'D BETTER REINVENT THE WHEEL"-gang inference stacks.

To be fair torch didn't try very hard optimizing on CPU either.

comment 1y ago · link · parent

... and batching does not help, you batch more requests and get more kvcache to load, still memory-access bound.

MLA made it possible to cache a smaller form of k/v, mitigating (but not completely solve, on shorter context & smaller batches it's still memory-access bound) the problem.

comment 1y ago · link · parent

That's correct, because FA can't turn inference time from memory-access bound into compute-bound. But your claim on that decoding is compute-bound is plainly wrong.

FA, compared to naive implementation, made training / prefill (i.e. when you can have multiple tokens in the same sequence visible) compute-bound instead of memory-access bound.

So, currently, on MHA/GQA, with Flash Attention, training/prefill is compute-bound, whereas decoding is memory-access-bound.

Before FA, both prefill / decode are bound by memory-access. FA solved the problem of training/prefill. But because kvcache is large, decoding is inherently bound by memory-access.

Our goal is always to make everything compute-bound.

comment 1y ago · link · parent

You've got it backwards. After FlashAttention, it's the decoding part being bound mainly by memory access. With FA as long as you have enough batch size you can push training/prefill to be compute-bound.

comment 1y ago · link · parent

They have H800s which have exactly same memory bandwidth and max FLOPS.

comment 1y ago · link · parent

They had their A100s back in 2021 to early 2022, well before any GPU sanction kicked in.

For a few months H800 wasn't sanctioned and that's when they bought them.

comment 1y ago · link · parent

Could you please explain what DeepSeek has done? Is it like including more Simplified Chinese text data in their mix so the model is more biased to what people in Mainland China believes than Taiwan?

comment 1y ago · link · parent

Indeed.

I guess investors should stop pouring money into LLMs, then. Just like how they don't pour money into pure mathematics.

comment 1y ago · link · parent

Why do we need a moat?

comment 1y ago · link · parent

I'm pretty skeptical of that 75% on GPQA Diamond for a non-reasoning model. Hope that xAI can make Grok 3 API available next week so I can run it against some private evaluations to see if it's really this good.

Another nit-pick: I don't think DeepSeek had 50k Hopper GPUs. Maybe they have 50k now after getting the world's attention and having national-sponsored grey market back them, but that 50k number is certainly dreamed-up. During the past year DeepSeek's intern recruitment ads always just mentioned "unlimited access to 10k A100s", suggesting that they may have very limited H100/H800s, and most of their research ideas were validated on smaller models on an Ampere cluster. The 10k A100 number matches with a cluster their parent hedge fund company announced a few years ago. All in all my estimation is they had more (maybe 20k) A100s, and single-digit thousands of H800s.

comment 1y ago · link · parent

> It’s why you can get your iPhone storage upgraded for pennies on the dollar.

??? How is this related to anything IP? To get your iPhone storage upgraded, you just need to blow off the old NAND Flash and "solder" new ones. Their pinouts are in public standards and every storage vendor in this world uses the same one.

And they did this for pennies because, of course, contrary to what Apple wants people to believe, flash storage does not cost much and even with the cost of all the dirty work it's still not much.

Or do you mean that they are violating Apple's IP rights by modifying their own devices? That's just... bullshit.

comment 1y ago · link · parent

It was like a dozen different versions of libtorch_cpu.dylib. So hardlink does not help.
1
678
35