Live data from Hacker News

Apple’s M1 processor and the full 128-bit integer product

lemire.me

71–80 of 180 posts

Re: Apple’s M1 processor and the full 128-bit integer product

#71
post #16

Anyone want to take a guess at how long it will be until Apple has their own fab in the US making M1 chips?

TSMC already announced a new fab in Arizona that will start delivering chips ~2024. Apple does not need to own a fab, they just need to diversify their chip supply chain.

Re: Apple’s M1 processor and the full 128-bit integer product

#72

I love my M1, but does anyone else have horrific performance when resuming from wake? It’s like it swaps everything to disk and takes a full minute to come back to life.

Instant wake for me. However any time I come across a password field in a website the computer freezes for a painfully long 10 seconds or so while it presumably decrypts my password vault. Sometimes this will happen multiple times per page load if I deselect and reselect the password field.

Oh goodness I thought this was just me after searching online and finding very little, if any, discussion of the bug. The issue I had wasn't on password login prompts, but on account creation prompts (i.e. password+confirm password). I had assumed it was lastpass at first, but the freeze persisted even after removing that -- on a one-day old computer.

Re: Apple’s M1 processor and the full 128-bit integer product

#73

Earlier quoted context omitted.

Not in the next 10 years. Why would they? Fabs are extremely capital-intensive and take years to get up and running, when (like Taiwan Semi) knows how to do it. Intel has shown how hard it can be to do this right. Let TSM work on production (and hopefully get more/larger fabs in the USA up and running) and getting better at packing in the transistors, and let Apple improve the design (and software).

Why would they make their own M and A processors? They could continue to buy Intel chips and revert back to using PortalPlayer and Samsung chips. Chip designing is capital intensive and takes years to get up and running, when Intel and Samsung know how to do it.

Designing chips isn’t capital intensive, making them is.

Re: Apple’s M1 processor and the full 128-bit integer product

#74

Earlier quoted context omitted.

they are addicted to cheap labor.

How much labor is involved in semiconductor manufacturing? It's mostly automated, right?

To a man carrying an axe, everything is a tree.

Re: Apple’s M1 processor and the full 128-bit integer product

#75

Earlier quoted context omitted.

Not in the next 10 years. Why would they? Fabs are extremely capital-intensive and take years to get up and running, when (like Taiwan Semi) knows how to do it. Intel has shown how hard it can be to do this right. Let TSM work on production (and hopefully get more/larger fabs in the USA up and running) and getting better at packing in the transistors, and let Apple improve the design (and software).

Why would they make their own M and A processors? They could continue to buy Intel chips and revert back to using PortalPlayer and Samsung chips. Chip designing is capital intensive and takes years to get up and running, when Intel and Samsung know how to do it.

They did buy PA Semi to get off the ground. TSMC is probably way too expensive though.

Re: Apple’s M1 processor and the full 128-bit integer product

#76
post #37
post #16

Anyone want to take a guess at how long it will be until Apple has their own fab in the US making M1 chips?

With Apple holding a lot of cash offshore awaiting for a favourable way to onshore it, combined with the political eagerness to bring chip production onshore. Those two aspect may well pan out to a situation in which the accountants see it as a win win. Even then, do Apple use enough chips to justify running a fab, let alone one that would be locked into the node of the time. I really don't see it happening for many…

They would be better off paying the taxes. Making chips isn’t a tax dodge, it’s a hugely expensive many year commitment.

Re: Apple’s M1 processor and the full 128-bit integer product

#77

Earlier quoted context omitted.

Yes. This is actually a known issue, provided you have an external monitor attached; lots of people complaining about it. The Mac actually wakes up instantly if you lift the screen, but it usually takes 5-10 seconds before it will wake up the external monitor. Worse, for some of us when it does finally wake up the monitor, sometimes it wakes it up with all the wrong colors, and rebooting is the only reliable fix. (an…

For me it's maybe 5-10 seconds for it to wake my Thunderbolt monitor (LG 4K) from "cold". It's much faster if the monitor has been used recently, though, so I always figured it was the monitor that was causing the delay by going into some deep sleep state?

Same monitor. The workaround is to put the monitor on a power strip you can trigger when you walk up to it. Hard power off/on of this monitor and it instantly displays for me now.

Re: Apple’s M1 processor and the full 128-bit integer product

#78

Earlier quoted context omitted.

Not in the next 10 years. Why would they? Fabs are extremely capital-intensive and take years to get up and running, when (like Taiwan Semi) knows how to do it. Intel has shown how hard it can be to do this right. Let TSM work on production (and hopefully get more/larger fabs in the USA up and running) and getting better at packing in the transistors, and let Apple improve the design (and software).

They’ve vertically integrated everything else, and they’ve had great success along the way. TSMC has other customers that compete with Apple for production capacity. And there’s geopolitical risk in the region where TSMC (currently) operates.

> They’ve vertically integrated everything else, and they’ve had great success along the way.

Why would they want to get into the low-margin, high-risk part of their supply chain, the bit where you can sink billions of dollars and have the value wiped out by a poor choice?

Re: Apple’s M1 processor and the full 128-bit integer product

#79

Earlier quoted context omitted.

Not in the next 10 years. Why would they? Fabs are extremely capital-intensive and take years to get up and running, when (like Taiwan Semi) knows how to do it. Intel has shown how hard it can be to do this right. Let TSM work on production (and hopefully get more/larger fabs in the USA up and running) and getting better at packing in the transistors, and let Apple improve the design (and software).

But Apple has a lot of capital, and could win massive political brownie points for doing so, especially if they promised that some percentage of fab capacity would be sold to other American firms.

[deleted]

Re: Apple’s M1 processor and the full 128-bit integer product

#80
post #67
post #60

Earlier quoted context omitted.

The blog post links to the benchmark... It's repeatedly populating a 20k entry array with the results. godbolt clang compiles it to: .LBB5_2: // =>This Inner Loop Header: Depth=1 mul x13, x11, x10 umulh x14, x11, x10 eor x13, x14, x13 mul x14, x13, x12 umulh x13, x13, x12 eor x13, x13, x14 str x13, [x0, x8, lsl #3] add x8, x8, #2 // =2 cmp x8, x1 add x11, x11, x9 b.lo .LBB5_2 [1] https://github.com/lemire/Code-used-o…

Thanks for the link. Just staring at the machine code, it looks like the hottest loop for wyrng is about 10 instructions with a store in it. If the processor can do that loop in 1 cycle on average then...holy fuck. edit: I was looking at similar code generated by clang on my machine. Again, holy fuck. I don't think the story here is that 64x64=128 multiply is fast, honestly. The real story is the insane level of spec…

Based on the information from [1] we have something like this for both loops:

    .LBB0_2:
            eor     x13, x9, x9, lsr #30     # 2 \* p1-6
            mul     x13, x13, x11            # 1 \* p5-6
            eor     x13, x13, x13, lsr #27   # 2 \* p1-6
            mul     x13, x13, x12            # 1 \* p5-6
            eor     x13, x13, x13, lsr #31   # 2 \* p1-6
            str     x13, [x0, x10, lsl #3]   # 1 \* p7-8
            add     x13, x10, #2             # 1 \* p1-6
            add     x9, x9, x8               # 1 \* p1-6
            mov     x10, x13                 # none
            cmp     x13, x1                  #
            b.lo    .LBB0_2                  # Fused into 1 \* p1-3
                                             # Total: 11 uops

    .LBB1_2:
            mul     x13, x9, x11             # 1 \* p5-6
            umulh   x14, x9, x11             # 1 \* p5-6
            eor     x13, x14, x13            # 1 \* p1-6
            mul     x14, x13, x12            # 1 \* p5-6
            umulh   x13, x13, x12            # 1 \* p5-6
            eor     x13, x13, x14            # 1 \* p1-6
            str     x13, [x0, x10, lsl #3]   # 1 \* p7-8
            add     x13, x10, #2             # 1 \* p1-6
            add     x9, x9, x8               # 1 \* p1-6
            mov     x10, x13                 # none
            cmp     x13, x1                  #
            b.lo    .LBB1_2                  # Fused into 1 \* p1-3
                                             # Total: 10 uops
Purely based on number of uops, there's a slight win for wyhash, all other things being equal. However, I doubt that you're really getting one iteration per second here; there are 6 integer units, and even if you perfectly exploited instruction parallelism you're limited to 6 ALU instructions per cycle, which are less than the extent of either loop. It would be possible if the mul-umulh pairs are getting fused, which would bring it down to 8 uops per iteration.

Taking into account the port distribution, each iteration of wyhash involves 4 uops being dispatched to ports 5 and 6, which means you should be getting at least 2 cycles/iteration purely for the multiplications. If it's much lower than that, the whole multiplication being fused into a single port 5-6 uop might be right.

However I can neither confirm nor deny that the loops behave like that on the M1, as I don't have one.

[1] https://dougallj.github.io/applecpu/firestorm.html

Post reply on HN