Live data from Hacker News

Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

the-diy-life.com

51–60 of 70 posts

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#51

Earlier quoted context omitted.

The definition a prime number is having two factors. As the multiplicative identity, one only has one factor. Some might see primes as being numbers with >=2 factors. This interpretation is less useful. What is completely useless is a definition that makes exclusions of specific numbers as dogma. What does that say about anything? It’s totally arbitrary and unexplanatory.

No, that is not the correct definition of a prime. You can find the right one on Wikipedia. The reason that 1 is not a prime is to preserve unique factorization. A basic fact from number theory is that every integer uniquely factors as a product of primes, say 21 = 7 times 3. If 1 were a prime, we'd also have 21 = 7 times 3 times 1. That's bad. In more general number rings, other units (e.g. i) are also not considere…

As a complement of your comment: For more information, see Unique Factorization Domains (https://en.wikipedia.org/wiki/Unique_factorization_domain) for the generalization of how prime factorization work on things other than integers.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#52

Earlier quoted context omitted.

1 is considered prime by some.

Whether or not that is true, the code snippet in the article shows this comment: #0 and 1 are not primes

That's in the multiprocessing version, which was written by someone else and returns 1229 primes.

The original code includes 1 as a prime.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#53

Earlier quoted context omitted.

The definition a prime number is having two factors. As the multiplicative identity, one only has one factor. Some might see primes as being numbers with >=2 factors. This interpretation is less useful. What is completely useless is a definition that makes exclusions of specific numbers as dogma. What does that say about anything? It’s totally arbitrary and unexplanatory.

For a mathematician the suggestion that 1 might be a prime is on a par with a suggestion that a circle is technically a type of triangle.

[deleted]

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#54

Earlier quoted context omitted.

Well, he also needed to add a cooler and a bunch of tubes & eight mounts to get coolant running on each Pi, eight ethernet cables, eight power cables, a power supply with enough outputs, a 16-port ethernet switch, and (correct me if I'm wrong) eight SD cards, if only to store a bootloader that can do pxe. So eight Pies alone do not make a complete cluster, just as one Ryzen alone does not make a complete computer. A…

Jeff Geerling did a blog post[0] and video (series) on this very thing a while ago that goes into some of the hardware and costs. Whilst the costs can be negligible, it looks like a hella lot of fun! [0] https://www.jeffgeerling.com/blog/2020/raspberry-pi-cluster-...

Don’t forget this quote from that page:

> It's slightly more cost-effective and usually more power-efficient to build or buy a small NUC ("Next Unit of Computing") machine that has more raw CPU performance, more RAM, a fast SSD, and more expansion capabilities.

But is building some VMs to simulate a cluster on an NUC fun?

I would say, "No." Well, not as much as building a cluster of Raspberry Pis!

---

You don’t build a RPi cluster for speed or cost or efficiency. You do it because it’s fun. And that’s okay.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#55

I would really like to see how a raspi cluster fares with "real world" loads, like running an app or a distributed system, instead of calculating pi. I'm genuinely curious whether there would be any gains by running Docker containers, each on a separate Raspberry Pi. I personally am a web developer, therefore my technology stack is almost always the same - an app server, a background worker, a queue and a database. O…

> Theoretically the combined horsepower of all these [4] Pi's should stack up and deliver better performance than writing code on my M1. If that is the case, then M1 should be the slowest CPU Apple has used in the past 10 years.

M1 is good at ops/watt and also ops/second. M1 probably will still beat the Pi cluster by having a tighter Pareto curve.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#56
post #37

Using Ray distributed would be a better stress test. Computing primes this way probably isn't the best way to saturate cores. You are spending a lot of time doing python vm operations vs pure number crunching. Using numeric arrays chunked into blocks of number ranges would be more efficient (and therefore "crunchier") https://ray.io/

If they're thinking pure CPU benchmarking, prime95/mprime has several options, such as:

[this is from my recollection]

* completely in-register only, no caches. they warn an organic workload will never ever do this and not to do it if you're not confident in your cooling * somewhat more normal math-heavy workloads that don't do any IO but also do access the caches like a normal person * etc

The python benchmark might be fair, though? I wouldn't be surprised if the ARM chip on the pi is like, fast, but then when it came to doing something more holistic - like a bunch of python vm operations - something about the mac is more robust than the pi in a significant way.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#57
post #22
post #3

From quick overview seems like speed up is achieved because there is comparison of 4 local processes, versus 16 processes, since it is only single gather operation does not seem like latency would make much of difference. I wonder what performance would look like on 5 years old 16 core CPU from ebay for like $20, compared to py cluster.

I have a 2 socket E5-2650 v2 for 16 cores which is as fast as a modern Ryzen above (but 50% slower on real world tasks) 0.8 seconds for 10,000 28.16 seconds for 100,000

This would be interesting comparison against pi cluster on more accurate tasks, I have suspicion dual e5 will out perform pi cluster.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#58
post #45

Earlier quoted context omitted.

See my comment above.

Don't know why I'm getting down voted, but thanks, that's exactly what I was looking for.

I suspect because the author of the blogpost probably doesn't own an M1 Mac (he mentions benchmarking several machines and it seems unlikely he would have forgotten the M1 if he had one), so your comment (interpreted as a request to the author) amounts to "Please spend about $1000 on another computer because I want another benchmark result", not to mention shipping time would make it days before he could report back. In other words, it seems to be an unreasonable request.

If you meant to ask the other commenters here, then something like "Does anyone have an M1 Mac? If so, would you run his benchmarks and post the results here?" would have been clearer.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#59
post #47

2GB Pi is $55 on amazon. 4GB version is $62. That'd be $450+ for the eight pies. Ryzen 2700 launched at $300 (and tapered down to ~$200) and would pretty much run circles around such a Pi cluster. Just saying. These Pi clusters can be a cool and fun thing to build but if you're looking for compute power, you'd be better served by a mid-range desktop.

Would it though? The cluster has more cores (each PI4 has a quad core), so for certain workloads it seems like it could realistically beat a single 8-core with higher clocks. As always, a benchmark is the only thing that will prove it.

It absolutely would. These cores are in a completely different class.

If you care about benchmarks, a Pi4 will score around 200 points (1 core) or 550 points (4 core) at 1.5GHz on GB5. At 2GHz you can reach around 700 points multi-core.

Ryzen 2700 will easily go above 6000 points in multi-core bench without overclocking.

So even in a theoretical, embarrasingly parallel workload with minimal sharing between cluster nodes, the Zen will be faster than eight pies. It's not even a contest if you also need some I/O, shared memory, or heavy SIMD.

Re: Can My Water Cooled Raspberry Pi Cluster Beat My MacBook?

#60

2GB Pi is $55 on amazon. 4GB version is $62. That'd be $450+ for the eight pies. Ryzen 2700 launched at $300 (and tapered down to ~$200) and would pretty much run circles around such a Pi cluster. Just saying. These Pi clusters can be a cool and fun thing to build but if you're looking for compute power, you'd be better served by a mid-range desktop.

In terms of computer per dollar yes. In terms of compute per joule, no.

I don't think that's true either. You can get 8-core desktop Ryzen parts that have a TDP of 65 watts. I have a passively cooled 8-core Ryzen system that uses a 240 watt power supply.

Also: by the time you've wired up 8 raspis you end up using quite a bit of power just to connect them all together with a switch.

Raspberry Pi 4s need a maximum of 15 watts each. So 120 watts just for the computers. Even if you discount the power consumption of the switch, my 240 watt Ryzen computer is still going to beat that joule-for-joule.

Edit: one more thing, that 240 watt system also powers a 75 watt GPU, so it's definitely more wattage than really required for the CPU alone.

Post reply on HN