1 / 30

חישוב מקבילי לכל תלמיד/ה

חישוב מקבילי לכל תלמיד/ה. פרופ' רן גינוסר הנדסת חשמל ומדעי המחשב הטכניון ran@ee.technion.ac.il www.ee.technion.ac.il/~ran. תוכן. מדוע חישוב מקבילי ? תיאוריה ארכיטקטורה אלגוריתמים מה לעשות. מדוע חישוב מקבילי ?. כולם עושים זאת search “Parallel computing high school” חישוב מהיר יותר

nasya
Download Presentation

חישוב מקבילי לכל תלמיד/ה

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. חישוב מקבילי לכל תלמיד/ה פרופ' רן גינוסר הנדסת חשמל ומדעי המחשב הטכניון ran@ee.technion.ac.ilwww.ee.technion.ac.il/~ran

  2. תוכן • מדוע חישוב מקבילי ? • תיאוריה • ארכיטקטורה • אלגוריתמים • מה לעשות

  3. מדוע חישוב מקבילי ? • כולם עושים זאת • search “Parallel computing high school” • חישוב מהיר יותר • חישוב בהספק נמוך יותר • חישוב באנרגיה נמוכה יותר

  4. P0 Shared memory P1 P2 … Pn תיאוריה (1) • מודל PRAM • Parallel Random Access Machine • מיועד לאלגוריתם אחד בלבד בו-זמנית • קריאה וכתיבה "במקביל" • Concurrently • Simultaneously • ביחידת זמן: • כל מעבד מבצע חישוב, או • כל מעבד ניגש לזיכרון

  5. + + סדרתי A8 + A7 + A6 + + A5 + + + A4 + + + + + A3 A1 A1 A3 A5 A7 A2 A2 A4 A6 A8 דוגמה: סיכום אברי מערך מקבילי TP=3, O(log n) P=4, O(n) SpeedUp=T1/TP=7/3=2.33, O(n/logn) T1=7, O(n) P=1 סה"כ עבודה אפשרית: PTP=12, O(nlog n) סה"כ עבודה שבוצעה: W=7, O(n) יעילות: EP = W / PTP=7/12, O(1/ log n) אבל: שכחנו להתחשב במחיר הגישה לזיכרון...

  6. Exchange Swap elements from A[ ] with those of B[ ] Input: A[ ], B[ ], n = length of arrays SERIAL int main( ) { int i; for(i=0; i<n; i++) { int e= A[i]; A[i] = B[i]; B[i] = e; } } PARALLEL Duplicable task() // n copies { int x ; x= A[$]; A[$] = B[$]; B[$] = x; } כמה מעבדים? מה זמן החישוב? ההאצה? היעילות? FINE GRANULARITY

  7. Optimal Parallel Exchange int y[n], x[n]; Duplicable Task first-A () { x[$] = A[$]; } Duplicable Task second-A (first-A,first-B) { A[$] = y[$]; } Duplicable Task first-B () { y[$] = B[$]; } Duplicable Task second-B (first-A,first-B) { B[$] = x[$]; } על כמה מעבדים? מה יקרה אם יהיו פחות מעבדים? יותר מעבדים? מה זמן חישוב? ההאצה? היעילות? מה המשמעות של FINE GRANULARITY ??

  8. תיאוריה (2) • מה פירוש גישה במקביל לזיכרון? • EREW: קריאה בלעדית, כתיבה בלעדית • אל / מאותו משתנה בדיוק! • CREW: קריאה בו-זמנית, כתיבה בלעדית • ERCW • CRCW: קריאה וכתיבה בו-זמנית • האלגוריתם חייב להבטיח חישוב נכון • לא החומרה מגינה מפני המתכנת הטיפש • האם מודל PRAM מעשי?

  9. סינכרון • סינכרון PRAM • כל המעבדים מבצעים אותה פעולה באותו זמן • חוסר סינכרון • כל מעבד מתקדם בקצב שלו, עד נקודת סינכרון • דוגמה בהמשך • סינכרון בקטעים • BSP = Bulk Synchronous Pattern • כל מעבד בקצב שלו, אבל נקודות הסינכרון משותפות (= מחסומים) • בכל קטע ירוק אין שיתוף זיכרונות • בנקודות המחסום מחליפים מידע BSP

  10. מודלים אחרים • מחשב רשת P+M P+M P+M P+M P+M P+M P+M P+M P+M P+M P+M P+M P+M P+M P+M P+M

  11. כיצד לארגן את המעבדים והזכרונות על גבי שבב ?

  12. P1 P0 P7 P2 P6 P3 P4 P5 מודל נהלל: המשותף קרוב לכולם

  13. ארכיטקטורה

  14. PLURALITY • Start-up company in Israel • Result of Technion research (since 1980s)

  15. Architecture: Part I PLURALITY fine granularityNO PRIVATE MEMORY P P P P P P P P P-to-M resolving NoC tightly coupled memoryequi-distant (1 cycle each way)fast combinational NOC shared memory “anti-local” addressing by interleavingMANY banks / portsnegligible conflicts externalmemory

  16. scheduler PLURALITY P-to-S scheduling NoC P P P P P P P P P-to-M resolving NoC shared memory externalmemory Architecture: Part II low latency parallel schedulingenables fine granularity fine granularityNO PRIVATE MEMORY tightly coupled memoryequi-distant (1 cycle each way)fast combinational NOC “anti-local” addressing by interleavingMANY banks / portsnegligible conflicts

  17. 1MByte Data Cache Sync/Sched 64KB InstructionCache 32 processors 64 KB InstructionCache 32 processors 1MByte Data Cache Actual layout (40nm)

  18. programming model Compile into task-dependency-graph = ‘task map’ task codes Task maps loaded into scheduler Tasks loaded into memory scheduler PLURALITY P-to-S scheduling NoC P P P P P P P P Task template: P-to-M resolving NoC regular duplicable task xxx( dependencies ) join/fork { …$…. ….. } shared memory externalmemory

  19. Fine Grain Parallelization • SERIAL for ( i=0; i<10000; i++ ) { a[i] = b[i]*c[i]; } • PARALLEL duplicable task XX(…) // 10000 copies {a[$] = b[$]*c[$];} • All tasks, or any subset, can be executed in parallel

  20. Task map example (2D FFT) … … … … … … Duplicable task Conditional task Join / fork task

  21. Another task map (linear solver)

  22. Linear Solver: Simulation snap-shots

  23. PLURALITY Architectural Benefits • Shared, uniform (equi-distant) memory • no worry which core does what • no advantage to any core because it already holds the data • Many-bank memory + fast P-to-M NoC • low latency • no bottleneck accessing shared memory • Fast scheduling of tasks to free cores (many at once) • enables fine grain data parallelism • impossible in other architectures due to: • task scheduling overhead • data locality • Any core can do any task equally well on short notice • scales automatically • Programming model: • intuitive to programmers • easy for automatic parallelizing compiler

  24. Analysis

  25. Two (analytic) approaches to many cores 1) How many cores can fit into a fixed size VLSI chip? 2) One core is fixed size. How many cores can be integrated? The following analysis employs approach (1)

  26. Analysis

  27. 256 1K 4K 64 Analysis power  N perf  N freq  1/N Perf / power  const

  28. מה לעשות? • ללמד חישוב מקבילי • מעט ארכיטקטורה • הרבה אלגוריתמים • להשתמש במערכת Plurality לפיתוח תכנה, סימולציה ומדידת ביצועים • מבוססת GCC, Eclipse • לשפות C, ++C • זמינה חינם לכל מורה ותלמיד/ה, הורדה מהאתר • כוללת דוגמאות והוראות • מאפשרת התנסות

  29. סיכום • מחשב מקבילי (מעבדים קטנים) יעיל יותר ממחשב יחיד חזק • בתנאי שאנו יודעים לתכנת אותו ביעילות • וזה אפשרי רק במחשב פשוט ועם אלגוריתם חכם • תכנות מקבילי • קל ללימוד למורה • מתאים ללימוד בבי"ס תיכון • חיוני ללמוד אותו בבי"ס תיכון

More Related