Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles...
-
Upload
alexina-small -
Category
Documents
-
view
220 -
download
0
Transcript of Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles...
![Page 1: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/1.jpg)
Enhancing the Role of Inlining in
Effective Interprocedural Parallelization
Jichi Guo, Mike StilesQing Yi, Kleanthis Psarris
![Page 2: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/2.jpg)
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
![Page 3: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/3.jpg)
Goal• Keep the gain parallelizable loops• Prevent the lost parallelism• Discover the missed opportunities
![Page 4: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/4.jpg)
Solution• Summarize the code using annotation
o Express the underlying information
• Inline the annotation before parallelizationo Pass the summarized information to the compiler
• Reverse-inline after parallelizationo Revert inlining side effectso Maintain equivalence
![Page 5: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/5.jpg)
Outline• Innovations• Problems of parallel + inline strategy• Annotation language• Annotation-based inlining technique• Experiments• Summary
![Page 6: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/6.jpg)
Outline• Innovations• Problems of parallel + inline strategy• Annotation language• Annotation-based inlining technique• Experiments• Summary
![Page 7: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/7.jpg)
Problems of parallel + inlining
• Parallel + inliningo Conventional inlining with heuristics and pre-transformations
• Heuristics: code size• Transformations: linearization, forward substitution
o Intra-procedural loop parallelization• Fortran do-all loop
• Goalo Gain loops in caller
• Problemso Lost loops in caller / calleeo Missed loops in caller
![Page 8: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/8.jpg)
Problems of parallel + inlining
• Lost of parallelizable loops in caller/calleeo Transformations that cause the lost
• Forward substitution• Linearization
• Forward substitution of non-linear subscriptso Create indirect array references
• Linearization of array dimensionso Mess up array shapes
![Page 9: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/9.jpg)
Problems of parallel + inlining
• Forward substitution of non-linear subscriptso Create indirect array referencesX2(I) ⇒ T(IX(7) + I)Y2(I) ⇒ T(IX(8) + I)Z2(I) ⇒ T(IX(9) + I)
![Page 10: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/10.jpg)
Problems of parallel + inlining
• Linearization of array dimensionso Mess up array shapesPP(i, j, k) ⇒ PP(i + j*4 + k*16)
![Page 11: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/11.jpg)
Problems of parallel + inlining
• Missed parallelizable loops in callero Coding styles that cause the lost
• Opaque compositional subroutineso A calls B, B calls C, C calls D, …
• Array accesso When it is difficult to determine which part is killed
• Debugging and Error Checkingo Statement that breaks the dependency is never executed
• I/O statements• Indirect array references
o ID=IDX(I), X = A(ID)
![Page 12: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/12.jpg)
Problems of parallel + inlining
• Opaque compositional subroutineso A calls B, B calls C, C calls D, …
![Page 13: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/13.jpg)
Problems of parallel + inlining
• Array accesso Difficult to determine which part is killedCTR computed at runtime
![Page 14: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/14.jpg)
Problems of parallel + inlining
• Debugging and Error Checkingo Statement that breaks the dependency is never executed
• I/O statements
![Page 15: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/15.jpg)
Problems of parallel + inlining
• Indirect array referencesIN=>NODENODE=>IRELIREL=>RHSB
![Page 16: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/16.jpg)
Outline• Innovations• Problems of parallel + inline strategy• Annotation language• Annotation-based inlining technique• Experiments• Summary
![Page 17: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/17.jpg)
The annotation language
• Goalo Summarize informationo Avoid ambiguity
![Page 18: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/18.jpg)
The annotation language
• Restricted grammar• Special operators• Writing annotations
![Page 19: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/19.jpg)
The annotation language
• Restricted grammaro Do-all loop onlyo No goto
![Page 20: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/20.jpg)
The annotation language
• Special operatorsy = operator(x1, x2, …, xn)Purpose: abstract relation
o Unknown operator• Relation is unknown
o Generic functionso Unique operator
• Relation is one-to-one, from X to Y
![Page 21: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/21.jpg)
The annotation language
• Writing annotationso Eliminating adverse side effects
• Preserve caller and callee if inlining breaks the dependency o Summarize opaque subroutines
• Eliminate nested function callso Array access
• Specify exact range get read/modifiedo Debugging and error handling
• Aggressive strategy: ignore checking statementso Indirect array references
• Discover unique relation
![Page 22: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/22.jpg)
The annotation language
• Summarize opaque subroutineso Eliminate nested function calls
![Page 23: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/23.jpg)
The annotation language
• Array accesso Specify exact range get read/modified
![Page 24: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/24.jpg)
The annotation language
• Debugging and error handlingo Aggressive strategy: ignore checking statements
![Page 25: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/25.jpg)
The annotation language
• Indirect array referenceso Discover unique relation
![Page 26: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/26.jpg)
Outline• Innovations• Problems of parallel + inline strategy• Annotation language• Annotation-based inlining technique• Experiments• Summary
![Page 27: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/27.jpg)
Annotation-based inlining
• Goalo Pass annotated information to the compilero Eliminate inlining side effects
• Flowo Inline before parallelizationo Reverse-inlining after parallelizationo Verify and evaluate at last
• Implementationo POLARIS compiler for parallelizationo ROSE compiler for parsingo POET transformero PERFECT benchmark
![Page 28: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/28.jpg)
Annotation-based inlining
• Workflowo Annotation inlining ⇒ Parallelization ⇒ Reverse-inlining
![Page 29: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/29.jpg)
Annotation-based inlining
• Inlining annotationo Steps
• Annotation ⇒ source languageo Translating special operators
• Inlinining generated source languageo Avoiding linearization
o Translating special operators• Unknown: using uninitialized global arrays• Unique: using linear expression
o Avoiding linearization
![Page 30: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/30.jpg)
Annotation-based inlining
• Inlining annotation
![Page 31: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/31.jpg)
Annotation-based inlining
• Parallelize do-all loops
![Page 32: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/32.jpg)
Annotation-based inlining
• Reverse inlining
![Page 33: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/33.jpg)
Annotation-based inlining
• Reverse inlining is indispensibleo Inlinining is restored to function call
• Avoid lost of parallelism in caller / callee• Enable abstraction operators (unknown, unique)
![Page 34: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/34.jpg)
Annotation-based inlining
• Verification and evaluationo Correctness, Efficiency, and Generality
![Page 35: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/35.jpg)
Outline• Innovations• Problems of parallel + inline strategy• Annotation language• Annotation-based inlining technique• Experiments• Summary
![Page 36: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/36.jpg)
Experiment• Purpose
o What does conventional lining bring to parallelization• Gain?• Lost?• Missed?
o How good is annotation-based inlining to avoid above issues
• Designo 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
• Resulto Count of Loopso Performance
![Page 37: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/37.jpg)
Experiment• Result: Loops
o Conventional inlining• Having loss
o Annotation-based inlining• No loss, more gain
![Page 38: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/38.jpg)
Experiment• Result: Performance
o Average speeduplimited
o Annot-based inliningalways better
![Page 39: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/39.jpg)
Summary• Inter-procedural parallelization• Summarize effects of conventional inlining
o Gaino Losto Missed
• Propose annotation-based inliningo Annotation summaryo Enhanced inlining strategyo Reverse inlining
![Page 40: Enhancing the Role of Inlining in Effective Interprocedural Parallelization Jichi Guo, Mike Stiles Qing Yi, Kleanthis Psarris.](https://reader035.fdocuments.in/reader035/viewer/2022062409/5697bf821a28abf838c85ced/html5/thumbnails/40.jpg)
Thanks!Questions?