Skip to content

Debug for SYMGS+SPMV fusion#2

Open
xiaofengF wants to merge 1 commit intoARM-software:masterfrom
xiaofengF:master
Open

Debug for SYMGS+SPMV fusion#2
xiaofengF wants to merge 1 commit intoARM-software:masterfrom
xiaofengF:master

Conversation

@xiaofengF
Copy link

@xiaofengF xiaofengF commented Dec 16, 2022

Previous implementation of SYMGS+SPMV was using x_old to calculate the spmv (L * old_x + (D+U) * new_x), It was totally wrong due to the expression is equal to the value of source (i.e., b). The mathematical proof is that the backward induction is exact (U+D)x’’+Lx’=b.

It can also be proved by the applied code: ComputeSYMGS.cpp:764-768
totalContribution += xv[row] * currentDiagonal; while xv[row]=(rv[row] - totalContribution)/currentDiagonal, which gives totalContribution =rv[row]

Now we ensure all x are new, and we calculate Ax by (L+D+U)x = b-Lx_pre+Lx to reuse the data calculated in forward sweep.

Previous implementation of SYMGS+SPMV was using x_old to calculate the spmv (L * old_x + (D+U) * new_x), It was totally wrong due to the expression is equal to the value of source (i.e., b). The mathematical proof is that the backward induction is exact (U+D)x’’+Lx’=b. 

Now we ensure all x are new, and we calculate Ax by (L+D+U)x = b-Lx_pre+Lx to reuse the data calculated in forward sweep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant