Presentation is loading. Please wait.

Presentation is loading. Please wait.

Published in ACM SIGPLAN, 2010 Heidi Pan MassachusettsInstitute of Technology Benjamin Hindman UC Berkeley Krste Asanovi´c UC Berkeley 1.

Similar presentations


Presentation on theme: "Published in ACM SIGPLAN, 2010 Heidi Pan MassachusettsInstitute of Technology Benjamin Hindman UC Berkeley Krste Asanovi´c UC Berkeley 1."— Presentation transcript:

1 Published in ACM SIGPLAN, 2010 Heidi Pan MassachusettsInstitute of Technology Benjamin Hindman UC Berkeley Krste Asanovi´c UC Berkeley 1

2 Outline Introduction Cooperative Hierarchical Resource Management Lithe Primitives Lithe Interface Interoperable Parallel Libraries Evaluation Conclusion 2

3 Introduction For productivity, programmers would like to reuse parallel libraries by composing them together to build applications Compose parallel libraries efficiently is hard Poor resource management across parallel libraries 3

4 Introduction(cont.) Lithe, is a low-level substrate that provides the basic primitives for parallel execution and a standard interface for composing arbitrary parallel libraries efficiently. Replace the virtualized thread abstraction with an unvirtualized hardware thread(hart) primitive, to represent a processing resource. 4

5 Introduction(cont.) Using Lithe 5

6 Introduction(cont.) Harts must be explicitly allocated and shared amongst the different libraries. The paper have ported Intel’s Threading Building Blocks (TBB) and GNU’s OpenMP libraries to run with Lithe. 6

7 Cooperative Hierarchical Resource Management Applications are built by composing libraries hierarchically GraphicsMagick library -> Network graphics library libpng -> Compression library zlib 7

8 Lithe Primitives Lithe provides two basic primitives, harts and contexts, to enable library runtimes to perform parallel execution. Hart primitive prevents uncontrolled oversubscription of the machine. Context primitive prevents undersubscription of the machine. 8

9 Lithe Primitives Hart(hardware thread) represents a processing resource, one hardware thread per physical core. Within an application, there is a fixed one-to-one mapping between harts and the physical hardware thread contexts A hart must be allocated to a runtime before that runtime can execute code which is in contrast to threads 9

10 Lithe Primitives(cont.) Each hart always has an associated context, which acts as the execution vessel for the computation running on the hart. Contexts allow runtimes to interoperate with libraries that may need to block the current computation. 10

11 Lithe Interface Lithe substrate defines two standard interfaces: 1. A runtime interface that parallel runtimes use to share harts and manipulate contexts. 2. A scheduler callback interface that each parallel runtime must implement to manage its own harts and interoperate with others. At any point in time, a hart is managed by exactly one scheduler, and each scheduler knows exactly which harts are under its control. 11

12 Lithe Interface(cont.) 12

13 Lithe Interface(cont.) Base Scheduler: Lithe runtime provides a base scheduler for the application. Runtime Functions and Callbacks: 13

14 Lithe Interface(cont.) 14

15 Lithe Interface(cont.) Contexts 15

16 Will spawn N task Resume paused Wait until all task completed Satisfy children 16

17 Interoperable Parallel Libraries TBB OpenMP Barrier 17

18 Interoperable Parallel Libraries TBB Each TBB scheduler manages harts rather than thread OpenMP Each team scheduler multiplexes its workers onto its available harts. 18

19 Interoperable Parallel Libraries Barrier Implemented some simple user-level barriers in order to experiment with how synchronization primitives interact with parallel libraries. 19

20 Evaluation Hardware platform: quad-socket 2.3GHz AMD Opteron with 4 cores per socket( 16 cores total). OS platform: 2.6.18 64-bit linux kernel Glibc 2.3.6 TBB 2.1 OpenMP from GCC 4.4 trunk. 20

21 Evaluation(cont.) Ported Libraries To validate that porting libraries to Lithe incurs negligible or no overhead. cg: conjugate gradient ft: fast Fourier transform is: integer sort 21

22 Evaluation(cont.) Use an algorithm for sparse QR factorization(SPQR) commonly used in the linear least-squares method for solving geodetic survey, photogrammetry, surface fitting. Original Out-of-the-Box Implementation Algorithm using TBB to create the parallel tasks Call parallel BLAS (basic linear algebra subprogram) matrix routines from MKL(Math Kernel Library). MKL uses OpenMP to parallelize itself. 22

23 Evaluation(cont.) 23

24 Evaluation(cont.) Execution Time (seconds) Thread Num 24

25 Evaluation(cont.) 25 Thread Num

26 Evaluation-cache miss 26

27 Evaluation-context switch 27

28 Evaluation(cont.) 28

29 Conclusion Using Lithe, we are able to implement multiple existing parallel abstractions with no measurable overhead, while enabling parallel libraries to be composed efficiently. 29


Download ppt "Published in ACM SIGPLAN, 2010 Heidi Pan MassachusettsInstitute of Technology Benjamin Hindman UC Berkeley Krste Asanovi´c UC Berkeley 1."

Similar presentations


Ads by Google