Skip to content
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

faster reverse AD for mac(A,b,c) when A.is_constant() #2648

Open
Mathadon opened this issue Aug 6, 2020 · 1 comment · May be fixed by #2649
Open

faster reverse AD for mac(A,b,c) when A.is_constant() #2648

Mathadon opened this issue Aug 6, 2020 · 1 comment · May be fixed by #2649

Comments

@Mathadon
Copy link
Contributor

Mathadon commented Aug 6, 2020

The reverse AD implementation of mac(A,b,c) requires the transpose of A. (Surprisingly), computing the transpose of A can require a significant number of operations and there is no need to perform these when A is constant since the transpose can be performed off-line. I will propose an implementation that performs these computations off-line.

Note that the overhead for computing the transpose of A (in my not so rigorous benchmark) is in the same order of mtimes() while the transpose of A should be O(nnz) ~= O(n^2) and mtimes ~ O(n^3). Chances are that the memory allocation required by the transpose is much more expensive.

Mathadon added a commit to Mathadon/casadi that referenced this issue Aug 6, 2020
@jgillis
Copy link
Member

jgillis commented Aug 6, 2020

Excellent analysis here. Would be solved by #172

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 a pull request may close this issue.

2 participants