Presentation is loading. Please wait.

Presentation is loading. Please wait.

Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.

Similar presentations


Presentation on theme: "Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris."— Presentation transcript:

1 Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris

2 Problem Inter-procedural parallelization o Parallel after inlining Gain more parallelizable loops Lost of parallelized loops o Inlining messes up caller / callee Missed parallel opportunities o Inlining increases code complexity

3 Goal Keep the gain parallelizable loops Prevent the lost parallelism Discover the missed opportunities

4 Solution Summarize the code using annotation o Express the underlying information Inline the annotation before parallelization o Pass the summarized information to the compiler Reverse -inline after parallelization o Revert inlining side effects o Maintain equivalence

5 Outline Innovations Problems of parallel + inline strategy Annotation language Annotation-based inlining technique Experiments Summary

6 Outline Innovations Problems of parallel + inline strategy Annotation language Annotation-based inlining technique Experiments Summary

7 Problems of parallel + inlining Parallel + inlining o Conventional inlining with heuristics and pre-transformations Heuristics: code size Transformations: linearization, forward substitution o Intra-procedural loop parallelization Fortran do-all loop Goal o Gain loops in caller Problems o Lost loops in caller / callee o Missed loops in caller

8 Problems of parallel + inlining Lost of parallelizable loops in caller/callee o Transformations that cause the lost Forward substitution Linearization Forward substitution of non-linear subscripts o Create indirect array references Linearization of array dimensions o Mess up array shapes

9 Problems of parallel + inlining Forward substitution of non-linear subscripts o Create indirect array references X2(I) ⇒ T(IX(7) + I) Y2(I) ⇒ T(IX(8) + I) Z2(I) ⇒ T(IX(9) + I)

10 Problems of parallel + inlining Linearization of array dimensions o Mess up array shapes PP(i, j, k) ⇒ PP(i + j*4 + k*16)

11 Problems of parallel + inlining Missed parallelizable loops in caller o Coding styles that cause the lost Opaque compositional subroutines o A calls B, B calls C, C calls D, … Array access o When it is difficult to determine which part is killed Debugging and Error Checking o Statement that breaks the dependency is never executed I/O statements Indirect array references o ID=IDX(I), X = A(ID)

12 Problems of parallel + inlining Opaque compositional subroutines o A calls B, B calls C, C calls D, …

13 Problems of parallel + inlining Array access o Difficult to determine which part is killed CTR computed at runtime

14 Problems of parallel + inlining Debugging and Error Checking o Statement that breaks the dependency is never executed I/O statements

15 Problems of parallel + inlining Indirect array references IN=>NODE NODE=>IREL IREL=>RHSB

16 Outline Innovations Problems of parallel + inline strategy Annotation language Annotation-based inlining technique Experiments Summary

17 The annotation language Goal o Summarize information o Avoid ambiguity

18 The annotation language Restricted grammar Special operators Writing annotations

19 The annotation language Restricted grammar o Do-all loop only o No goto

20 The annotation language Special operators y = operator(x1, x2, …, xn) Purpose: abstract relation o Unknown operator Relation is unknown o Generic functions o Unique operator Relation is one-to-one, from X to Y

21 The annotation language Writing annotations o Eliminating adverse side effects Preserve caller and callee if inlining breaks the dependency o Summarize opaque subroutines Eliminate nested function calls o Array access Specify exact range get read/modified o Debugging and error handling Aggressive strategy: ignore checking statements o Indirect array references Discover unique relation

22 The annotation language Summarize opaque subroutines o Eliminate nested function calls

23 The annotation language Array access o Specify exact range get read/modified

24 The annotation language Debugging and error handling o Aggressive strategy: ignore checking statements

25 The annotation language Indirect array references o Discover unique relation

26 Outline Innovations Problems of parallel + inline strategy Annotation language Annotation-based inlining technique Experiments Summary

27 Annotation-based inlining Goal o Pass annotated information to the compiler o Eliminate inlining side effects Flow o Inline before parallelization o Reverse-inlining after parallelization o Verify and evaluate at last Implementation o POLARIS compiler for parallelization o ROSE compiler for parsing o POET transformer o PERFECT benchmark

28 Annotation-based inlining Workflow o Annotation inlining ⇒ Parallelization ⇒ Reverse-inlining

29 Annotation-based inlining Inlining annotation o Steps Annotation ⇒ source language o Translating special operators Inlinining generated source language o Avoiding linearization o Translating special operators Unknown: using uninitialized global arrays Unique: using linear expression o Avoiding linearization

30 Annotation-based inlining Inlining annotation

31 Annotation-based inlining Parallelize do-all loops

32 Annotation-based inlining Reverse inlining

33 Annotation-based inlining Reverse inlining is indispensible o Inlinining is restored to function call Avoid lost of parallelism in caller / callee Enable abstraction operators (unknown, unique)

34 Annotation-based inlining Verification and evaluation o Correctness, Efficiency, and Generality

35 Outline Innovations Problems of parallel + inline strategy Annotation language Annotation-based inlining technique Experiments Summary

36 Experiment Purpose o What does conventional lining bring to parallelization Gain? Lost? Missed? o How good is annotation-based inlining to avoid above issues Design o PERFECT benchmarks (except SPEC77) o Two machines 8 cores Intel Mac 4 cores AMD Operon o End compiler GFortran 4.2.1 IFort 11.1 Result o Count of Loops o Performance

37 Experiment Result: Loops o Conventional inlining Having loss o Annotation-based inlining No loss, more gain

38 Experiment Result: Performance o Average speedup limited o Annot-based inlining always better

39 Summary Inter-procedural parallelization Summarize effects of conventional inlining o Gain o Lost o Missed Propose annotation-based inlining o Annotation summary o Enhanced inlining strategy o Reverse inlining

40 Thanks! Questions?


Download ppt "Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris."

Similar presentations


Ads by Google