-
Notifications
You must be signed in to change notification settings - Fork 10
save unnecessary matmul #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Hao Wu <skyw@nvidia.com>
990a47a to
e3bf176
Compare
|
/ok to test e3bf176 |
| # (i.e. the approximated eigenvectors diagonalize the kronecker factor) | ||
| approx_eigenvalue_matrix = eigenbasis.T @ kronecker_factor @ eigenbasis | ||
| # Update eigenbasis when necessary. Update is skipped only when adaptive update criteria is met. | ||
| if _adaptive_criteria_met( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_adaptive_criteria_met also extracts the diagonal and computes diagonal norm, in addition to matrix frobenius norm. So I think this will need the full approx_eigenvalue_matrix diagonal for diagonal norm and the kronecker factor for frobenius norm, separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. Added it back.
Signed-off-by: Hao Wu <skyw@nvidia.com>
Signed-off-by: Hao Wu <skyw@nvidia.com>
Signed-off-by: Hao Wu <skyw@nvidia.com>
|
/ok to test 7265ff4 |
mkhona-nvidia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New change
* save unnecessary matmul Signed-off-by: Hao Wu <skyw@nvidia.com> * simplify criteria logic Signed-off-by: Hao Wu <skyw@nvidia.com> * remove max precondition dim Signed-off-by: Hao Wu <skyw@nvidia.com> Signed-off-by: mikail <mkhona@nvidia.com>
* save unnecessary matmul Signed-off-by: Hao Wu <skyw@nvidia.com> * simplify criteria logic Signed-off-by: Hao Wu <skyw@nvidia.com> * remove max precondition dim Signed-off-by: Hao Wu <skyw@nvidia.com> Signed-off-by: mikail <mkhona@nvidia.com>
Only diagonal of approx_eigenvalue_matrix is needed for _orthogonal_iteration, added logic to skip the last matrix multiply.
Frobenius norm is unitarily invariant, that is for any orthogonal matrix Q and square matrix A ,$||Q^T A Q||_F = ||A||_F$ . So we can calculate norm on kronecker_factor instead of approx_eigenvalue_matrix.