News for hackers. Stuff that matters.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by Kwpolska on Wednesday May 03, 2023 @04:16PM (#35807196)
A comparison with x86_64 CPUs (e.g. those seen in comparable MacBooks and AWS machines) would be useful.

Also, I'm not sure if "correcting" the numbers for 3 GHz is reasonable and reflects real-life performance. Perhaps some throttling could be applied to test the CPUs using a common frequency?

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by zamalek on Wednesday May 03, 2023 @04:40PM (#35807467)
> I'm not sure if "correcting" the numbers for 3 GHz is reasonable and reflects real-life performance

It's not useful at all. It effectively measures IPC (instructions per clock), which is just chip vendor bragging rights.

Assuming that all the chips meet some baseline performance criteria: for datacenter and portable devices, the real benchmark would be "instructions per joule."

For desktop devices "instructions per dollar" would be most relevant.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by Octoth0rpe on Wednesday May 03, 2023 @04:53PM (#35807647)
> For desktop devices "instructions per dollar" would be most relevant.

For cloud customers as well

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by cubefox on Wednesday May 03, 2023 @05:38PM (#35808131)
Which would probably include the cost of the chips in some way, not just electricity.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by zamalek on Wednesday May 03, 2023 @06:52PM (#35808910)
> For cloud customers as well

Cloud costs are dominated by power delivery and cooling. Both of those are directly influenced by how much power the chip uses to achieve it's performance target.

I guess it does indirectly influence dollar cost, but I was referring to MSRP of the chip. As a simple example: the per-chip cost of Graviton is probably enormous (if you factor R&D into the cost of a chip), but it's still cheaper for Amazon customers. Why? Power and cooling.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by boulos on Wednesday May 03, 2023 @09:19PM (#35810099)
Disclosure: I used to work on GCE.

I don't understand where these power and cooling mantras came from, but large-scale cloud providers have very low PUE (Google publishes historical data at https://www.google.com/about/datacenters/efficiency/). That means you can take the basic power from a thread, add some for memory, and multiply by just a bit to get Watts. Take that and plug in your favorite $/kWh guess and get a price.

Ignoring Graviton, which doesn't have published power data to my knowledge, you can look up the TDP for a bunch of chips and see that it's a a few Watts per thread [1]. Similar calculations can be done for RAM. You end up at 5ish Watts per thread with some RAM attached. Let's call it 10 all in with cooling or other stuff. Since 10W is 1% of a kW, we end up with .01 kWh per hour. The top hit for "us power commercial rates" [2] says that we should assume 7c per kWh or so. That means our instance with cooling and overheads, needs to include .01 x .07 => $.0007/hr of power and cooling costs.

A single core w/ 4 GiB of memory on GCP at 3yr commitment rates (so we're focused on the long-term depreciation price) is .009815 + 4x.001316 => $.015/hr or about 20x as much as the power.

tl;dr: Power costs add up, but they are not even close to dominating the costs of cloud pricing.

[1] https://wccftech.com/amd-epyc-7h12-cpu-64-core-zen-2-280w-td...

[2] https://www.statista.com/statistics/190680/us-industrial-con...

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by jpgvm on Thursday May 04, 2023 @05:20AM (#35812988)
Reaching those PUE numbers is pretty damn impressive though.

I think the misconceptions come from enterprise DC environments with traditional hot/cold aisle designs, servers running way cooler than they need to be and peak power requirements leading to overly expensive power/cooling costs. PUE for these closer to 2.0 than GCE is to 1.0.

If you have something like GCE where you can control for all of those, i.e run the DCs hot, eliminate transient peaks, source power cheaply and use super efficient cooling like evaporative or geothermal pumped water etc then yeah, it's a completely different ballgame.

It's pretty safe to assume all the hyperscalers are doing all of these things too, they aren't stupid. :)

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by aylmao on Wednesday May 03, 2023 @06:50PM (#35808884)
> It's not useful at all. It effectively measures IPC (instructions per clock), which is just chip vendor bragging rights.

+1. Moreover the author then seems to conclude from this benchmark:

> Overall, these numbers suggest that the Qualcomm processor is competitive.

This is an odd conclusion to draw from this test and these numbers, given how little this benchmark tests (just string operations). Does this benchmark want to test raw CPU power? Then why "normalize" to 3GHz? Does it want to test CPU capabilities? If so why use such a "narrow" test?

IMO this benchmarking does for a good data-point, but far from enough to draw much of a conclusion from.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by xoa on Wednesday May 03, 2023 @09:23PM (#35810129)
>For desktop devices "instructions per dollar" would be most relevant.

Well, it's one measure, but scaling potential and absolute performance limit matters as well. In use cases where a desktop is performing work to help one or more humans, the cost of salary and other support may utterly drown out even a very expensive extremely high power system. Ie., a 1200W workstation being used at maximum power 10 hours a day 365 days a year (an absurd utilization ratio) at $0.15/kWh (average US electricity cost) would still only be around $650/year. If it boosted the productivity of a typical tech worker even 1% it'd pay for itself no problem. It's easy to lose sight sometimes of how historically incredible the bang for the buck is in tech.

I think it's important to remember because some designs that do incredibly well at small sizes run into challenges scaling. Like with CPUs, the nature of silicon fabrication makes it ever more difficult to grow a monolithic die. Switching to a chiplet-based design does mean absolute efficiency and minimum power challenges amongst others, but dramatically improves scalability at the high end. It's a sort of infrastructure tradeoff. Apple for example has done incredibly well with its big silicon SoCs from handhelds to portable Macs, but it's been struggling to do a Mac Pro or even updated Studio. It's not clear that they physically can do something on the level of a modern Epyc chip anymore than Intel could with monolithic Xeons.

So normalized performance/watt and performance/$ and so on do matter, but absolute final density and scale up are another part of the matrix for certain use cases too.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by jnsaff2 on Thursday May 04, 2023 @08:27AM (#35814213)
Your tech worker only gets about 4.1 days of not working? Wow.

That aside, I think it would be more important to look at the carbon emissions impact of code/cpu's.

That one person parsing urls might save few hundred dollars of not optimising their code but if it is being used billions of times a day the energy (and therefore emissions) impact can be huge.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by Aeolun on Wednesday May 03, 2023 @09:56PM (#35810357)
Maybe for you? If I’m looking at a new CPU for my desktop the only thing really relevant is how many instructions it can crank out per second.

I’m not trying to optimize for cost or energy efficiency.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by gpderetta on Thursday May 04, 2023 @04:40AM (#35812748)
Instruction per seconds is an useful perfromance metric. Instruction per clock isn't.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by adfghuibnuio on Wednesday May 03, 2023 @10:24PM (#35810541)
It's pretty amusing to me how the Megahertz Myth has been inverted nowadays. It used to be everyone cared about the fastest clock speed and irrationally discounted IPC. Now people care about IPC and irrationally discount clock speed. Pretty weird, in my opinion.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by saagarjha on Thursday May 04, 2023 @02:03AM (#35811734)
Clock speed is comparatively easier to boost.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by foobiekr on Wednesday May 03, 2023 @10:33PM (#35810582)
Your typical DSP beats your typical CPU on power and instructions/sec/dollar by a pretty wide margin.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by gpderetta on Thursday May 04, 2023 @04:41AM (#35812760)
You have to measure effective (not theoretical peak) instructions on a specific workload.

DSPs will beat CPUs on DSP workloads, but, as expected, utterly fail for any general purpose workload.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by foobiekr on Friday May 05, 2023 @12:25AM (#35825206)
Clearly so.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by stingraycharles on Wednesday May 03, 2023 @04:37PM (#35807439)
In my totally unscientific (but consistent) benchmarks for our CI build servers, m6g.8xlarge compile our c++ codebase in about 9.5 minutes, where m6a.8xlarge takes about 11 minutes. The price difference is about 20% as well iirc, so it’s generally a good deal.

Of course the types of optimisations that a compiler may (or may not) do on aarch64 vs x86_64 are completely different and may explain the difference (we actually compile with -march=haswell for x86_64), but generally Graviton seems like a really good deal.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by foota on Wednesday May 03, 2023 @05:36PM (#35808116)
You're probably leaving a lot of performance on the floor if you're building for haskell and running on skylakeish or newer.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by nickpeterson on Wednesday May 03, 2023 @05:46PM (#35808216)
*haswell, in case the Haskell people come after you.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by speed_spread on Wednesday May 03, 2023 @06:25PM (#35808629)
"don't poke the endofunctor"
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by paulddraper on Wednesday May 03, 2023 @06:06PM (#35808430)
Ah, that makes more sense.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by stingraycharles on Thursday May 04, 2023 @01:05AM (#35811441)
Yeah we know, it’s just that we ship these binaries to customers and need a reasonably old architecture that we know “almost everyone” uses.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by Aeolun on Wednesday May 03, 2023 @10:00PM (#35810391)
Why not use the c type instances? Is the compilation memory bound? I’d expect it to be the cpu that’s the limiting factor.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by stingraycharles on Thursday May 04, 2023 @01:04AM (#35811431)
Heavy C++ template metaprogramming, we need up to 4GB of memory per process in some situations.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by deltaci on Wednesday May 03, 2023 @04:22PM (#35807254)
It's a benchmark of GitHub Actions(Azure) vs a really old Macbook Pro 15, not exactly what you are looking for, but it tells the vibe already.

https://buildjet.com/for-github-actions/blog/a-performance-r...

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by 015a on Wednesday May 03, 2023 @04:37PM (#35807438)
This is a big, general problem with CI providers I don't hear talked about enough: because they charge per-minute, they are actively incentivized to run on old hardware, slowing builds and milking more from customers in the process. Doubly-so when your CI is hosted by a major cloud provider who would otherwise have to scrap these old machines.

I wish this were only a theoretical concern, a theoretical incentive, but its not. Github Actions is slow, and Gitlab suffers from a similar problem; their hosted SaaS runners are on GCP n1-standard-1 machines. The oldest machine type in GCP's fleet, the n1-standard-1 is powered by a variety of dusty, old CPUs Google Cloud has no other use for, from Sandy Bridge to Skylake. That's a 12 year old CPU.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by AnthonyMouse on Wednesday May 03, 2023 @05:45PM (#35808212)
There are workloads where newer CPUs are dramatically faster (e.g. AVX-512), but in general the difference isn't huge. Most of what the newer CPUs get you is more cores and higher power efficiency, which you don't care about when you're paying per-vCPU. Which vCPU is faster, a ten year old Xeon E5-2643 v2 at 3.5GHz or a two year old Xeon Platinum 8352V at 2.1GHz? It depends on the workload. Which has more memory bandwidth per core?

But the cloud provider prefers the latter because it has 500% more cores for 50% more power. Which is why the latter still goes for >$2000 and the former is <$15.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by 015a on Wednesday May 03, 2023 @07:18PM (#35809157)
> Which vCPU is faster, a ten year old Xeon E5-2643 v2 at 3.5GHz or a two year old Xeon Platinum 8352V at 2.1GHz? It depends on the workload.

It really does not depend on the workload, when those workloads we're talking about are by-and-large bounded to 1vCPU or less (CI jobs, serverless functions, etc). Ice Lake cores are substantially faster than Ivy Bridge; the 8352V will be faster in practically any workload we're talking about.

However, I do agree with this take, if we're talking about, say, lambda functions. The reason being that the vast majority of workloads built on lambda functions are bounded by IO, not compute; so newer core designs won't result in a meaningful improvement in function execution. Put another way: Is a function executing in 75ms instead of 80ms worth paying 30% more? (I made these numbers up, but its the illustration that matters).

CI is a different story. CI runs are only bound by IO for the smallest of projects; downloading that 800mb node:18 base docker image takes some time, but it can very easily and quickly be dwarfed by all the things that happen afterward. This is not an uncontroversial opinion; "the CI is slow" is such a meme of a problem at engineering companies nowadays that you'd think more people would have the sense to look at the common denominator (the CI hosts suck) and not blame themselves (though, often there's blame to go around). We've got a project that can build locally, M2 Pro, docker pull and push included, in something like 40 seconds; the CI takes 4 minutes. Its the crusty CPUs; its slow networking; its the "step 1 is finished, wait 10 seconds for the orchestrator to realize it and start step 2".

And I think we, the community, need to be more vocal about this when speaking on platforms that charge by the minute. They are clearly incentivized to leave it shitty. It should even surface in discussions about, for example, the markup of lambda versus EC2. A 4096mb lambda function would cost $172/mo if ran 24/7, back-to-back. A comparable c6i-large: $62/mo; a third the price. That's bad enough on the surface, and we need to be cognizant that its even worse than it initially appears because Amazon runs Lambda on whatever they have collecting dust in the closet, and people still report getting Ivy Bridge and Haswell cores sometimes, in 2023; and the better comparison is probably a t2-medium @ $33/mo; a 5-6x markup.

This isn't new information; lambda is crazy expensive; blah blah blah; but I don't hear that dimension brought up enough. Calling back to my previous point: Is a function executing in 75ms instead of 80ms worth paying 30% more? Well, we're already paying 550% more; the fact that it doesn't execute in 75ms by default is abhorrent. Put another way: if Lambda, and other serverless systems like it such as hosted CI runners, enables cloud providers to keep old hardware around far longer than performance improvements say it should be; the markup should not be 500%. We're doing Amazon a favor by using Lambda.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by throwaway2990 on Wednesday May 03, 2023 @09:17PM (#35810083)
Lambda is not crazy expensive. It’s expensive if you’re running something 24/7 in place of a physical server or VM.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by spockz on Wednesday May 03, 2023 @11:54PM (#35811009)
It would be nice if I could still use all lambda functionality and tooling but instead have it running in my own vms with long time commitment.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by throwaway2990 on Thursday May 04, 2023 @12:38AM (#35811271)
Not quite sure I follow. But I built an asp.net api and deployed it into lambda and it cost $2/m and when it started to get more traffic and the cost got to $20/m I moved it to a t4g instance.

When I moved it, I didn’t need to make any code changes :) I just made a systemd file and deployed it.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by icedchai on Wednesday May 03, 2023 @09:36PM (#35810225)
Lambda is good for bursty, typically low activity applications, where it just wouldn't make sense to have EC2 instances running 24x7. There about some line-of-business app that gets a couple of requests every minute or so. Maybe once a quarter there will be a spike in usage. Lambda scales up and just handles it. If requests execute in 50ms (unlikely!) or 500ms, it just doesn't matter.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by AnthonyMouse on Thursday May 04, 2023 @03:04AM (#35812198)
> It really does not depend on the workload, when those workloads we're talking about are by-and-large bounded to 1vCPU or less (CI jobs, serverless functions, etc). Ice Lake cores are substantially faster than Ivy Bridge; the 8352V will be faster in practically any workload we're talking about.

If you were comparing e.g. the E5-2667v2 to the Xeon Gold 6334 you would be right, because they have the same number of cores and the 6334 has a higher rather than lower clock speed.

But the newer CPUs support more cores per socket. The E5-2643v2 has 6, the Xeon Platinum 8352V has 36.

To make that fit in the power budget, it has a lower base clock, which eats a huge chunk out of Ice Lake's IPC advantage. Then the newer CPU has around twice as much L3 cache, 54MB vs. 25MB, but that's for six times as many cores. You get 1.5MB/core instead of >4MB/core. It has just over three times the memory bandwidth (8xDDR4-2933 vs. 4xDDR3-1866), but again six times as many cores, so around half as much per core. It can easily be slower despite being newer, even when you're compute bound.

> We've got a project that can build locally, M2 Pro, docker pull and push included, in something like 40 seconds; the CI takes 4 minutes. Its the crusty CPUs; its slow networking; its the "step 1 is finished, wait 10 seconds for the orchestrator to realize it and start step 2".

Inefficient code and slow hardware are two different things. You can have the fastest machine in the world that finishes step 1 in 4ms and still be waiting 10 full seconds if the system is using a timer.

But they're operating in a competitive market. If you want a faster system, patronize a company that provides one. Just don't be surprised if it costs more.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by nwmcsween on Thursday May 04, 2023 @08:18PM (#35823860)
For this to be true IPC would have to have stagnated for 10 years which is not the case. Look at Agner's instruction tables for different uarchs and compare.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by willcipriano on Wednesday May 03, 2023 @05:04PM (#35807782)
Sometimes when I run a lot of builds in a short period of time I feel like I get demoted to the slower boxes.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by pr0zac on Wednesday May 03, 2023 @07:00PM (#35808986)
It feels like a pretty useless benchmark as far as translating to real world performance but for the heck of it I did ten benchmarks on my three year old Thinkpad with a 4.5Ghz Intel i7-9750H running Ubuntu and got a best of ns/url=225.63 and worst of ns/url=275.118 whatever those scores mean.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by nspattak on Thursday May 04, 2023 @05:28AM (#35813029)
The author very clearly and explicitely says in the post that this is "purely to help us think".
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by tlamponi on Thursday May 04, 2023 @06:46AM (#35813490)
On my (not idle) i7-12700K with DDR5 4800 memory Workstation, using Proxmox VE 7.4 (based on Debian 11) with our 6.2 based Linux kernel, I get something between 139.44 ns/url and 140.66 ns/url (ran it about 10 times in a row), so 1.35x faster than the M2.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by heredoc on Thursday May 04, 2023 @02:08PM (#35819679)
I constantly get between 154 and 156 ns/url when running on an M2 Air 2022 while using asahi linux instead of MacOs. 22 Celsius according to smartmontools :)
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by tlamponi on Friday May 05, 2023 @04:56AM (#35826839)
So seems a good part of the speed-up comes from using the Linux kernel, which tbh. doesn't really surprise me. It's hard to match the engineering amount and quality getting poured into it (well at least the core stuff, some niche driver will be a mess like everywhere). The remainder then comes from modern x86_64/amd64 CPU combined with DDR5 beating the M2, well at least in this micro benchmark.
Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by StillBored on Thursday May 04, 2023 @04:27PM (#35821622)
One of the comments on the article notes a 7950x doing "time/url=109ns"

so I tossed it on my 5950x and it reports "ns/url=148.994" which is about right from what I understand (zen4 gets a nice ~30% bump on a number of Linux benchmarks over zen3), here its 35% with only a 16% clock advantage.

Which is about the diff between the M2 and my old 5950X in a generation older process/etc.

So, yah current M2 slower than previous gen Intel and AMD both in this benchmark.

Re:Graviton 3, Apple M2 and Qualcomm 8cx 3rd gen: a URL pars... by eek2121 on Thursday May 04, 2023 @07:53PM (#35823669)
perf/watt/density would be the best way to measure. Frequency should NOT be normalized because x86 chips are designed to be high frequency parts. That is why measuring IPC is meaningless. A cutting edge ARM chip can possibly beat a modern x86 chip in terms of IPC, but the x86 chip will almost certainly scale to higher frequencies. Certain models of EPYC Genoa (Zen 4) for example, boost to 4GHz, and both Intel and AMD have chips that boost to 5.7+ GHz.

Density is important because if you can only have a max of, for example, 20 cores for an ARM solution, but 96 cores in the case of EPYC Genoa, Genoa is going to win out for any multi-core workload.