SIMD, SIMT, VLIW, Superscalar, Superpipeline
1.1 (4%) Explain the major features of single instruction multiple data (SIMD) processor. In other words, point out the major differences between SIMD CPU and conventional CPU. Give a practical example of SIMD instructions, CPU, or computer.
1.2 (4%) Compare the differences of thread and process. Is context switching the change of threads or the change of process?
1.3 (4%) Explain the major features of single instruction multiple threads (SIMT) processor. Give a practical example of SIMT computer.
1.4 (4%) Explain the major features of very long instruction word (VLIW) processor. Which processor category does VLIW belong to, static multiple issue or dynamic multiple issue?
1.5 (4%) What is a superscalar processor? What is a superpipeline processor?
1.1 SIMD:一條指令同時對多筆資料做同樣的運算(data-level parallelism)。只有一個 control unit、一個 PC,抓一次指令就把同一個運算廣播給多個 ALU,各自處理不同資料
conventional CPU(SISD):一條指令只處理一組運算元
例:x86 的 MMX/SSE/AVX、ARM NEON、vector processor(Cray)
1.2 process:有自己的 address space 與資源(code、data、open files);thread:同一 process 內的執行單位,共用 address space、code、data、files,各自有 PC、register、stack;thread 建立與切換成本低
context switch:存下目前執行單位的 state 再載入另一個;換到另一個 process 還要換 address space(page table、TLB),代價高;同一 process 內的 thread 之間只換 register 與 stack
一般所說的 context switch 指 process 之間的切換,thread 之間是較輕的一種
1.3 SIMT:SIMD 加 multithreading。程式以 scalar thread 的角度寫,硬體把一群 thread(warp,如 32 條)打包,同一時間執行同一條指令;每條 thread 有自己的 register 與(邏輯上的)PC,遇 branch 分歧時用 mask 依序執行各路徑;靠大量 thread 切換隱藏記憶體延遲
例:NVIDIA GPU(CUDA)
1.4 VLIW:一條很長的指令內含多個互相獨立的 operation(各有欄位),分派給不同功能單元同時執行;哪些 operation 可並行由 compiler 在編譯時決定,硬體不做 dynamic scheduling,電路簡單;缺點是執行時才知道的延遲(cache miss)只能保守填 nop
屬於 static multiple issue
例:Intel Itanium、TI C6000 DSP
1.5 superscalar:每個 clock cycle 發出多條指令(IPC \(\gt\) 1),由硬體在執行時動態挑選、檢查相依(dynamic multiple issue,常配 out-of-order)
superpipeline:把 pipeline 切成更多、更短的 stage,使 clock rate 提高(cycle time 變短)