Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cholesky decomposition Teodora Aleksi ć, 391/2012.

Similar presentations


Presentation on theme: "Cholesky decomposition Teodora Aleksi ć, 391/2012."— Presentation transcript:

1 Cholesky decomposition Teodora Aleksi ć, 391/2012

2 Cholesky decomposition ◎ Cholesky factorization is a decomposition of a symmetric, positive-definite matrix (A) into a lower triangular matrix (L) ◎ It is mainly used for solutions of linear equations and Monte Carlo simulations 2/12

3 C implementation Each element of the resulting matrix is calculated with one of these two equations. Using them we can assemble the C code. for (int i = 0; i < n; i++) for (int j = 0; j < (i+1); j++) { double sum = a[i][j]; for (int k = 0; k < j; k++) sum -= l[i][k] * l[j][k]; if(i == j){ l[i][j] = sqrt(sum); } else{ l[i][j] = sum / l[i][i]; } 3/12

4 Maxeler implementation challenges ◎ Our output matrix also serves as our input matrix ◎ An alternate solution to the square root ◎ Overcoming the barrier between regular Java types and DFE 4/12

5 L_Test matrix as our matrix L Since we are comparing the C and Maxeler implementation, we can use the result of the C decomposition as our input for the Maxeler calculation. 5/12

6 Possible solutions Square root There are more ways to calculate the square root of a number than just the standard sqrt function. Predicting our loops We can predict the lengths of our loops instead having them depend on our DFE variables. DFEVar res1 = sum / 2; DFEVar temp = res1; do{ temp = res1; res1 = (temp + (sum / temp)) / 2; }while((temp - res1) != zero) DFEVar res1 = sum / 2; DFEVar temp = res1; for(int k = 0; k < N; ++k){... } 6/12

7 7/12 Final Kernel graph

8 Possible improvements So far, our stream went through the entire input and output matrix. We can improve our performances by only calculating those elements that matter to us. 23 6 A = 1 9 54 78 8/12

9 Cholesky decomposition Is it a good algorithm for Maxeler? 9/12

10 “ I have not failed. I've just found 10,000 ways that won't work. Thomas A. Edison 10/12

11 References This presentations was made using the following resources: ◎ Milutinovic, V., Salom, J., Trifunovic, N., Giorgi, R., “Guide to DataFlow SuperComputing ”, Springer, 2015. ◎ Milutinovic, V., et al., “Paradigm Shift in SuperComputing: DataFlow vs. ControlFlow ”, Journal of Big Data, 2015. ◎ Hurson, A., Milutinovic, V., editors, “DataFlow Processing ”, Elsevier, 2015. ◎ Wikipedia.org, “Cholesky decomposition ”, 2002., Available: https://en.wikipedia.org/wiki/Cholesky_decomposition [Accessed: 26-Jan-2016]. https://en.wikipedia.org/wiki/Cholesky_decomposition ◎ Bishop, J., “Linear Algebra: Cholesky Decomposition Example ”, 2013., Available: https://www.youtube.com/watch?v=NppyUqgQqd0 [Accessed: 26-Jan-2016] https://www.youtube.com/watch?v=NppyUqgQqd0 ◎ Smith, J., “Cordelia ”, Available: http://www.slidescarnival.com/cordelia-free- presentation-template/216 [Accessed: 30-Jan-2016]http://www.slidescarnival.com/cordelia-free- presentation-template/216 11/12

12 Thanks! Any questions? You can reach me at: at120391d@student.etf.rs Or: teodora_aleksic@ymail.com 12/12


Download ppt "Cholesky decomposition Teodora Aleksi ć, 391/2012."

Similar presentations


Ads by Google