-
Notifications
You must be signed in to change notification settings - Fork 575
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
Speed up PennyLane load time #1961
Comments
Nice catch @cvjjm! Speeding up the import time would be a huge quality-of-life improvement. Currently, we dynamically import pennylane/pennylane/__init__.py Lines 140 to 142 in 854d4b4
but I'm sure we can somehow make this a 'lazy' import that is only loaded when first called. |
@cvjjm I'm suddenly a bit confused. I can't recreate this behaviour locally; when I It seems we are already taking care of this in the pennylane/qchem/pennylane_qchem/qchem/openfermion.py Lines 18 to 24 in 9687c13
Are you using an older version of qchem? |
Indeed!! Looks like I picked a bad conda env for this test. This was with qchem 15.1 :-) Well, happy that at least this lead you to looking into making the whole qchem import lazy :-) |
Feature details
I have noticed that PennyLane import time is growing longer and longer and did a quick profiling session following this guide. The results look like this:
So, over 60% of the time is spent on importing qchem and most of that is attributable to openfermion. Now of course you can say that I should approach the openfermion people and tell them to speed up their load time, but clearly there are many programs that use pennylane, but don't need qchem and openfermion and in that case, even if those are installed, it would be nice if pennylane would start up fast.
Can qchem maybe be imported on demand?
Implementation
No response
How important would you say this feature is?
1: Not important. Would be nice to have.
Additional information
No response
The text was updated successfully, but these errors were encountered: