Why is Apple's M1 chip so fast?

The experience of using new poppies with M1 begins to dot the i. These chips are fast. Very fast. But why? What's the magic?





I watched a video on Youtube where the author bought the iMac last year with the maximum configuration. A machine with 40+ Gb of RAM cost him about $ 4000. He watched in disbelief as his hyper-expensive iMac was blown to smithereens by a brand new Mac mini with an M1 on board, which cost about $ 700.





, , 1 Intel . Mac . , ?





, . , Apple 1. :





  • , 1 ?





  • Apple , ?





  • Intel AMD , ?





, . , Apple , . , β€œ1 (very wide instruction decoders)”, β€œ (reorder buffer, ROB)” .. , .





, β€œWhat Does RISC and CISC Mean in 2020?β€œ. , CPU, :





  • ISA





  • (Pipelining)





  • (load/store)





  • vs -





, , .





CPU?

, Intel AMD, CPU. β€œRISC vs CISC”, , .





Very simple RISC chip, not M1.  Instructions move from memory along blue lines to registers.  The decoder detects what each instruction is and activates different parts of the CPU through the red lines.  ALU adds and subtracts numbers from registers.
RISC , 1. . , , CPU . ALU .

CPU - , , , - ALU. ALU , . , CPU. , , . , RISC , 1 :





load r1, 150
load r2, 200
add  r1, r2
store r1, 310
      
      



r1



r2



- , . RISC , . , CPU. . 150 r1



, 200 r2



. add



. οΏΌ





An old mechanical calculator with two registers: a register for storing the result (the accumulator) and a register for input information.  Modern CPUs have more than a dozen registers and they are digital, not mechanical.
: (the accumulator) . CPU , .

. , - , , . . - β€œβ€, .





M1 -

, : 1 - CPU. , . CPU - . , 1 - . CPU, GPU, , / , . (system on the chip, SoC).





M1 is a system on a chip.  This means that everything you need for your computer is already on the chip.
1- . , - .

, - Intel AMD - . .





An example of a motherboard.  Memory, CPU, graphics card, I / O controllers, network card and many other components are attached to the motherboard to communicate with each other.
. , CPU, , /, .

, Intel AMD . β€œβ€ . , , , . CPU.





 .
.

: CPU. - : .





Apple

, , Apple : . , , , , , CPU .





. GPU - . Nvidia AMD , .





Apple . , 1 :





  • CPU - β€œβ€ .





  • GPU - , .





  • ISP - .





  • (digital signal processor, DSP) - , , .





  • (Neural processing unit, NPU) - , AI.





  • (Video encoder/decoder) - .





  • (Secure Enclave) - , .





  • (Unified memory) - .





, , 1, . , , . Mac mini 1 , , iMac Intel 1. (heterogeneous) : Apple M1 foreshadows Rise of RISC-V.





  -    ,   - .
- , - .

(UMA) Apple?

, β€œ (Unified Memory Architecture, UMA)”. , .





. . , β€œ ”, β€œ ”. . , . , β€œ, ”. CPU .





CPU     ,     .
CPU , .

CPU GPU -. : CPU , , . , .





      .  ,  β€œβ€.
. , β€œβ€.

, , . , - , . -, , .





CPU GPU, . GPU β€œβ€, . , GPU CPU. β€œβ€ .





- GPU. CPU, . , : . , .





GeForce RTX 3080.
GeForce RTX 3080.

. : - CPU, , PCIe. . , .





(UMA) Apple . :





  1. CPU GPU. . , .





  2. Apple , . (low latency and high throughput). , .





  3. Apple GPU, . ARM , , Intel AMD.





, UMA - , . , , -, , CPU GPU. , , Nvidia , . Nvidia β€œ ” - , CPU GPU. Apple Nvidia , .





, Apple. , . Apple , SSD .





  Apple        .    -   ,    Thunderbolt 3.     ,          1.
Apple . - , Thunderbolt 3. , 1.

SoC β€œβ€, Intel AMD ?

Apple , ? , . -. AMD , β€œ ”, Accelerated Processing Unit APU, CPU GPU .





APU  AMD Ryzen. CPU  GPU (Radeon Vega)    ,         -, IO    .
APU AMD Ryzen. CPU GPU (Radeon Vega) , -, IO .

, AMD . SoC - . HP Dell. : , .





ARM , , . ARM SoC , . GlobalFoundries TSMC, AMD Apple.





    TSMC  .     AMD, Apple, Nvidia  Qualcomm.
TSMC . AMD, Apple, Nvidia Qualcomm.

, - Intel AMD. , . , , CPU .





. SoC . . , CPU, , IO SoC. Intel, AMD, Nvidia SoC Dell, HP .





, Intel AMD SoC. ? . Intel, AMD, Microsoft, .





Apple - . , , Core ML . , Core ML CPU Apple (Neural Engine).





CPU

(heterogeneous computing) - . 1, Firestorm, . ARM , Intel AMD.





Firestorm Intel AMD - Ryzen. , . , Firestorm , . , :





  1. .





  2. .





80- . , . - - . . , , .





, . β€œ ”, . , .





β€œ ”?

, :





  • , .





  • .





, - (thread) . . , , , - . CPU . - , . β€œβ€ .





, . . . - , -:









  • , - .





. .





, . , . , - : - . , . .





The ARM Ampere Altra Max processor has a lot of physical cores on board and was designed specifically for cloud computing.
ARM Ampere Altra Max .

ARM 128- . β€œβ€. , 1 , . Are Servers Next for Apple?.





Apple . , - . , . .





. , , 128 - . , .





Out-of-Order

, . Out-of-order execution () , . : Very Long Instruction Word Microprocessors.





, . , . , . , . , , . , . , 1 , 100 .





Robots in the warehouse of the online store Komplett.no, Norway.
- Komplett.no, .

: , , . . . , .





(databus). , . . , .





, . Out-of-Order-execution. , .





01: mul r1, r2, r3    // r1 ← r2 Γ— r3
02: add r4, r1, 5     // r4 ← r1 + 5
03: add r6, r2, 1     // r6 ← r2 + 1
      
      



- , . , , . . , .





, . , . , add r4, r1, 5



r1



, . , CPU : - , - .





CPU , , , - , . , . , , .





, : , - , , CPU Out-of-Order-Execution. .





OoOE 1 . , Intel AMD, , Apple. , .





ISA -

. , , ISA. , x86, ARM, PowerPC, 68K, MIPS, AVR .





x86 :





MOV ax, 24
      
      



x86 ax



, bx



, cx



dx



( , CPU). ARM :





LDR r0, 24
      
      



Intel AMD x86 , 1 Apple - ARM. , . - (micro-ops, ΞΌops). Out-of-Order .





? , . , ARM 32 ( 32 : 0 1), - . .





01: mul r1, r2, r3    // r1 ← r2 Γ— r3
02: add r4, r1, 5     // r4 ← r1 + 5
03: add r1, r2, 1     // r1 ← r2 + 1
      
      



, 01 03 . r1



. 03 , 02, . , . -, .





-, . ARM - .





CPU - , - - . ISA . , -. β€œβ€ , .





CISC , -, . . RISC . , ARM -. .





Intel AMD 1?

, , , ? , - Apple Intel AMD? , -. , , . , . -. , , (decoder).





, -, - 1. β€œβ€ Intel 4 . 1 - 8 - , . . , 1 , .





Intel AMD ?

β€œβ€ RISC , 1 ARM . , x86 1 15 . RISC - 4 . ? , , β€œβ€ , , .





, x86 , . , . Intel AMD : , . , . , - . Apple . , 4 - Intel AMD.





, 1 Firestorm , Intel AMD, .





, CISC -. 86 -, ARM - -. 4 86 - , 8 CPU. , . x86 CISC , -. , -.





, 86 Intel AMD. , 15 - , , .





AMD Zen3 , ?

, AMD Zen3 , 1 Firestorm. - Zen3 5 , Firestorm 3.2 . Zen3 Firestorm, , 60%.





Apple ? - . Apple - , Intel AMD. , Firestorm Zen3, Zen3 . Apple .





Apple , , , .





, AMD Intel :





  • -, (heterogenous computing) SoC .





  • CISC , Out-of-Order.





, . , CPU. , . Intel , , GPU SoC.





, . . , Amazon Ampere 128- . , .





Intel AMD, Apple , , . , . , . , , Apple, , , .








All Articles