ã³ã³ãã¥ãŒã¿ã»ã¢ãŒããã¯ãã£ãšã¯
ã³ã³ãã¥ãŒã¿ (ç¹ã«ããŒããŠã§ã¢) ã«ãããåºæ¬èšèšãèšèšææ³ãªã©ã®åºæ¬èšèšæŠå¿µ.
3 ã€ã®ãµãã«ããŽãªããã.
- åœä»€ã»ããã¢ãŒããã¯ãã£(ISA)
- ãã€ã¯ãã¢ãŒããã¯ãã£
- ã·ã¹ãã ã¢ãŒããã¯ãã£
åœä»€ã»ããã¢ãŒããã¯ãã£
RISC, CISC, VLIW, EPIC ã¢ãŒããã¯ãã£
ãã€ã¯ãã¢ãŒããã¯ãã£
- æŒç®ã¢ãŒããã¯ãã£
- æµ®åå°æ°ç¹, æŒç®è£ 眮, SIMD/MIMD, ãã¯ãã«æŒç®ãŠããã (ãã¯ãã«èšç®æ©)
- CPU å¶åŸ¡ã¢ãŒããã¯ãã£
- ã¯ã€ã€ãŒãããžãã¯, ãã€ã¯ãããã°ã©ã (ãã€ã¯ãã¢ãŒããã¯ãã£), å®è¡ãŠããã, å¶åŸ¡è£ 眮
- CPU é«éåã¢ãŒããã¯ãã£
- ãã€ãã©ã€ã³, ã¹ãŒããŒã¹ã±ãŒã©, ã¢ãŠãã»ãªãã»ãªãŒããŒå®è¡, åå²äºæž¬, ã¬ãžã¹ã¿ã»ãŠã£ã³ããŠ, ã¬ãžã¹ã¿ã»ãªããŒãã³ã°, ææ©çå®è¡
- CPU ãã¹ã¢ãŒããã¯ãã£
- CPU ãã¹ (CPU å éšãã¹, CPU å€éšãã¹ããã³ãã¢ãŒããã¯ãã£)
- ãã«ãããã»ããµã¢ãŒããã¯ãã£
- 察称åãã«ãããã»ããµ (SMP), NUMA (ASMP), ã¯ãã¹ããŒã¹ã€ãã <ã¹ã¿ã>
- ãã«ãã¹ã¬ããã¢ãŒããã¯ãã£
- ãããã¯åãã«ãã¹ã¬ããã£ã³ã°, ã€ã³ã¿ãŒãªãŒãåãã«ãã¹ã¬ããã£ã³ã°, åæãã«ãã¹ã¬ããã£ã³ã°
ðã·ã¹ãã ã¢ãŒããã¯ãã£
- å¶åŸ¡ã¢ãŒããã¯ãã£
- å²ã蟌ã¿å¶åŸ¡, å ¥åºåå¶åŸ¡
- ãã¹ã¢ãŒããã¯ãã£
- ããŒããŒãã¢ãŒããã¯ãã£, ããã°ã©ã å èµæ¹åŒ (ãã€ãã³åãå«ã)
- ã¯ãã¹ããŒã¹ã€ãã
- ã·ã¹ãã ãã¹, ã¡ã¢ãªãã¹, å ¥åºåãã¹.
- ã¡ã¢ãªã¢ãŒããã¯ãã£
- ãã£ãã·ã¥ã¡ã¢ãª, ä»®æ³èšæ¶, TLB <ã¹ã¿ã> â ã¡ã¢ãª
- ãããã¯ãŒã¯ã¢ãŒããã¯ãã£
- <ã¹ã¿ã> â ã³ã³ãã¥ãŒã¿ãããã¯ãŒã¯
- ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã¢ãŒããã¯ãã£
- ããŒãžã³ã°æ¹åŒã¢ãŒããã¯ãã£. <ã¹ã¿ã>
- åæ£åŠçã¢ãŒããã¯ãã£ãŒ
ðã¡ã¢ãª/Memory
Memory Architecture.
Memory Hierarchy
registers | |
---|---|
L1 Cache | SRAM |
L2 Cache | SRAM |
Memory | DRAM |
local 2nd storage | local disks |
remote 2nd storage | Web Servers |
ROM
æžã蟌ãã ããŒã¿ã¯æ¶å»ã§ããªãã, é»æºãåã£ãŠãããŒã¿ãæ¶ããªãèªã¿åºãå°çšã®ã¡ã¢ãª.
RAM
ããŒã¿ã®èªã¿æžãã¯èªç±ã«è¡ããã, é»æºãåããšå 容ãæ¶ããã¡ã¢ãª (Random Access Memory)
ã¬ãžã¹ã¿ããããããã€ãŸã£ããã®. åã¬ãžã¹ã¿ã«ã¯ãäžäœã®ã¢ãã¬ã¹ãå²ãæ¯ãããŠãã.
Virtual Memory
ä»®æ³ã¡ã¢ãª. ã¡ã¢ãªç®¡çææ³ã®äžçš®ã§ãã, ãã«ãã¿ã¹ã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãäžé£ç¶ãªã¡ã¢ãªé åããœãããŠã§ã¢(ããã»ã¹ãªã©)ããèŠãŠé£ç¶ã«ãªãããã«èŠãããããã®.
ã»ã°ã¡ã³ãæ¹åŒãšããŒãžã³ã°æ¹åŒã®äºã€ã®æ¹æ³ããã.
é¢ç¯åç §
indirection.
å€ã, å€ãè¡šããã®ãã®ãã®çŽæ¥ã«ãã£ãŠã§ã¯ãªã, ååãåç §ãªã©ã«ããéæ¥çã«, æã瀺ãããšããã³ãã®åç §ã, ãããåç §ããŠæäœããããš
CS ã®äžçã§ã®åé¡è§£æ±ºã®åžžå¥æ段.
MMU
ã³ã³ãã¥ãŒã¿å éšã®éšå. ä»®æ³ã¢ãã¬ã¹ãç©çã¢ãã¬ã¹ã«å€æããæ©èœããã€, (ã»ãã®ä»äºãããŠãã)
ããŒãžã³ã°æ¹åŒ
èšæ¶è£ 眮ãããŒãžãšåŒã°ããå°ããªåäœã«åå²ããŠå²ãåœãŠãè¡ãã¢ã«ãŽãªãºã 矀ã§ãã. ä»®æ³èšæ¶ã®ããŒã¹ãšãªãèšèšã®äžã€.
ä»®æ³ã¡ã¢ãªçªå·ãšç©çã¡ã¢ãªçªå·ã察å¿ã¥ããããŒãã«.
-
Pages
ããŒãã£ã«ã¡ã¢ãªäžã®ãã£ãã·ã¥ããšãã« Pages ãšãã.
-
Page Tables
ããŒãžããŒãã« (Page Table) ãšã¯, ã³ã³ãã¥ãŒã¿ã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ãããããŒãžã³ã°æ¹åŒã®ä»®æ³èšæ¶ã·ã¹ãã ã§äœ¿ãããããŒã¿æ§é ã§ãã, ä»®æ³ã¢ãã¬ã¹ãšç©çã¢ãã¬ã¹ã®ãããã³ã°ãæ ŒçŽãããã®ã§ãã. ä»®æ³ã¢ãã¬ã¹ç©ºéã¯ããã»ã¹æ¯ã«å²ãåœãŠãã, ç©çã¢ãã¬ã¹ã¯ã·ã¹ãã å šäœã§ RAM ãªã©ãé 眮ããã¢ãã¬ã¹.
ããŒãžããŒãã«ã®å é ã«ã¯ valid flag ãããã®ã§, ãŸãã¯ããã§åç §ããã¡ã¢ãªãæå¹ãã©ãããå€å®ãã.
å ±æã©ã€ãã©ãªã¯, read only ãªãã, ãã®é åã«å¯Ÿã㊠write ã¢ã¯ã»ã¹ããããš, Page Fault äŸå€ãçºçãã.
Disk ã«ãã? ããã åç §ã®ãªãŒããããã倧ããã®ã§, TLB ããã.
-
Page Fault
ç©çã¡ã¢ãªç©ºéã«å¯Ÿå¿ã¥ããããŠããªãè«çã¡ã¢ãªãåç §ããæã«ã¯ããŒãžãã©ã«ããšããäŸå€ã«ãã£ãŠ OS åŽã®äŸå€åŠçã«ãŒãã³ã«å¶åŸ¡ã移è¡ã, OS åŽã®ç®¡çã«ãã£ãŠé©å®å¯Ÿå¿ããããŒãžãäºæ¬¡èšæ¶çããèªã¿èŸŒã¿, ããŒãã«ãæŽæ°ããŠãã®åç §ããåœä»€ã®å®è¡ã«æ»ã.
-
ä»®æ³ã¡ã¢ãªã«é¢ãã 3 ã€ã®ããŒãã«
- TLB ⊠MMU
- Page Table ⊠DRAM
- Cache ⊠DRAM
-
TLB
ã¡ã¢ãªç®¡çãŠããã (MMU) å ã®ããçš®ã®ãã£ãã·ã¥ã§ãã, ä»®æ³ã¢ãã¬ã¹ããç©çã¢ãã¬ã¹ãžã®å€æã®é«éåãå³ããã®.
ã»ã°ã¡ã³ãæ¹åŒ
ðãã€ãã³åã¢ãŒããã¯ãã£
CPU ãäžå¿ãšããŠãã¡ã¢ãªããã€ã¹ãæäœãå ¥åããã€ã¹ããããŒã¿ãåãåããåºåããã€ã¹ãžããŒã¿ãéä¿¡ãã.
- ã¡ã¢ãª
- ããŒã¿ã¡ã¢ãª
- åœä»€ã¡ã¢ãªã¡ã¢ãªäžã«ããã°ã©ã ãä¿æãããšããããã€ãã³ç.
- CPU
- ALU
- ã¬ãžã¹ã¿
- å¶åŸ¡ãŠããã
- ã¬ãžã¹ã¿
- ããŒã¿ã¬ãžã¹ã¿
- ã¢ãã¬ã¹ã¬ãžã¹ã¿
- ããã°ã©ã ã«ãŠã³ã¿ã¬ãžã¹ã¿æ¬¡ã«ãã§ããããåœä»€ã¡ã¢ãªäžã®ã¢ãã¬ã¹ãä¿æããŠãäžã€åœä»€ãå®è¡ãã床ã«ã€ã³ã¯ãªã¡ã³ãããŠãã.
- å ¥åºåè£ çœ®ã¡ã¢ãªãããã I/O ã«ãã£ãŠã¡ã¢ãªæäœã®ããã«å¶åŸ¡
ðGPU
Graphic Processiong Unit. ç»ååŠçã«ç¹åããæŒç®åè·¯.
VRAM
GPUã«æèŒãããŠããå°çšã¡ã¢ãª. ãããªã¡ã¢ãª.
- VRAMã®å®¹éã倧ããã»ã©é«å質ãªæ åãã¹ã ãŒãºã«åŠçããããšãå¯èœ.
nvidia-smi
topã®GPUããŒãžã§ã³.
# 1ç§ééã§å®è¡
nvidia-smi -l 1
# 500ããªç§=0.5ç§ééã§å®è¡
nvidia-smi -lms 500
ð¥ã°ã©ãã£ãã¯ã«ãŒã
GPUã®æèŒãããããœã³ã³éšå. ãããªã«ãŒã, ã°ã©ãã£ãã¯ããŒã, ã°ã©ã.
ç»åãåç»ç·šé. ã²ãŒã ã§éã¶ãšãã«å¿ èŠ. ããããªããšCPUã§ã¯åŠçãããããŠã«ã¯ã«ã¯ãã.
ðNPU
neural processing unit. ð€çæAIã®åŠçã«ç¹åããæŒç®è£ 眮.