Cholesky decomposition Teodora Aleksic 3912012 Cholesky decomposition Cholesky

  • Slides: 12
Download presentation
Cholesky decomposition Teodora Aleksic, 391/2012

Cholesky decomposition Teodora Aleksic, 391/2012

Cholesky decomposition ◎ Cholesky factorization is a decomposition of a symmetric, positive-definite matrix (A)

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

C implementation for (int element i = 0; i < n; i++) Each of

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

Maxeler implementation challenges ◎ Our output matrix also serves as our input matrix ◎An

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

L_Test matrix as our matrix L Since we are comparing the C and Maxeler

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

Possible solutions Square root There are more ways to calculate the square root of

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 res 1 = sum / 2; DFEVar temp = res 1; do{ temp = res 1; res 1 = (temp + (sum / temp)) / 2; }while((temp - res 1) != zero) for(int k = 0; k < (N / 2); ++k){. . . } 6/12

Final Kernel graph 7/12

Final Kernel graph 7/12

Possible improvements So far, our stream went through the entire input and output matrix.

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. A= 1 2 3 4 5 6 7 8 9 8/12

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

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

“ I have not failed. I've just found 10, 000 ways that won't work.

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

References This presentations was made using the following resources: Information about the Cholesky decomposition:

References This presentations was made using the following resources: Information about the Cholesky decomposition: ◎ https: //en. wikipedia. org/wiki/Cholesky_decomposition ◎ https: //www. youtube. com/watch? v=Nppy. Uqg. Qqd 0 Information about Maxeler: ◎ http: //home. etf. rs/~vm/os/vlsi/index. html 11/12

Thanks! Any questions? You can reach me at: at 120391 d@student. etf. rs 12/12

Thanks! Any questions? You can reach me at: at 120391 d@student. etf. rs 12/12