a scalable architecture for ordered parallelism
play

A Scalable Architecture for Ordered Parallelism Mark Jeffrey , - PowerPoint PPT Presentation

A Scalable Architecture for Ordered Parallelism Mark Jeffrey , Suvinay Subramanian, Cong Yan, Joel Emer, Daniel Sanchez MICRO 2015 Multicores Target Easy Parallelism 2 Multicores Target Easy Parallelism 2 Regular : known tasks and data


  1. Insights about Ordered Parallelism 6 1. With perfect speculation, parallelism is plentiful Parallelism Ideal schedule E max 800x A C B D window=64 26x B D E window=1k 180x 2. Tasks are tiny : 32 instructions on average 3. Independent tasks are far away in program order Can execute N tasks ahead A C B D E of the earliest active task N -task window Need a large window of speculation

  2. Prior Work Can’t Mine Ordered Parallelism 7

  3. Prior Work Can’t Mine Ordered Parallelism 7 ¨ Thread-Level Speculation (TLS) parallelizes loops and function calls in sequential programs

  4. Prior Work Can’t Mine Ordered Parallelism 7 ¨ Thread-Level Speculation (TLS) parallelizes loops and function calls in sequential programs Max parallelism TLS parallelism 800x 1.1x

  5. Prior Work Can’t Mine Ordered Parallelism 7 ¨ Thread-Level Speculation (TLS) parallelizes loops and function calls in sequential programs Execution order ≠ creation order Max parallelism TLS parallelism 800x 1.1x

  6. Prior Work Can’t Mine Ordered Parallelism 7 ¨ Thread-Level Speculation (TLS) parallelizes loops and function calls in sequential programs Execution order ≠ creation order Max parallelism TLS parallelism Task-scheduling priority queues 800x 1.1x introduce false data dependences

  7. Prior Work Can’t Mine Ordered Parallelism 7 ¨ Thread-Level Speculation (TLS) parallelizes loops and function calls in sequential programs Execution order ≠ creation order Max parallelism TLS parallelism Task-scheduling priority queues 800x 1.1x introduce false data dependences ¨ Sophisticated parallel algorithms yield limited speedup

  8. Prior Work Can’t Mine Ordered Parallelism 7 ¨ Thread-Level Speculation (TLS) parallelizes loops and function calls in sequential programs Execution order ≠ creation order Max parallelism TLS parallelism Task-scheduling priority queues 800x 1.1x introduce false data dependences ¨ Sophisticated parallel algorithms yield limited speedup bfs sssp astar msf des silo 64 Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c

  9. Swarm Mines Ordered Parallelism 8 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c

  10. Swarm Mines Ordered Parallelism 8 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c

  11. Swarm Mines Ordered Parallelism 8 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c ¨ Execution model based on timestamped tasks

  12. Swarm Mines Ordered Parallelism 8 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c ¨ Execution model based on timestamped tasks ¨ Architecture executes tasks speculatively out of order ¤ Leverages execution model to scale

  13. Outline 9 ¨ Understanding Ordered Parallelism ¨ Swarm ¨ Evaluation

  14. Swarm Execution Model 10 Programs consist of timestamped tasks

  15. Swarm Execution Model 10 Programs consist of timestamped tasks ¤ Tasks can create children tasks with >= timestamp ¤ Tasks appear to execute in timestamp order

  16. Swarm Execution Model 10 Programs consist of timestamped tasks ¤ Tasks can create children tasks with >= timestamp ¤ Tasks appear to execute in timestamp order ¤ Programmed with implicitly-parallel task API swarm::enqueue(fptr, ¡ts, ¡args...); ¡ 0 2 4 5 6 3 4 7

  17. Swarm Execution Model 10 Programs consist of timestamped tasks ¤ Tasks can create children tasks with >= timestamp ¤ Tasks appear to execute in timestamp order ¤ Programmed with implicitly-parallel task API swarm::enqueue(fptr, ¡ts, ¡args...); ¡ 0 2 4 5 6 3 4 7 Conveys new work to hardware as soon as possible

  18. Swarm Execution Model 10 Programs consist of timestamped tasks ¤ Tasks can create children tasks with >= timestamp ¤ Tasks appear to execute in timestamp order ¤ Programm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} ¡ ¡ ¡} ¡ } ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

  21. Swarm Task Example: Dijkstra 11 void ¡ ssspTask(Timestamp ¡dist, ¡Vertex& ¡v) ¡{ ¡ ¡ ¡if ¡(!v.isVisited()) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡v.distance ¡= ¡dist; ¡ ¡ ¡ ¡ ¡ for ¡(Vertex& ¡u ¡: ¡v.neighbors) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Timestamp ¡uDist ¡= ¡dist ¡+ ¡edgeWeight(v, ¡u); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡swarm::enqueue(&ssspTask, ¡uDist, ¡u); ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡} ¡ Timestamp } ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

  22. Swarm Task Example: Dijkstra 11 void ¡ ssspTask(Timestamp ¡dist, ¡Vertex& ¡v) ¡{ ¡ ¡ ¡if ¡(!v.isVisited()) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡v.distance ¡= ¡dist; ¡ ¡ ¡ ¡ ¡ for ¡(Vertex& ¡u ¡: ¡v.neighbors) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Timestamp ¡uDist ¡= ¡dist ¡+ ¡edgeWeight(v, ¡u); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡swarm::enqueue(&ssspTask, ¡uDist, ¡u); ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡} ¡ Timestamp } ¡ ¡ swarm::enqueue(ssspTask, ¡0, ¡sourceVertex); ¡ swarm::run(); ¡

  23. Swarm Architecture Overview 12 Tiled Multicore Tile Organization Memory controller L3 Cache Bank Router Memory controller Memory controller L2 Cache Tile L1I/D L1I/D L1I/D L1I/D Core Core Core Core Task Unit Memory controller

  24. Swarm Architecture Overview 12 Tiled Multicore Tile Organization Task Unit Memory controller L3 Cache Bank Router Memory controller Memory controller L2 Cache TQ Tile L1I/D L1I/D L1I/D L1I/D Core Core Core Core Task Unit CQ Memory controller Per-tile task units: ¨ Task Queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks

  25. Swarm Architecture Overview 12 Tiled Multicore Tile Organization Task Unit Memory controller L3 Cache Bank Router Memory controller Memory controller L2 Cache TQ Tile L1I/D L1I/D L1I/D L1I/D Core Core Core Core Task Unit CQ Memory controller Per-tile task units: ¨ Task Queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks Commit queues provide the window of speculation

  26. Task Unit Queues 13 ¨ Task queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks 68 Task States: IDLE (I) RUNNING (R) FINISHED (F) Task Queue Cores Commit Queue 9, I 2 10, I 2, R 8 8, R 3 3, F

  27. Task Unit Queues 13 ¨ Task queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks 69 Task States: IDLE (I) RUNNING (R) FINISHED (F) Task Queue Cores Commit Queue New Task ( timestamp=7, 7, I taskFn, args ) 9, I 2 10, I 2, R 8 8, R 3 3, F

  28. Task Unit Queues 14 ¨ Task queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks 70 Task States: IDLE (I) RUNNING (R) FINISHED (F) Task Queue Cores Commit Queue 7, R 9, I 7 10, I 2, F 2 8 8, R 3 3, F

  29. Task Unit Queues 15 ¨ Task queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks 71 Task States: IDLE (I) RUNNING (R) FINISHED (F) Task Queue Cores Commit Queue 7, F 9, I 8 10, I 7 2, F 2 8 8, R 3 3, F

  30. Task Unit Queues 16 ¨ Task queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks 72 Task States: IDLE (I) RUNNING (R) FINISHED (F) Task Queue Cores Commit Queue 7, F 9, R 9 9 10, I 7 2, F 2 8 8, R 3 3, F

  31. Task Unit Queues 16 ¨ Task queue : holds task descriptors ¨ Commit Queue : holds speculative state of finished tasks 73 Task States: IDLE (I) RUNNING (R) FINISHED (F) Task Queue Cores Commit Queue 7, F 9, R 9 9 10, I 7 2, F 2 8 8, R 3 3, F Similar to a reorder buffer, but at the task level

  32. High-Throughput Ordered Commits 17 ¨ Suppose 64-cycle tasks execute on 64 cores ¤ 1 task commit/cycle to scale ¤ TLS commit schemes (successor lists, commit token) too slow

  33. High-Throughput Ordered Commits 17 ¨ Suppose 64-cycle tasks execute on 64 cores ¤ 1 task commit/cycle to scale ¤ TLS commit schemes (successor lists, commit token) too slow ¨ We adapt “Virtual Time” [Jefferson, TOPLAS 1985] Tile Tile Tile … 1 2 N GVT Arbiter

  34. High-Throughput Ordered Commits 17 ¨ Suppose 64-cycle tasks execute on 64 cores ¤ 1 task commit/cycle to scale ¤ TLS commit schemes (successor lists, commit token) too slow ¨ We adapt “Virtual Time” [Jefferson, TOPLAS 1985] ¨ Tiles periodically communicate to Tile Tile Tile … 1 2 N find the earliest unfinished task GVT Arbiter

  35. High-Throughput Ordered Commits 17 ¨ Suppose 64-cycle tasks execute on 64 cores ¤ 1 task commit/cycle to scale ¤ TLS commit schemes (successor lists, commit token) too slow ¨ We adapt “Virtual Time” [Jefferson, TOPLAS 1985] ¨ Tiles periodically communicate to Tile Tile Tile … 1 2 N find the earliest unfinished task GVT Arbiter

  36. High-Throughput Ordered Commits 17 ¨ Suppose 64-cycle tasks execute on 64 cores ¤ 1 task commit/cycle to scale ¤ TLS commit schemes (successor lists, commit token) too slow ¨ We adapt “Virtual Time” [Jefferson, TOPLAS 1985] ¨ Tiles periodically communicate to Tile Tile Tile … 1 2 N find the earliest unfinished task ¨ Tiles commit all tasks that precede it GVT Arbiter

  37. High-Throughput Ordered Commits 17 ¨ Suppose 64-cycle tasks execute on 64 cores ¤ 1 task commit/cycle to scale ¤ TLS commit schemes (successor lists, commit token) too slow ¨ We adapt “Virtual Time” [Jefferson, TOPLAS 1985] ¨ Tiles periodically communicate to Tile Tile Tile … 1 2 N find the earliest unfinished task ¨ Tiles commit all tasks that precede it GVT Arbiter With large commit queues, many tasks commit at once

  38. High-Throughput Ordered Commits 17 ¨ Suppose 64-cycle tasks execute on 64 cores ¤ 1 task commit/cycle to scale ¤ TLS commit schemes (successor lists, commit token) too slow ¨ We adapt “Virtual Time” [Jefferson, TOPLAS 1985] ¨ Tiles periodically communicate to Tile Tile Tile … 1 2 N find the earliest unfinished task ¨ Tiles commit all tasks that precede it GVT Arbiter With large commit queues, many tasks commit at once Amortizes commit costs among many tasks

  39. Speculative Execution Example 18 0 Timestamp order Core 0 0 Core 1 Core 2 Time

  40. Speculative Execution Example 18 0 1 3 Timestamp order Core 0 0 1 Core 1 3 Core 2 Time

  41. Speculative Execution Example 18 0 1 3 Timestamp order Core 0 0 1 Core 1 3 Core 2 Time ¨ Tasks can execute even if parent is still speculative ¤ Uncovers more parallelism

  42. Speculative Execution Example 18 0 1 4 3 5 Timestamp order Core 0 0 1 Core 1 3 4 Core 2 5 Time ¨ Tasks can execute even if parent is still speculative ¤ Uncovers more parallelism

  43. Speculative Execution Example 18 0 1 2 4 3 5 Timestamp order Core 0 0 1 2 Core 1 3 4 Core 2 5 Time ¨ Tasks can execute even if parent is still speculative ¤ Uncovers more parallelism

  44. Speculative Execution Example 18 0 1 2 Data dependence 4 3 5 Timestamp order Core 0 0 1 2 Core 1 3 4 Core 2 5 Time ¨ Tasks can execute even if parent is still speculative ¤ Uncovers more parallelism

  45. Speculative Execution Example 18 0 1 2 Data dependence 4 3 5 Timestamp order Core 0 0 1 2 Core 1 3 4 Core 2 5 Time ¨ Tasks can execute even if parent is still speculative ¤ Uncovers more parallelism ¤ May trigger cascading (but selective) aborts

  46. Speculative Execution Example 18 0 1 2 Data dependence 4 3 5 Timestamp order Core 0 0 1 2 Core 1 3 4 Core 2 5 Time ¨ Tasks can execute even if parent is still speculative ¤ Uncovers more parallelism ¤ May trigger cascading (but selective) aborts

  47. Swarm Speculation Mechanisms 19 ¨ Key requirements for speculative execution: ¤ Fast commits ¤ Large speculative window à Small per-task speculative state

  48. Swarm Speculation Mechanisms 19 ¨ Key requirements for speculative execution: ¤ Fast commits ¤ Large speculative window à Small per-task speculative state ¨ Eager versioning + timestamp-based conflict detection ¤ Bloom filters for cheap read/write sets [Yen, HPCA 2007]

  49. Swarm Speculation Mechanisms 19 ¨ Key requirements for speculative execution: ¤ Fast commits ¤ Large speculative window à Small per-task speculative state ¨ Eager versioning + timestamp-based conflict detection ¤ Bloom filters for cheap read/write sets [Yen, HPCA 2007] ¤ Uses hierarchical memory system to filter conflict checks

  50. Swarm Speculation Mechanisms 19 ¨ Key requirements for speculative execution: ¤ Fast commits ¤ Large speculative window à Small per-task speculative state ¨ Eager versioning + timestamp-based conflict detection ¤ Bloom filters for cheap read/write sets [Yen, HPCA 2007] ¤ Uses hierarchical memory system to filter conflict checks ¨ Enables two helpful properties Forwarding of still-speculative data 1. On rollback, corrective writes abort dependent tasks only 2.

  51. Outline 20 ¨ Understanding Ordered Parallelism ¨ Swarm ¨ Evaluation

  52. Evaluation Methodology 21 ¨ Event-driven, sequential, Pin-based simulator ¨ Target system: 64-core, 16-tile chip Memory controller Router L3 Cache Bank 16 MB shared L3 (1MB/tile) Memory controller Memory controller 256 KB per-tile L2s L2 Cache Tile 32 KB per-core L1s L1I/D L1I/D L1I/D L1I/D Core Core Core Core 4096 task queue entries (64/core) Task Unit 1024 commit queue entries (16/core) Memory controller 256-byte, 8-way Bloom filters

  53. Evaluation Methodology 21 ¨ Event-driven, sequential, Pin-based simulator ¨ Target system: 64-core, 16-tile chip Memory controller Router L3 Cache Bank 16 MB shared L3 (1MB/tile) Memory controller Memory controller 256 KB per-tile L2s L2 Cache Tile 32 KB per-core L1s L1I/D L1I/D L1I/D L1I/D Core Core Core Core 4096 task queue entries (64/core) Task Unit 1024 commit queue entries (16/core) Memory controller 256-byte, 8-way Bloom filters

  54. Evaluation Methodology 21 ¨ Event-driven, sequential, Pin-based simulator ¨ Target system: 64-core, 16-tile chip Memory controller Router L3 Cache Bank 16 MB shared L3 (1MB/tile) Memory controller Memory controller 256 KB per-tile L2s L2 Cache Tile 32 KB per-core L1s L1I/D L1I/D L1I/D L1I/D Core Core Core Core 4096 task queue entries (64/core) Task Unit 1024 commit queue entries (16/core) Memory controller 256-byte, 8-way Bloom filters ¨ Scalability experiments from 1-64 cores ¤ Scaled-down systems have fewer tiles

  55. Swarm vs. Software Versions 22 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c

  56. Swarm vs. Software Versions 22 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 43x – 117x faster than serial versions

  57. Swarm vs. Software Versions 22 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 43x – 117x faster than serial versions 3x – 18x faster than parallel versions

  58. Swarm vs. Software Versions 22 bfs sssp astar msf des silo 64 117x Speedup 32 1 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 1c 32c 64c 43x – 117x faster than serial versions 3x – 18x faster than parallel versions Simple implicitly-parallel code

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend