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
Slow FIT_TO_TEMPLATE in v2.8 #680
Comments
Small update, I could reproduce this on a colab with gcc-9. Still working on a solution |
It looks like this is the problematic change:
Reverting this change alone fixes the problem. In the colab, see at the end of the notebook the timings.
@Jayashrita could you please test this on your system? You should just apply this change (likely working with master branch):
|
I tested this on my system and this solves the problem. The simulations are as fast as before. |
I better checked and found the bug. There is an incorrect implementation of operator () in class Matrix<>. Namely this line:
should have been:
What happens in the original implementation is that whenever one tries to access an element of a @Jayashrita you might want to try this (instead of what I suggested above). I made a test at the end of the colab and this little change alone seems to fix the problem. Since this issue was present in the Matrix class since the very beginning and it might significantly affect performance in some operation, I will backport it to v2.5 |
The change in the Matrix class fixes the problem too. |
This was reported by @Jayashrita
Apparently, commit ac993af introduces a severe performance hit in the
apply()
phase of FIT_TO_TEMPLATE. I checked the code and the only relevant change seems this one:This function is called in FitToTemplate:
In principle there should be no impact, but perhaps the compiler is fooled by some change and misses an inlining.
I will try to reproduce the performance hit in my computer and then fix it.
The text was updated successfully, but these errors were encountered: