applying logistic regression model on hpx parallel loops
play

Applying Logistic Regression Model on HPX Parallel Loops Zahra - PowerPoint PPT Presentation

Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Applying Logistic Regression Model on HPX Parallel Loops Zahra Khatami Lukas Troska Hartmut Kaiser J. Ramanujam Louisiana


  1. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Applying Logistic Regression Model on HPX Parallel Loops Zahra Khatami Lukas Troska Hartmut Kaiser J. Ramanujam Louisiana State University The STE || AR Group, http://stellar-group.org 15th Charm++ Workshop Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 1 / 27

  2. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Outline Motivation HPX HPX Current Challenges Proposed Methods Experimental Results Conclusion Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 2 / 27

  3. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Motivation • Loop-level parallelism. 1 Some of the loops cannot scale desirably to a large number of threads. 2 Overheads of manually tuning loop parameters. • Considering both dynamic runtime and static compile time information to achieve maximal parallel performance. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 3 / 27

  4. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion HPX 1 � Parallel C++ runtime system. � Enabling fine-grained task parallelism: Resulting in a better load balancing. � Providing efficient scalable parallelism. � Reducing SLOW factors: 1 S tarvation, 2 L atencies, 3 O verhead, 4 W aiting. 1Kaiser, Hartmut, et al. ”Hpx: A task based programming model in a global address space.” Proceedings of the 8th International Conference on Partitioned Global Address Space Programming Models. ACM, 2014. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 4 / 27

  5. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion HPX (a) (b) Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 5 / 27

  6. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion HPX Current Challenges Policy Description Implemented by seq sequential execution Parallelism TS, HPX par parallel execution Parallelism TS, HPX par vec parallel and Parallelism TS vectorized execution seq(task) sequential and HPX asynchronous execution par(task) parallel and HPX asynchronous execution execution policy: specifying execution restrictions of the work items: • sequential execution policy: run sequentially. • parallel execution policy: run in parallel. Problem: Manually selecting execution policies for executing HPX parallel algorithms 1 . 1H. Kaiser, T. Heller, D. Bourgeois, and D. Fey. ”Higher-level parallelization for local and distributed asynchronous taskbased programming.” In Proceedings of the First International Workshop on Extreme Scale Programming Models and Middleware, pages 29–37. ACM, 2015.. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 6 / 27

  7. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion HPX Current Challenges • chunk sizes: Overheads of determining chunk size 1 : 1 auto partitioner : exposed by the HPX algorithms. 2 static/dynamic chunk : execution policy’s parameter. 1Z. Khatami, H. Kaiser, and J. Ramanujam. ”Using hpx and op2 for improving parallel scaling performance of unstructured grid applications.” In Parallel Processing Workshops (ICPPW), 2016 45th International Conference on, pages 190–199. IEEE, 2016. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 7 / 27

  8. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Solution � Automating parameters selections by considering loops characteristics implemented in a learning model. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 8 / 27

  9. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Our Goal � Combining machine learning technique, compiler and runtime methods for utilizing maximum resource availability. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 9 / 27

  10. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Proposed Method 1 1 Designing Learning Model 2 Special Execution Policy 3 Feature Extraction: Collecting static and dynamic features 4 Learning Model Implementation 1Z. Khatami, L. Troska, H. Kaiser, and J. Ramanujam, ”Applying Machine Learning Techniques on HPX Parallel Algorithms,” in proceeding IPDPS PhD Forum, 2017. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 10 / 27

  11. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Designing Learning Model � Logistic regression models 1 • execution policy: Binary logistic regression model. • chunk sizes: Multinomial logistic regression model. 1 https://github.com/STEllARGROUP/hpxML/LearningAlgorithm Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 11 / 27

  12. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Binary Logistic Regression Model • Output = Sequential or parallel Updating weights: W T = [ ω 0 , ω 1 , ω 2 , .... ] ω k +1 = ( X T S k X ) − 1 X T ( S k X ω k + y − µ k ) Experiments: X ( i ) = [1 , x 1 ( i ) , x 2 ( i ) , ... ] T S ( i , i ) = µ ( i )(1 − µ ( i )) Bernoulli distribution value: µ ( i ) = 1 / (1 + e − W T x ( i ) ) Decision rule: y ( x ) = 1 ← → p ( y = 1 | x ) > 0 . 5 Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 12 / 27

  13. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Multinomial Logistic Regression Model • Output = Efficient chunk size → 0 . 001, 0 . 01, 0 . 1, and 0 . 5 of the loop’s iteration. Updating weights: ω new = ω old − H − 1 ∇ E ( ω ) Cross entropy error function: E ( ω 1 , ω 2 , ..., ω C ) = − � N � C c =1 t nc lny nc n =1 exp ( W T c X n ) y nc = y c ( X n ) = � C i =1 exp ( W T i X n ) Hessian matrix: ∇ ω i ∇ ω j E ( ω 1 , ω 2 , ..., ω C ) = � N n =1 y ni ( I ij − y nj ) X n X T n Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 13 / 27

  14. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion � Machine Learning Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 14 / 27

  15. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Special Execution Policy & Parameter � Applying it on a loop makes implementing learning model on that loop. • execution policy → par if (execution policy). • chunk sizes → adaptive chunk size() (execution policy’s parameter). f o r e a c h ( p a r i f , range . begin ( ) , range . end ( ) , lambda ) ; f o r e a c h ( p o l i c y . with ( a d a p t i v e c h u n k s i z e ) , range . begin ( ) , range . end ( ) , lambda ) ; Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 15 / 27

  16. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Feature Extraction & Selection � Introducing new ClangTool named ForEachCallHandler . v i r t u a l void run ( const MatchFinder : : MatchResult &R e s u l t ) { . . . i f ( p o l i c y s t r i n g . f i n d ( ” p a r i f ” ) != s t r i n g : : npos | | p o l i c y s t r i n g . f i n d ( ” a d a p t i v e c h u n k s i z e ” )!= s t r i n g : : npos ) { e x t r a c t f e a t u r e s ( lambda body ) ; . . . } } Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 16 / 27

  17. Motivation HPX HPX Current Challenges Proposed Methods Louisiana State University Experimental Results Conclusion Feature Extraction 1 Type Information dynamic number of threads dynamic number of iterations static number of total operations static number of float operations static number of comparison operations static deepest loop level static number of integer variables static number of float variables static number of if statements static number of if statements within inner loops static number of function calls static number of function calls within inner loops 1Mark Stephenson and Saman Amarasinghe. ”Predicting unroll factors using supervised classification.” In Code Generation and Optimization, 2005. CGO 2005. International Symposium on, pages 123-134. IEEE, 2005. 1Keith D Cooper, Devika Subramanian, and Linda Torczon. ”Adaptive optimizing compilers for the 21st century.” The Journal of Supercomputing, 23(1):7-22, 2001. 1Gennady Pekhimenko and Angela Demke Brown. ”Efficient program compilation through machine learning techniques.” In Software Automatic Tuning, pages 335-351. Springer, 2011. Zahra Khatami 15th Charm++ Workshop Logistic Regression Model on HPX Loops 17 / 27

Recommend


More recommend