using graph based characterization for predictive modeling
play

Using Graph-Based Characterization for Predictive Modeling - PowerPoint PPT Presentation

Using Graph-Based Characterization for Predictive Modeling Assistant Prof. John Cavazos University of Delaware Department of Computer and Information Sciences Motivation State-of-the-art Graph-based Build & Use Evaluation for Code 2


  1. Using Graph-Based Characterization for Predictive Modeling Assistant Prof. John Cavazos University of Delaware Department of Computer and Information Sciences

  2. Motivation State-of-the-art Graph-based Build & Use Evaluation for Code 2

  3. Motivation Key Idea State-of-the-art Machine ¡ Graph-­‑based ¡ Opts Op7mized ¡ Original ¡ learning ¡model Characteriza7on Code Code BB1 Graph-based … … BB3 BB4 BB5 BB2 BB6 Build & Use COMPILER Can ¡significantly ¡Intel’s ¡compiler ¡by ¡several ¡factors Evaluation [Work ¡done ¡with ¡ Eunjung ¡Park ¡and ¡ Marco ¡Alvarez ¡and ¡published ¡at ¡ Interna7onal ¡Symposium ¡on ¡Code ¡Genera7on ¡and ¡Op7miza7on, ¡2012] 3

  4. Motivation Finding the Best Optimization is Difficult 20 PoCC State-of-the-art Actual ¡Speedup Normalized ¡Speedup ¡to ¡ICC ¡-­‑fast Fusion 18 Unrolling 16 Tiling Normalized speedup to baseline 14 Paralleliza7on Graph-based Vectoriza7on 12 10 8 600 ¡opt Build & Use 2MM ¡(Matrix ¡Mul7ply) ¡ combinaDons 6 4 Evaluation 2 OpDmized ¡ 1 versions 0 0 100 200 300 400 500 600 Applied optimization sequences sorted by increasing actual speedup Applied ¡Op7miza7on ¡Combina7ons ¡Sorted ¡by ¡Increasing ¡Actual ¡Speedup 4

  5. Motivation Finding the Best Optimization is Difficult 20 PoCC State-of-the-art Actual ¡Speedup : ¡Degrade Normalized ¡Speedup ¡to ¡ICC ¡-­‑fast Fusion 18 : ¡Improvement ¡ ¡> ¡ ¡1.0x Unrolling : ¡Significant ¡Improvement ¡ ¡>= ¡ ¡6.0X 16 Tiling : ¡The ¡best ¡Improvement Normalized speedup to baseline 14 Paralleliza7on Graph-based Vectoriza7on 12 10 8 600 ¡opt Build & Use 2MM ¡(Matrix ¡Mul7ply) ¡ combinaDons 6 4 Evaluation 2 OpDmized ¡ 1 versions 0 0 100 200 300 400 500 600 Applied optimization sequences sorted by increasing actual speedup Applied ¡Op7miza7on ¡Combina7ons ¡Sorted ¡by ¡Increasing ¡Actual ¡Speedup 5

  6. Motivation Observations State-of-the-art Highest-­‑level ¡opt ¡flag ¡(-­‑fast) ¡does ¡ not ¡give ¡best ¡perf Low ¡density ¡of ¡“very” ¡good ¡points ¡in ¡the ¡op7miza7on ¡ space Graph-based No ¡single ¡ opDmizaDon ¡configuraDon ¡best ¡for ¡all ¡programs Bundled ¡flags ¡are ¡doomed ¡to ¡fail Build & Use Evaluation 6

  7. Motivation Using a Prediction Model 20 PoCC State-of-the-art Actual ¡Speedup Model Fusion 18 Normalized ¡Speedup ¡to ¡-­‑fast Unrolling Model ¡follows ¡the ¡trend ¡of ¡actual ¡speedup 16 in ¡Intel ¡ICC ¡Compiler Tiling Normalized speedup to baseline 14 Paralleliza7on Graph-based Vectoriza7on 12 10 600 ¡opt 8 Build & Use combinaDons 6 2MM ¡(Matrix ¡Mul7ply) ¡ 4 Evaluation 2 OpDmized ¡ 1 versions 0 0 100 200 300 400 500 600 Applied ¡Op7miza7on ¡Combina7ons ¡Sorted ¡by ¡Increasing ¡Actual ¡Speedup Applied optimization sequences sorted by increasing actual speedup 7

  8. Motivation Using a Prediction Model 20 PoCC State-of-the-art Actual ¡Speedup : ¡top ¡1 ¡-­‑ ¡5 ¡Predicted ¡CombinaDons ¡ Model Fusion 18 Normalized ¡Speedup ¡to ¡-­‑fast : ¡top ¡6 ¡-­‑ ¡10 ¡Predicted ¡CombinaDons ¡ Unrolling 16 in ¡Intel ¡ICC ¡Compiler Tiling Normalized speedup to baseline 14 Paralleliza7on Graph-based Vectoriza7on 12 10 600 ¡opt 8 Build & Use combinaDons 6 2MM ¡(Matrix ¡Mul7ply) ¡ 4 Evaluation 2 OpDmized ¡ 1 versions 0 0 100 200 300 400 500 600 Applied ¡Op7miza7on ¡Combina7ons ¡Sorted ¡by ¡Increasing ¡Actual ¡Speedup Applied optimization sequences sorted by increasing actual speedup 8

  9. Motivation State-of-the-art Characterizations Dynamic Sta7c State-of-the-art Performance Performance Reac7ons Source ¡Code Category List ¡of ¡PCs Num Counters Counters Cache ¡Line ¡Access CA_CLN, ¡CA-­‑ITV, ¡.. 3 Performance Counters L1 ¡Cache L1_DCA, ¡L1_DCH, ¡... ¡ 10 Graph-based Underlying Architecture L2/L3 ¡Cache L2_DCA, ¡L2_DCM, ¡... 16 1: Branch ¡Related BR_TKN, ¡BR_NTK, ¡... 7 Backend Floa7ng ¡Point FDV_INS, ¡FP_OPS, ¡... 1: 6 ... ... Build & Use Compiler Interrupt/Stall HW_INT, ¡RES_STL 2 ... N-­‑1: N-­‑1: Complied ¡with ¡-­‑O0 ... TLB TLB_DM, ¡TLM_IM, ¡... 4 Performance ¡Counters Total ¡Cycle/Inst. TOT_CYC, ¡TOT_IIS, ¡... 3 N-­‑1 ¡Programs Evaluation for ¡N-­‑1 ¡Programs Load/Store ¡Inst. LD_INS, ¡SR_INS 2 SIMD ¡Inst VEC_INS, ¡VEC_DP, ¡... 3 9

  10. Motivation State-of-the-art Characterizations Dynamic Sta7c State-of-the-art Performance Reac7ons Source ¡Code Source ¡Code Counters Source Code Graph-based Collected ¡from ¡source ¡code ¡or ¡compiler ¡intermediate ¡ representa7ons ... 1 R 1 1 ... Milepost Number ¡of ¡different ¡type ¡of ¡statements ¡in ¡a ¡func7on ... ... GCC Build & Use ... N-1 Sta7s7cs ¡on ¡control ¡flow ¡graph ¡in ¡a ¡func7on N-1 R Source code features N-1 programs Use ¡fixed ¡length ¡of ¡vector ¡(structured ¡data) ¡to ¡use ¡with ¡ for N-1 programs Evaluation machine ¡learning 10

  11. Motivation State-of-the-art Characterizations Dynamic Sta7c State-of-the-art Performance ReacDons Source ¡Code Counters Graph-based Advantages -­‑ ¡ Easy ¡to ¡collect ¡and ¡works ¡with ¡standard ¡ML ¡algorithms Build & Use Disadvantages -­‑ ¡ ¡ Fixed-­‑length ¡vector ¡loses ¡informa7on ¡about ¡program Evaluation ¡ ¡ ¡ ¡(e.g., ¡Lost ¡informa7on ¡about ¡loop ¡structure) 11

  12. Motivation Graph-based Characterization Dynamic Sta7c State-of-the-art Performance Reac7ons Source ¡Code Graph-­‑based Graph-­‑based Counters Graph-based - CFG N-1 Graph-based N-1 ... ... Feature vector of each Graph-­‑based ¡program ¡characteriza7ons ¡ 1 node 1 ... bb1 bb1 (e.g., ¡control ¡flow ¡graphs, ¡data ¡dependence ¡graphs) ... Feature vector of each bb MinIR bb ... bb2 ... 1 bb3 ... bb6 ... bb1 ... Build & Use bb Main ¡difference ¡from ¡state-­‑of-­‑the-­‑art ... bb4 6 CFG ... bb6 bb5 CFG Topology bb1 -> bb2, N-1 programs Using ¡“unstructured” ¡data ¡instead ¡of ¡fixed ¡length ¡of ¡ bb6 Topology bb1 -> bb2, bb3 CFG Topology bb3 bb2 -> bb5 vector bb1 -> bb2, bb3 bb2 -> bb5 ... Evaluation bb2 -> bb5 ... bb5 -> bb6 ... bb5 -> bb6 CFG topology and feature of bb5 -> bb6 each node for N-1 programs 12

  13. Motivation Graph-based Characterization using CFG Control ¡Flow ¡Graph ¡Features Control ¡flow ¡graphs ¡from ¡compiler 2MM ¡-­‑ ¡Matrix ¡Mul7plica7on State-of-the-art Features ¡of ¡Each ¡Node 8 Feature vector for each node Number ¡of ¡InstrucDons 1: <1,0,0,0,0,0,0,0,0,1,0,0> Number ¡of ¡Add ¡InstrucDon 2: <4,0,0,0,0,0,1,0,0,1,0,2> 7 1 9 3: <16,2,0,1,0,3,1,0,0,1,0,8> Graph-based Number ¡of ¡Sub ¡InstrucDon … 17 6 16: <2,1,0,0,0,0,0,0,0,1.0.0> Number ¡of ¡Mult ¡InstrucDon 17: <3,0,0,0,0,0,0,1,1,0,1,0> 18: <1,0,0,0,0,0,0,0,0,1,0,0> 18 Number ¡of ¡Div ¡InstrucDon 2 16 10 5 Number ¡of ¡Load ¡InstrucDon Topology of CFG Build & Use 4 15 Number ¡of ¡Store ¡InstrucDon 1->6 2->4 Number ¡of ¡Comparisons 11 14 3->4 3 … Number ¡of ¡CondiDonal ¡Branches 16->17 13 Evaluation 17->10 Number ¡of ¡UncondiDonal ¡Branches 17->18 Number ¡of ¡Phi ¡Nodes 12 Number ¡of ¡GetElementPtr ¡InstrucDon 13

  14. Motivation Building the Prediction Model Control ¡Flow ¡Graph ¡Features State-of-the-art Op7miza7on ¡Combina7on ¡ O Optimization Sequence O … Graph-based …" Build & Use Evaluation Predicted speedup of O over the Baseline 14

  15. Motivation Building the Prediction Model CFG features Opt. seqs and their speedup Opt. Combinations State-of-the-art for N-1 programs over baseline for N-1 programs N-1 1 . ... . . ... 1 ... ... ... ... Graph-based ... ... ... N-1 ... Build & Use Machine Learning Algorithm ... ... Evaluation Generated model for a given machine 15

  16. Motivation Evaluating Predictors N ¡ Number ¡of ¡evalua7ons ¡= ¡ N -­‑Shot ¡model State-of-the-art Non-­‑itera7ve ¡scenario ¡(1-­‑shot ¡model) Non-­‑itera7ve ¡scenario ¡(1-­‑shot ¡model) Op7miza7on ¡Combina7ons CFG ¡Features Itera7ve ¡scenario Itera7ve ¡scenario … Program ¡ Graph-based characteris7cs 5-­‑shot ¡model 5-­‑shot ¡model … … Build & Use … … Sort ¡by ¡Predicted ¡Speedup top5 top1 Evaluation Predicted ¡speedup ¡for ¡ each ¡combina7on 16

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