News for hackers. Stuff that matters.
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @10:08AM (#40013087)
Incredible! I'd been wondering if this was possible. Now the only thing standing in the way of my 4x4090 rig for local LLMs is finding time to build it. With tensor parallelism, this will be both massively cheaper and faster for inference than a H100 SXM.

I still don't understand why they went with 6 GPUs for the tinybox. Many things will only function well with 4 or 8 GPUs. It seems like the worst of both worlds now (use 4 GPUs but pay for 6 GPUs, don't have 8 GPUs).

Re:Tinygrad: Hacked 4090 driver to enable P2P by cjbprime on Friday April 12, 2024 @12:09PM (#40014481)
I don't think P2P is very relevant for inference. It's important for training. Inference can just be sharded across GPUs without sharing memory between them directly.
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @12:10PM (#40014493)
It can make a difference when using tensor parallelism to run small batch sizes. Not a huge difference like training because we don't need to update all weights, but still a noticeable one. In the current inference engines there are some allreduce steps that are implemented using nccl.

Also, paged KV cache is usually spread across GPUs.

Re:Tinygrad: Hacked 4090 driver to enable P2P by namibj on Friday April 12, 2024 @02:48PM (#40016342)
It massively helps arithmetic intensity to batch during inference, and the desired batch sizes by that tend to exceed the memory capacity of a single GPU. Thus desire to do training-like cluster processing to e.g. use a weight for each inference stream that needs it every time it's fetched from memory. It's just that you can't fit 100+ inference streams of context on one GPU, typically, thus the desire to shard along less-wasteful (w.r.t. memory bandwidth) dimensions than entire inference streams.
Re:Tinygrad: Hacked 4090 driver to enable P2P by qeternity on Friday April 12, 2024 @03:45PM (#40016889)
You are talking about data parallelism. Depending on the model tensor parallelism can still be very important for inference.
Re:Tinygrad: Hacked 4090 driver to enable P2P by liuliu on Friday April 12, 2024 @11:59AM (#40014382)
6 seems reasonable. 128 Lanes from ThreadRipper needs to have a few for network and NVMe (4x NVMe would be x16 lanes, and 10G network would be another x4 lanes).
Re:Tinygrad: Hacked 4090 driver to enable P2P by Tepix on Friday April 12, 2024 @10:42AM (#40013494)
6 GPUs because they want fast storage and it uses PCIe lanes.

Besides the goal was to run a 70b FP16 model (requiring roughly 140GB VRAM). 6*24GB = 144GB

Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @11:07AM (#40013802)
That calculation is incorrect. You need to fit both the model (140GB) and the KV cache (5GB at 32k tokens FP8 with flash attention 2) * batch size into VRAM.

If the goal is to run a FP16 70B model as fast as possible, you would want 8 GPUs with P2P, for a total of 192GB VRAM. The model is then split across all 8 GPUs with 8-way tensor parallelism, letting you make use of the full 8TB/s memory bandwidth on every iteration. Then you have 50GB spread out remaining for KV cache pages, so you can raise the batch size up to 8 (or maybe more).

Re:Tinygrad: Hacked 4090 driver to enable P2P by renewiltord on Friday April 12, 2024 @11:20AM (#40013942)
I’ve got a few 4090s that I’m planning on doing this with. Would appreciate even the smallest directional tip you can provide on splitting the model that you believe is likely to work.
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @11:23AM (#40013978)
The split is done automatically by the inference engine if you enable tensor parallelism. TensorRT-LLM, vLLM and aphrodite-engine can all do this out of the box. The main thing is just that you need either 4 or 8 GPUs for it to work on current models.
Re:Tinygrad: Hacked 4090 driver to enable P2P by renewiltord on Friday April 12, 2024 @12:03PM (#40014425)
Thank you! Can I run with 2 GPUs or with heterogeneous GPUs that have same RAM? I will try. Just curious if you already have tried.
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @12:06PM (#40014445)
2 GPUs works fine too, as long as your model fits. Using different GPUs with same VRAM however, is highly highly sketchy. Sometimes it works, sometimes it doesn't. In any case, it would be limited by the performance of the slower GPU.
Re:Tinygrad: Hacked 4090 driver to enable P2P by renewiltord on Friday April 12, 2024 @12:49PM (#40014979)
All right, thank you. I can run it on 2x 4090 and just put the 3090s in different machine.
Re:Tinygrad: Hacked 4090 driver to enable P2P by Tepix on Saturday April 13, 2024 @08:13PM (#40027480)
I know there's some overhead, it's not my calculation.

https://www.tweaktown.com/news/97110/tinycorps-new-tinybox-a...

Quote: "Runs 70B FP16 LLaMA-2 out of the box using tinygrad"

Related: https://github.com/tinygrad/tinygrad/issues/3791

Re:Tinygrad: Hacked 4090 driver to enable P2P by numpad0 on Friday April 12, 2024 @11:40AM (#40014157)
I was googling public NVIDIA SXM2 materials the other day, and it seemed SXM2/NVLink 2.0 just was a six-way system. NVIDIA SXM had updated to versions 3 and 4 since, and this isn't based on none of those anyway, but maybe there's something we don't know that make six-way reasonable.
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @11:43AM (#40014181)
It was probably just before running LLMs with tensor parallelism became interesting. There are plenty of other workloads that can be divided by 6 nicely, it's not an end-all thing.
Re:Tinygrad: Hacked 4090 driver to enable P2P by dheera on Friday April 12, 2024 @03:12PM (#40016578)
What is a six-way system?
Re:Tinygrad: Hacked 4090 driver to enable P2P by TylerE on Friday April 12, 2024 @11:58PM (#40020374)
oid school way of saying core (or in this case GPU), basically.
Re:Tinygrad: Hacked 4090 driver to enable P2P by corn13read2 on Friday April 12, 2024 @10:35AM (#40013415)
A macbook is cheaper though
Re:Tinygrad: Hacked 4090 driver to enable P2P by tgtweak on Friday April 12, 2024 @10:47AM (#40013539)
The extra $3k you'd spend on a quad-4090 rig vs the top mbp... ignoring the fact you can't put the two on even ground for versatility (very few libraries are adapted to apple silicone let alone optimized).

Very few people that would consider an H100/A100/A800 are going to be cross-shopping a macbook pro for their workloads.

Re:Tinygrad: Hacked 4090 driver to enable P2P by LoganDark on Friday April 12, 2024 @01:01PM (#40015130)
> very few libraries are adapted to apple silicone let alone optimized

This is a joke, right? Have you been anywhere in the LLM ecosystem for the past year or so? I'm constantly hearing about new ways in which ASi outperforms traditional platforms, and new projects that are optimized for ASi. Such as, for instance, llama.cpp.

Re:Tinygrad: Hacked 4090 driver to enable P2P by cavisne on Friday April 12, 2024 @01:20PM (#40015316)
Nothing compared to Nvidia though. The FLOPS and memory bandwidth is simply not there.
Re:Tinygrad: Hacked 4090 driver to enable P2P by spudlyo on Friday April 12, 2024 @03:52PM (#40016946)
The memory bandwidth of the M2 Ultra is around 800GB/s verses 1008 GB/s for the 4090. While it’s true the M2 has neither the bandwidth or the GPU power, it is not limited to 24G of VRAM per card. The 192G upper limit on the M2 Ultra will have a much easier time running inference on a 70+ billion parameter model, if that is your aim.

Besides size, heat, fan noise, and not having to build it yourself, this is the only area where Apple Silicon might have advantage over a homemade 4090 rig.

Re:Tinygrad: Hacked 4090 driver to enable P2P by LoganDark on Friday April 12, 2024 @04:45PM (#40017460)
It doesn't need GPU power to beat the 4090 in benchmarks: https://appleinsider.com/articles/23/12/13/apple-silicon-m3-...
Re:Tinygrad: Hacked 4090 driver to enable P2P by int_19h on Friday April 12, 2024 @04:52PM (#40017524)
It doesn't beat RTX 4090 when it comes to actual LLM inference speed. I bought a Mac Studio for local inference because it was the most convenient way to get something fast enough and with enough RAM to run even 155b models. It's great for that, but ultimately it's not magic - NVidia hardware still offers more FLOPS and faster RAM.
Re:Tinygrad: Hacked 4090 driver to enable P2P by LoganDark on Friday April 12, 2024 @05:13PM (#40017724)
> It doesn't beat RTX 4090 when it comes to actual LLM inference speed

Sure, whisper.cpp is not an LLM. The 4090 can't even do inference at all on anything over 24GB, while ASi can chug through it even if slightly slower.

I wonder if with https://github.com/tinygrad/open-gpu-kernel-modules (the 4090 P2P patches) it might become a lot faster to split a too-large model across multiple 4090s and still outperform ASi (at least until someone at Apple does an MLX LLM).

Re:Tinygrad: Hacked 4090 driver to enable P2P by dragonwriter on Friday April 12, 2024 @05:22PM (#40017813)
> The 4090 can't even do inference at all on anything over 24GB, while ASi can chug through it even if slightly slower.

Common LLM runners can split model layers between VRAM and system RAM; a PC rig with a 4090 can do inference on models larger than 24G.

Where the crossover point where having the whole thing on Apple Silicon unified memory vs. doing split layers on a PC with a 4090 and system RAM is, I don't know, but its definitely not “more than 24G and a 4090 doesn't do anything”.

Re:Tinygrad: Hacked 4090 driver to enable P2P by LoganDark on Friday April 12, 2024 @07:25PM (#40018665)
> Common LLM runners can split model layers between VRAM and system RAM; a PC rig with a 4090 can do inference on models larger than 24G.

Sure and ASi can do inference on models larger than the Unified Memory if you account for streaming the weights from the SSD on-demand. That doesn't mean it's going to be as fast as keeping the whole thing in RAM, although ASi SSDs are probably not particularly bad as far as SSDs go.

Re:Tinygrad: Hacked 4090 driver to enable P2P by treprinum on Saturday April 13, 2024 @07:27AM (#40022355)
Slightly slower in this case is like 10x. I have M3 Max with 128GB RAM, 4090 trashes it on anything under 24GB, then M3 Max trashes it on anything above 24GB, but it's like 10x slower at it than 4090 on <24GB.
Re:Tinygrad: Hacked 4090 driver to enable P2P by numpad0 on Sunday April 14, 2024 @11:17AM (#40031710)
PSA for all people who are still being misled by hand-wavy Apple M1 marketing charts[1] implicating total dominance of M-series wondersilicon obsoleting all Intel/NVIDIA PCs:

There are benchmark data showing that an Apple M2 Ultra is 47% and 60% slower against Xeon W9 and RTX 4090, or 0.35% and 2% slower against i9-13900K and RTX 4060 Ti, respectively, in Geekbench 5 Multi-threaded and OpenCL Compute tests.

Apple Silicon Macs are NOT faster than competing desktop computers, nor M1 was massively faster than NVIDIA 3070(Desktop - 2x faster than Laptop variant M1 was compared against) for that matter. They just offer up to 128GB shared RAM/VRAM options in slim desktops and laptops, which is handy for LLM, that's it.

Please stop taking Apple marketing materials at full face value or above. Thank you.

  1: https://i.extremetech.com/imagery/content-types/03ekiQwNudC75iOK4AMuEkw/images-2.jpg    
  2: screenshot from[4]: https://www.igorslab.de/wp-content/uploads/2023/06/Apple-M2-ULtra-SoC-Geekbench-5-Multi-Threaded.jpg  
  3: screenshot from[4]: https://www.igorslab.de/wp-content/uploads/2023/06/Apple-M2-ULtra-SoC-Geekbench-5-OpenCL-Compute.jpg  
  4: https://wccftech.com/apple-m2-ultra-soc-isnt-faster-than-amd-intel-last-year-desktop-cpus-50-slower-than-nvidia-rtx-4080/
Re:Tinygrad: Hacked 4090 driver to enable P2P by LoganDark on Friday April 12, 2024 @04:26PM (#40017285)
Yeah. Let me just walk down to Best Buy and get myself a GPU with over 24 gigabytes of VRAM (impossible) for less than $3,000 (even more impossible). Then tell me ASi is nothing compared to Nvidia.

Even the A100 for something around $15,000 (edit: used to say $10,000) only goes up to 80 gigabytes of VRAM, but a 192GB Mac Studio goes for under $6,000.

Those figures alone proves Nvidia isn't even competing in the consumer or even the enthusiast space anymore. They know you'll buy their hardware if you really need it, so they aggressively segment the market with VRAM restrictions.

Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @04:32PM (#40017354)
Where are you getting an A100 80GB for $10k?
Re:Tinygrad: Hacked 4090 driver to enable P2P by LoganDark on Friday April 12, 2024 @04:36PM (#40017383)
Oops, I remembered it being somewhere near $15k but Google got confused and showed me results for the 40GB instead so I put $10k by mistake. Thanks for the correction.

A100 80GB goes for around $14,000 - $20,000 on eBay and A100 40GB goes for around $4,000 - $6,000. New (not from eBay - from PNY and such), it looks like an 80GB would set you back $18,000 to $26,000 depending on whether you want HBM2 or HBM2e.

Meanwhile you can buy a Mac Studio today without going through a distributor and they're under $6,000 if the only thing you care about is having 192GB of Unified Memory.

And while the memory bandwidth isn't quite as high as the 4090, the M-series chips can run certain models faster anyway, if Apple is to be believed

Re:Tinygrad: Hacked 4090 driver to enable P2P by llm_trw on Friday April 12, 2024 @12:15PM (#40014548)
So is a TI-89.
Re:Tinygrad: Hacked 4090 driver to enable P2P by amelius on Friday April 12, 2024 @02:32PM (#40016165)
And looks way cooler
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @10:58AM (#40013688)
Sure, it's also at least an order of magnitude slower in practice, compared to 4x 4090 running at full speed. We're looking at 10 times the memory bandwidth and much greater compute.
Re:Tinygrad: Hacked 4090 driver to enable P2P by chaostheory on Friday April 12, 2024 @05:47PM (#40018033)
Yeah, even a Mac Studio is way too slow compared to Nvidia which is too bad because at $7000 maxed to 192gb it would be an easy sell. Hopefully, they will fix this by m5. I don’t trust the marketing for m4
Re:Tinygrad: Hacked 4090 driver to enable P2P by thangngoc89 on Friday April 12, 2024 @11:16AM (#40013892)
training on MPS backend is suboptimal and really slow.
Re:Tinygrad: Hacked 4090 driver to enable P2P by wtallis on Friday April 12, 2024 @02:41PM (#40016274)
Do people do training on systems this small, or just inference? I could see maybe doing a little bit of fine-tuning, but certainly not from-scratch training.
Re:Tinygrad: Hacked 4090 driver to enable P2P by redox99 on Friday April 12, 2024 @05:01PM (#40017595)
If you mean train llama from scratch, you aren't going to train it on any single box.

But even with a single 3090 you can do quite a lot with LLMs (through QLoRA and similar).

Re:Tinygrad: Hacked 4090 driver to enable P2P by thangngoc89 on Saturday April 13, 2024 @12:33AM (#40020519)
Yep. Price/performance of multiple 4090s system are way better than the professional cards (Axxx). Also deep learning outside of LLM has many different usage.
Re:Tinygrad: Hacked 4090 driver to enable P2P by numpad0 on Friday April 12, 2024 @12:28PM (#40014727)
4x32GB(128GB) DDR4 is ~$250. 4x48GB(192GB) DDR5 is ~$600. Those are even cheaper than upgrade options for Macs($1k).
Re:Tinygrad: Hacked 4090 driver to enable P2P by papichulo2023 on Friday April 12, 2024 @02:59PM (#40016446)
No many consumer mobo support 192GB DDR5.
Re:Tinygrad: Hacked 4090 driver to enable P2P by wtallis on Friday April 12, 2024 @04:05PM (#40017069)
If it supports DDR5 at all, then it should be at most a firmware update away from supporting 48GB dual-rank DIMMs. There are very few consumer motherboards that only have two DDR5 slots; almost all have the four slots necessary to accept 192GB. If you are under the impression that there's a widespread limitation on consumer hardware support for these modules, it may simply be due to the fact that 48GB modules did not exist yet when DDR5 first entered the consumer market, and such modules did not start getting mentioned on spec sheets until after they existed.
Re:Tinygrad: Hacked 4090 driver to enable P2P by imtringued on Saturday April 13, 2024 @05:15AM (#40021702)
You don't want to use more than two slots because you only have two memory channels. The overclocking potential of DDR5 is extremely high when you only run two DIMMs. All the way up to 8000. Meanwhile if you go for populating all four slots, you are limited significantly below 5000. Almost a 50% performance drop if you are willing to overclock your RAM.
Re:Tinygrad: Hacked 4090 driver to enable P2P by wtallis on Saturday April 13, 2024 @05:21AM (#40021723)
If you want to run something that doesn't fit in 96GB of RAM, you'll get better performance from having enough RAM. Yes, having two dual-rank DIMMs per channel will force you to run at a slower speed, but it's still far faster than your SSD. The second slot per channel exists precisely because many people really do want to use it.
Re:Tinygrad: Hacked 4090 driver to enable P2P by ojbyrne on Friday April 12, 2024 @04:05PM (#40017070)
A lot that have specs showing they support a max of 4x32 DDR5 actually support 4x48 DDR5 via recent BIOS updates.
Re:Tinygrad: Hacked 4090 driver to enable P2P by papichulo2023 on Saturday April 13, 2024 @05:37PM (#40026385)
In the specs yeap, in practice hardly anyone got it working. As far as I saw in reddit, it requires customizing timings to make 4 slots work over 6000 Mhz at the same time.
Re:Tinygrad: Hacked 4090 driver to enable P2P by faeriechangling on Saturday April 13, 2024 @03:33PM (#40025391)
Most consumer mobo's I see support this even if the setup isn't on the QVL. If a DDR5 motherboard support 4 sticks at all you can probably run 192gb on it so long as you update the BIOS firmware. The problem is running at rated speeds.

AMD tends to be worse than Intel, and I hear people having to run anywhere between DDR5-3200 to DDR5-5200. You are better off running two sticks, because even with 2 sticks you really can't run larger models with acceptable performance anyways, much less with 4.

There is competition to apple on the low end (dual channel fast DDR5) and on the high end (8+ channel like Xeon/Epyc/AmpereOne). In the middle, Apple is sort of crushing because if you run a true 4 channel system you're going to get poor performance if you load up a 192gb model, and if you compare pricing to 96gb/128gb apple systems, there's not all that much of a cost advantage and you have to make a lot of sacrifices to get there. The truth is that Apple really doesn't have all that much competition right now and won't for the foreseeable future.

Re:Tinygrad: Hacked 4090 driver to enable P2P by papichulo2023 on Saturday April 13, 2024 @05:35PM (#40026370)
Hopefully Qualcom will free us of this 2 channels noghtmare.
Re:Tinygrad: Hacked 4090 driver to enable P2P by faeriechangling on Saturday April 13, 2024 @11:02PM (#40028311)
I’m optimistic about APUs personally like AMDs upcoming Strix Halo APU with a 256-bit memory bus competing at the lower end of the market, but that will only provide so much competition.
Re:Tinygrad: Hacked 4090 driver to enable P2P by wtallis on Sunday April 14, 2024 @01:05PM (#40032556)
I don't think it's realistic to pin your hopes on Qualcomm given that they're unlikely to care about supporting anything other than LPDDR with their laptop processors.
Re:Tinygrad: Hacked 4090 driver to enable P2P by faeriechangling on Saturday April 13, 2024 @03:08PM (#40025238)
Buying a MacBook for AI is great if you were already going to buy a MacBook, as this makes it a lot more cost competitive. It's also great if what you're doing is REALLY privacy sensitive, such as if you're a lawyer, where uploading client data to OpenAI is probably not appropriate or legal.

But in general, I find the appeal is narrow because either consumer GPUs are better for training in general and inferencing at scale[1]. Cloud services also allow the vast majority of individuals to get higher quality inferencing at lower cost. The result is Apple Silicon's appeal being quite niche.

[1] Mind you, Nvidia considers this a licensing violation, not that GeoHot has historically ever been all scared to violate a EULA and force a company to prove its terms have legal force.

Re:Tinygrad: Hacked 4090 driver to enable P2P by ShamelessC on Friday April 12, 2024 @10:52AM (#40013602)
> Many things will only function well with 4 or 8 GPUs

What do you mean?

Re:Tinygrad: Hacked 4090 driver to enable P2P by segfaultbuserr on Friday April 12, 2024 @10:55AM (#40013643)
It's more difficult to split your work across 6 GPUs evenly, and easier when you have 4 or 8 GPUs. The latter setups have powers of 2, which for example, can evenly divide a 2D or 3D grid, but 6 GPUs are awkward to program. Thus, the OP argues that a 6-GPU setup is highly suboptimal for many existing applications and there's no point to pay more for the extra 2.
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @10:54AM (#40013632)
For example, if you want to run low latency multi-GPU inference with tensor parallelism in TensorRT-LLM, there is a requirement that the number of heads in the model is divisible by the number of GPUs. Most current published models are divisible by 4 and 8, but not 6.
Re:Tinygrad: Hacked 4090 driver to enable P2P by bick_nyers on Friday April 12, 2024 @11:48AM (#40014253)
Interesting... 1 Zen 4 EPYC CPU yields a maximum of 128 PCIE lanes so it wouldn't be possible to put 8 full fat GPUs on while maintaining some lanes for storage and networking. Same deal with Threadripper Pro.
Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @11:52AM (#40014285)
It should be possible with onboard PCIe switches. You probably don't need the networking or storage to be all that fast while running the job, so it can dedicate almost all of the bandwidth to the GPU.

I don't know if there are boards that implement this, though, I'm only looking at systems with 4x GPUs currently. Even just plugging in a 5kW GPU server in my apartment would be a bit of a challenge. With 4x 4090, the max load would be below 3kW, so a single 240V plug can handle it no issue.

Re:Tinygrad: Hacked 4090 driver to enable P2P by thangngoc89 on Friday April 12, 2024 @12:17PM (#40014578)
8 GPUs x 16 PCIe lanes each = 128 lanes already.

That’s the limit of single CPU platforms.

Re:Tinygrad: Hacked 4090 driver to enable P2P by bick_nyers on Friday April 12, 2024 @01:39PM (#40015526)
I've seen it done with a PLX Multiplexer as well, but they add quite a bit of cost:

https://c-payne.com/products/pcie-gen4-switch-backplane-4-x1...

Not sure if there exists an 8-way PCIE Gen 5 Multiplexer that doesn't cost ludicrous amounts of cash. Ludicrous being a highly subjective and relative term of course.

Re:Tinygrad: Hacked 4090 driver to enable P2P by namibj on Friday April 12, 2024 @03:22PM (#40016683)
98 lanes of PCIe 4.0 fabric switch as just the chip (to solder onto a motherboard/backplane) costs 850$ (PEX88096). You could for example take 2 x16 GPUs, pass then through (2216=64 lanes), and have 2 x16 that bifurcate to at least x4 (might even be x2, I didn't find that part of the docs just now) for anything you want, plus 2 x1 for minor stuff. They do claim to have no problems being connected up into a switching fabric, and very much allow multi-host operations (you will need signal retimers quite soon, though).

They're the stuff that enables cloud operators to pool like 30 GPUs across like 10 CPU sockets while letting you virtually hot-plug them to fit demand. Or when you want to make a SAN with real NVMe-over-PCIe. Far cheaper than normal networking switches with similar ports (assuming hosts doing just x4 bifurcation, it's very comparable to a 50G Ethernet port. The above chip thus matches a 24 port 50G Ethernet switch. Trading reach for only needing retimers, not full NICs, in each connected host. Easily better for HPC clusters up to about 200 kW made from dense compute nodes.), but sadly still lacking affordable COTS parts that don't require soldering or contacting sales for pricing (the only COTS with list prices seem to be Broadcom's reference designs, for prices befitting an evaluation kit, not a Beowulf cluster).

Re:Tinygrad: Hacked 4090 driver to enable P2P by pests on Friday April 12, 2024 @08:17PM (#40019042)
I really like the information about how the cloud providers do their multiplexing, thanks. There was some tech posted here a few month ago that was similar I found very interesting - plug all devices, ram, hard drives, and CPUS into a larger fabric and a way to spin up "servers" of any size from the pool of resources... wish I could remember the name now.

nit: HN formatting messed up your math in the second sentence, I believe you italicized on accident using * for equations.

Re:Tinygrad: Hacked 4090 driver to enable P2P by georgehotz on Friday April 12, 2024 @01:15PM (#40015272)
tinygrad supports uneven splits. There's no fundamental reason for 4 or 8, and work should almost fully parallelize on any number of GPUs with good software.

We chose 6 because we have 128 PCIe lanes, aka 8 16x ports. We use 1 for NVMe and 1 for networking, leaving 6 for GPUs to connect them in full fabric. If we used 4 GPUs, we'd be wasting PCIe, and if we used 8 there would be no room for external connectivity aside from a few USB3 ports.

Re:Tinygrad: Hacked 4090 driver to enable P2P by andersa on Friday April 12, 2024 @03:57PM (#40017012)
That is very interesting if tinygrad can support it! Every other library I've seen had the limitation on dividing the heads, so I'd (perhaps incorrectly) assumed that it's a general problem for inference.
Re:Tinygrad: Hacked 4090 driver to enable P2P by spmurrayzzz on Saturday April 13, 2024 @12:10PM (#40024066)
There are some interesting hacks you can do like replicating the K/V weights by some factor which allows them to be evenly divisible by whatever number of gpus you have. Obviously there is a memory cost there, but it does work.
Re:Tinygrad: Hacked 4090 driver to enable P2P by Emerson1 on Saturday April 27, 2024 @03:42AM (#40178101)
how could you go about testing this on say llama3 70b with two 4090s - vllm supports tensor parallelism, would the expectation be that inference would be faster with p2p? How would you update the nvidia driver tho? Thanks any thought appreciated
Re:Tinygrad: Hacked 4090 driver to enable P2P by davidzweig on Friday April 12, 2024 @02:06PM (#40015849)
Is it possible a similar patch would work for P2P on 3090s?

btw, I found a Gigabyte board on Taobao that is unlisted on their site: MZF2-AC0, costs $900. 2 socket Epyc and 10 PCIE slots, may be of interest. A case that should fit, with 2x 2000W Great Wall PSUs and PDU is 4050 RMB (https://www.toploong.com/en/4GPU-server-case/644.html). You still need blower GPUs.

Re:Tinygrad: Hacked 4090 driver to enable P2P by georgehotz on Friday April 12, 2024 @02:25PM (#40016085)
It should if your 3090s have Resizable BAR support in the VBIOS. AFAIK most card manufacturers released BIOS updates enabling this.

Re: 3090 NVLink, that only allows pairs of cards to be connected. PCIe allows full fabric switch of many cards.

Re:Tinygrad: Hacked 4090 driver to enable P2P by Ratiofarmings on Friday April 12, 2024 @05:15PM (#40017749)
In cases where they didn't, the techpowerup vBIOS collection solves the problem.
Re:Tinygrad: Hacked 4090 driver to enable P2P by learnedmachine on Monday April 15, 2024 @03:12PM (#40044546)
Thanks for the amazing work! I tried the driver with some 3090s (all of which show the 32G line with lspci -s 01:00.0 -v) and while torch says I have p2p access, I can't get it to work with anything as I get illegal memory access errors.
Re:Tinygrad: Hacked 4090 driver to enable P2P by cjbprime on Friday April 12, 2024 @02:23PM (#40016061)
Doesn't nvlink work natively on 3090s? I thought it was only removed (and here re-enabled) in 4090.
Re:Tinygrad: Hacked 4090 driver to enable P2P by qeternity on Friday April 12, 2024 @03:40PM (#40016847)
This not not nvlink.
Re:Tinygrad: Hacked 4090 driver to enable P2P by davidzweig on Saturday April 13, 2024 @12:16AM (#40020450)
Update, I checked with the case company, toploong, they say that board is a 5mm too big or so for the case.
Re:Tinygrad: Hacked 4090 driver to enable P2P by doctorpangloss on Friday April 12, 2024 @01:30PM (#40015426)
Have you compared 3x 3090-3090 pairs over NVLink?

IMO the most painful thing is that since these hardware configurations are esoteric, there is no software that detects them and moves things around "automatically." Regardless of what people thing device_map="auto" does, and anyway, Hugging Face's transformers/diffusers are all over the place.

Re:Tinygrad: Hacked 4090 driver to enable P2P by AnthonyMouse on Friday April 12, 2024 @05:01PM (#40017602)
Is there any reason you couldn't use 7? 8 PCIe lanes each seems more than sufficient for NVMe and networking.
Re:Tinygrad: Hacked 4090 driver to enable P2P by WanderPanda on Friday April 12, 2024 @08:17PM (#40019044)
Did you at least front run the market and stocked up of 4090ies before this release? Also gamers are probably not too happy about these developments :D
Re:Tinygrad: Hacked 4090 driver to enable P2P by tinco on Saturday April 13, 2024 @09:10AM (#40022914)
4090's have consistently been around 2000 dollars. I don't think there's many gamers who would be affected by price fluctuations of the 4090 or even the 4080.
Re:Tinygrad: Hacked 4090 driver to enable P2P by presides on Saturday April 13, 2024 @12:27PM (#40024179)
This is out of touch; they were mad before and they will be mad again. Lots of people spend a huge chunk of their modest disposable income on high end gaming gear, and the only upside of these issues for them is that eventually, YEARS down the line, capacity/supply issues MIGHT calm down in a way that yields some benefits.

They're going to realize soon enough that they've basically just been told that the extremely shitty problem they thought they'd moved beyond is back with a vengeance and the next generation of gaming cards has the potential to make the past few rounds of scalping shit-shows look tame.

Re:Tinygrad: Hacked 4090 driver to enable P2P by swalsh on Sunday April 14, 2024 @03:38PM (#40033755)
Gamers have a TON of really good really affordable options. But you kind of need 24gb min unless you're using heavy quantization. So 3090 and 4090's are what local llm people are building with (mostly 3090's as you can get then for about $700, and they're dang good)
Re:Tinygrad: Hacked 4090 driver to enable P2P by boromi on Saturday April 13, 2024 @02:01PM (#40024825)
Any chance you could share the details of the build you'd go for. I need a server for our lab, but am kinda out of my depth with all the options/