219 points · by ingve · 5y ago · 232 comments
After upgrading our app's dependency chain to run native arm64 builds (which took a bit of googling) webpack's incremental build time on our app is down to 116ms from 983ms on my 2016 Macbook Pro. Over 8x faster.
Our Tensorflow.js (webgl) models that previously ran about 8fps in the browser are now running at the camera's native 30fps framerate. (Similar to my desktop 2080ti.)
(FWIW, my WindowServer usage is generally around 3-8% when idling and I am losing about 6% an hour at the moment.)
I think I want to just use this machine fresh and just move a few files over as needed.
So glad I went with the spec I did, all the power I need with room to grow.
I don't think people will be moving away from webpack for awhile, but transpilation is often a very expensive part, and `swc` is very near to stable, and as a transpiler / polyfilling tool it's pretty fast.
Because buying new stuff is wasteful and only a temporary solution to the problem?
Look, I like nice, fast machine as much as the rest of the crowd here, but let's not kid ourselves. In a years time the software we run on it will have become even more bloated and things will be just as slow as they were. And then a new machine comes out we all want to buy that.
There will be some ecstatic blog posts again. Which is weird, I think. Needing a faster machine for you daily work should feel like defeat for a developer.
If you need a new laptop and can afford it, by all means go ahead and indulge. In the mean time, I am typing this from a 7 year old Latitude that I use every day for software development and that shows no sign of aging, apart from some scratches. And each time I read a post like this I wonder: what do these people _do_ with these machines?
Would you mind sharing your research results?
I am getting one soon and I am in progress of drafting notes for stuff like migration & setup.
We were still on node 12 because, until recently, Google Cloud Functions didn’t support anything newer. But when I installed it, I noticed it was running on x86 via Rosetta. So I upgraded to the latest node (17) which installed as native arm64.
Almost everything “just worked” but there were build errors with installing: webpack, node-sass, gprc, and node-canvas.
Webpack turned out to be an issue with node current (17) so downgrading to lts (which is currently 16) worked.
That seems to have magically fixed the gprc build too.
We weren't actually using node-sass anymore; so removed that dependency.
Upgrading node-canvas to 2.8.0 and building from source (after installing its dependencies via homebrew) seems to have worked.
All in all it took maybe 2 hours to follow all the rabbit holes. And our whole engineering team is going to move over to arm64 as soon as Apple can deliver their machines.
I’m hoping for a mid-tier unit though - a rebirth of the G4 Cube as a “Mac Mini Pro”
I daily drive an M1 mini now and abuse the hell out of it. I’ve never heard the fan. It’s a remarkable device. I was installing a Homebrew package the other day on my i7 MacBook Pro and the fans kicked on - it almost startled me - I had forgotten about active cooling.
Those sockets need to communicate with each other, and extremely quickly. And that I/O is very, very expensive in terms of power. Even with that you still end up with poor performance scaling, especially with anything that isn't numa aware (which almost nothing is)
So no, that extrapolation doesn't make sense. But even ignoring that missing cost, 8x M1 Max's would be ~800w, give or take. That would work in a Mac Pro replacement, but that'd still be a significant power increase over many of the existing models.
Here's EPYC 7601's "IF" power (it's really all the uncore power) vs. the core power.
Going outside the chip means swinging lots of capacitance up and down, and modern interconnects swing that capacitance fast.
That will be one of those shut up and take my money moment. Given how they have been going retro or paying tribute to past design in their recent new product lineup I am hoping a G4 Cube revival is actually within a possibility.
Replicating the capabilities of the Mac Pro with would require another model of M1 and for the volumes the Mac Pro sells I do not believe developing a dedicated lithography mask makes sense. Besides, most of the unique capabilities of the Mac Pro are divergent with vision of the M1:
- PCIe slots, there are no GPUs compatible with Arm Mac and some of the functionality of the Afterburner card has been integrated into the M1 Max
- Lots of RAM, as seen with the lower RAM models of Mac Book (Air) Apple is increasingly relying on swapping to the fast SSD.
But performance, even with half the ram, was still stellar. Everything remains speedy, even when it's doing far too much.
And I don't think Apple would even want to be competitive in this segment.
Would love to have reasonably costed m1 instances but the value play for us is ampere.
So, what you're left with, is a 64 core M1. Which is still going to be less efficient than a Threadripper, an EPYC or even a Xeon (and that's quite sad) at multithreaded tasks, and, knowing Apple, about twice as expensive.
For example, a piece of code I was optimizing recently ran with very little variation in time between runs on my M1 system, but had ~30% variation on a similarly loaded Intel Mac. Changing the QoS level to Default instead of Utility allowed the Intel Mac to perform much more consistently on the benchmark, but made no difference on the M1 (I have good reason to leave it at Utility in my actual application, but for benchmarking it made sense to try other levels).
I found it hard to tell from the article, but it sounds like on the M1 Pro maybe the two highest QoS levels (interactive and user initiated) now preferably map to p cores 0-3, and maybe now default and utility map to p cores 4-7, and then background gets the e cores?
> it sounds like on the M1 Pro maybe the two highest QoS levels (interactive and user initiated) now preferably map to p cores 0-3, and maybe now default and utility map to p cores 4-7
That seems unlikely, though I don't have an M1* device what feels more likely is that the two clusters are independently powered (the turbo-ing works on a cluster basis so that's almost certain), therefore the machine favors fully loading the first one before it starts "spilling" to the second (and thus has to power it up).
With that said, there is a huge M1 hype on HN. It reminds me of the 64-bit ARM hype when someone benchmaked encryption (because ARMv8 has AES instructions) and everyone were made to belive that the new iPhone would be 3-4 times faster.
The main thing driving this is that people are comparing a new M1 to their Intel Mac laptops with processors from ~2016 and then naturally it's a marked improvement because it's being compared to a five year old machine.
You compare them to a modern Intel or AMD system and they're competitive. They win some and lose others. Much was made about the M1 Max taking the single thread performance crown; for less than a month. Golden Cove from Intel just took it back. It's plausible that it will be AMD's again in a couple months when we get Zen 3 with 3D V-Cache.
They're all within single digit percentages of each other and the winner is whoever released their top end processor most recently.
This is quite misleading in multiple ways.
The M1 Max has the same single thread performance as the M1, which has been out for around a year.
You're also comparing Intel's latest desktop CPU to a laptop CPU. Before the M1, a laptop CPU competing with the highest-end consumer desktop CPU in multi-core OR single-core was unthinkable and had never happened. Yes, there have been leaks in which Alder Lake's mobile CPU beats the M1, but we don't know whether these benchmarks are representing the numbers we'll be seeing in consumer laptops with laptop cooling.
That being said, I hope there will be competition!
I compared my 2014 MBP to 2019 MBP and there was no marked difference. It was running hot and eating battery very fast. 2019 Intel Mac and 2020 M1 Mac are two completely different animals. Also, the price drop for a better-performing machine was jaw-dropping.
I mean, yes, somewhat, in (almost comically) high power desktop configurations, depending on which benchmark you believe. This is of cold comfort to anyone who wants a fast laptop, though.
M1 macs are just really damn fast for daily usage.
My M1 Macbook Air blows my 16" out of the water in every conceivable way. I'd elaborate but there seriously isn't any dimension of it that isn't an improvement. Maybe the smaller display?
That is the issue though. Intel macbooks were notoriously badly cooled. That hurts the performance a lot. If all you have used is that, of course you find the new one a lot better. However, compared to any other high end Intel/AMD laptop, you would not perceive this much difference in speed.
Pick up a Macbook 16 and XPS 15 from 2019 with the same specs (CPU/RAM) and the XPS absolutely runs circles around the macbook when it comes to general responsiveness in UI. All because of cooling.
I wonder how much of that is due to a "finally, a good laptop" sentiment. I have used a lot of laptops over the years, and each and every one of them have been terrible in lots of ways, especially recently. If M1s "solve" the laptop problem, that would be great.
It's less powerful than a modern desktop, but not by much. More importantly, none of the power management, suspend, wifi, whatever... ever seems to fail.
other tools like the Dash app are also amazing tools to speed up the development process. It will take some getting used to moving from Windows and to a far lesser extent linux, however with the right tools for the job you will end up being more productive and less frustrated. Especially compared to Windows.
Unless I need something that specifically only runs on Windows, I would use Mac/Linux over it any day of the week. For productivity it's Mac > Linux >>> Windows for me.
A lot of the pthreads books I see are from the late 90s. Is there a more recent reference? What's the best way to write cross-platform (e.g. not Grand Central Dispatch) multithreaded apps with these new chip architectures?
They move everything that isn't foreground to an efficiency core, which is awful for compiling or video processing.
There's apparently a BIOS option that will use ScrollLock for disabling the efficiency cores entirely.
This is front of mind for me since reading a Cloudflare blog regarding AVX-512 instructions invoking dynamic frequency scaling to manage power/thermal capacity on chip. (https://blog.cloudflare.com/on-the-dangers-of-intels-frequen...)
If this is happening on Xeons, it's probably happening on consumer dies as well, in addition to other non-obvious power/performance optimizations. Perhaps this is why Alder Lake is pumping up the TDP[1]?
Windows has had that (foreground boost) for a long time, Intel probably piggybacks on it. It'll be interesting to see how it will behave on Linux, which AFAIK never had that mechanism (except perhaps on Android).
For the Mac, I believe you have equivalent access for scheduling between posix and GCD, but the scheduling configuration is likely way more approachable in GCD.
Also: On M1, there is an added capability to run in a stricter memory model to speed up x86_64 emulation. This only is available on the performance cores, which is one of the reasons people observe non-native code draining the battery quicker.
But as to the latter assertion, you're indeed correct per Joe Groff (Swift compiler engineer at Apple): https://twitter.com/jckarter/status/1332045390057639939
> The A12 only supported TSO on the performance cores. The M1 supports it on all cores.
https://scholar.google.com/scholar?hl=en&as_sdt=0%2C33&q=asy...
Eh, maybe. I'm not inclined to rely on the reported % CPU usage to represent anything useful. For example, it's very easy to be at 100% CPU when you're actually spending most of that time waiting for memory reads.
I have seen on linux that I can be running something that uses 100% and the cpu is at 50c, then I run prime95 also at 100% and the cpu instantly hits 99c
It's a simple metric, but it can be complicated to relate it to what is going on with execution because the real system is very complicated.
The CPU % metric does not take into account execution strength, of the CPU, big vs small, dynamic CPU frequency, or effect that one CPU might have on another (e.g., SMT or shared caches or memory controllers).
Further complicating it is that the Linux CPU scheduler is not work-conserving. So you could have at least 100 application threads runnable at any given moment in your workload, but your 64 CPU system might only be hitting 80% CPU busy.
Then you get to application and kernel effects of course, locking, blocking, etc. can mean you don't even have as many runnable threads as you might think.
Then how all this actually relates to the work and heat the system creates is another matter again. Simple integer execution might only use half the CPU power of a vector heavy workload because you have fewer transistors clocked or switching (or even powered) in the core.
Consider this: 1. 14” or 16” custom miniLED display 2. Anodized one-piece aluminum clamshell 3. Completely custom SoC (much more expensive than buying Intel’s latest, at least in the short-term) 4. Completely custom OS with a full suite of native apps 5. Custom MagSafe adapter 6. Thunderbolt 4 (3 of them)
Now consider that this laptop outperforms most desktop workstations that cost $4k+…and does it on 16h of battery life.
If you’re in the market for a high-performance computer, you’d have to be dense to not buy one of these (or building x86 firmware)
> If you’re in the market for a high-performance computer, you’d have to be dense to not buy one of these (or building x86 firmware)
I'd love to see which $4000+ desktop gets beaten by any M1 processor. $4000 is A LOT for a desktop computer. I paid (in total, with upgrades over the years) around ~$1600 and easily beats anything provided by Apple.
I'd really want to see that setup and benchmark
That might've been for when it was only an 8GB increase in RAM.
This sounds very unlikely? Apple has been building their own silicon for a decade, I am sure they are saving significant money on their chips.
You can spec the 14” & 16” to well past $4k also.
a Ferrari sports car is very 'expensive' and not many ppl can afford it, a Ferrari at 35% discount is a great deal but still 'expensive' for most ppl.
Bringing this back to the M1 Macs, I think what you get for your money in terms of computing, power consumption and build quality is simply amazing ! I think few can argue that. But in terms of 'absolute money', I def won't be able to afford a new M1 not when a "decent-workhorse" laptop cost about $900-$1400.
Not saying I don't want one ! I absolutely do,but my broke ass can't afford one :/
Before the M1 Air an entry-level MBP was the only "serious" choice for productivity. Even if you weren't a professional, an Air could be limiting.
Now we have an $800 laptop that can compete with the previous MBPs. The MBP can actually be a pro-only machine.
I guess also, are the 4 unused cores always the same?
As far as which cores are demoted… I definitely don’t know enough to speculate. If favoring the same set would affect longevity of the device, they’d rotate. If not it’s simpler not to do that. I have no idea which is more likely.
“I suspect that Apple has done this to further improve energy efficiency and ensure good responsiveness to new CPU-intensive tasks.”
Probably the "high power" mode available on an M1 Max in a 16" chassis is doing just that. And maybe Apple will decide to treat some kind of new iMac Pro as more of a pro machine, and make it chunky enough to dissipate that sort of heat without needing much fan noise...
Obviously a 'Pro' version of the iMac is coming eventually with a larger screen but I don't think many people expected that yet. Maybe February or so next year...
Also, even a huge company like Apple would want to stagger releases so design teams can have some constant workload. Releasing laptops and a new Mini and a new iMac would put quite some work on the team and then it would be idle for a time. They are probably done with the Mini and working on a Mac Pro right now.
My 15.4" can scale to "looks like 1920x1200" and the 14" to "1800x1169" so there's not a lot of difference. Does the smaller size make it feel cramped?
That the 16" also has more battery and better cooling don't hurt any, but they're the cherry on top.
That would equate to less "real estate" than what I have on my T460s FHD screen? Of course the screen would be light years ahead to look at. But just sounds a little bit strange with regards to actual pixels/space on the screen?
Yes, Apple doesn't provide for running at the native resolution out of the box (utilities like SwitchResX make those options available, though I don't know if they work with the M1s yet), all the display modes they propose are scaled.
Historically there was a default mode at 2x scaling with 2 above and 2 below, apparently on the M1s the default 2x scaling is the second-to-last and you only have one mode above.
So on the 14" with a physical 3024 x 1964 display, the modes provided natively by macOS are:
1800 x 1169 (1.68x)
1512 x 982 (2x, default)
1352 x 878 (2.24x)
1147 x 745 (2.64x)
1024 x 665 (2.95x)
Don't ask me why they selected these wonky-ass resolutions aside from the 2x one though. The 1024 one could make some sense but it seems like adjusted luck: the 16" bottoms out at 1168 instead. Could be a question of pixel density I guess but you'd have to run the computation.Don't skimp on RAM or buy into the hype that ARM halves the amount of required RAM - it's total BS.
https://github.com/srijs/rust-crc32fast/pull/6
(Get rust nightly via https://rustup.rs, pull the repo, run: cargo bench --features nightly)
test result: ok. 0 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests (target/release/deps/bench-b9bcbb53a5ef2c28)
running 4 tests
test bench_kilobyte_baseline ... bench: 310 ns/iter (+/- 70) = 3303 MB/s
test bench_kilobyte_specialized ... bench: 48 ns/iter (+/- 5) = 21333 MB/s
test bench_megabyte_baseline ... bench: 298,273 ns/iter (+/- 42,157) = 3515 MB/s
test bench_megabyte_specialized ... bench: 45,100 ns/iter (+/- 7,249) = 23250 MB/s
test result: ok. 0 passed; 0 failed; 0 ignored; 4 measured
-----------------------------------------------------------(14-inch, 2021) - Apple M1 Max - 64gb
test result: ok. 0 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests (target/release/deps/bench-3eea1c397faf4328)
running 4 tests
test bench_kilobyte_baseline ... bench: 223 ns/iter (+/- 8) = 4591 MB/s
test bench_kilobyte_specialized ... bench: 100 ns/iter (+/- 0) = 10240 MB/s
test bench_megabyte_baseline ... bench: 231,689 ns/iter (+/- 1,885) = 4525 MB/s
test bench_megabyte_specialized ... bench: 122,382 ns/iter (+/- 4,651) = 8568 MB/s
test result: ok. 0 passed; 0 failed; 0 ignored; 4 measuredAnd the 5nm M1 has ~2.5Gflops/W which is not a huge increase compared to the 28nm Pi 4 at 2Gflops/W.
No-moores law in effect. Game Over!
Just want something that is more "apples to apples" (no pun intended but yes... lol)
Edit: Ok that is some sort of SIMD/GPU... I need figures for the raw CPU that can also do general purpose calculations and branches!
Maybe MIPS is a better "apples to apples" measurement?