Open user706 opened 1 week ago
Ok, incredible, seems like 1st loading really takes that long: 4 minutes 19 seconds on a rather fast laptop
# in the shell (I'm using bash on linux)
python3 -m venv pyvenv
. pyvenv/bin/activate
pip install --upgrade pip
pip install -U aeon
#1st loading
time python -c "print('~~loading (1st)'); from aeon.classification.convolution_based import Arsenal; print('~~done (1st)')"
echo -e "\n\n\n"
#next loading
time python -c "print('~~loading (next)'); from aeon.classification.convolution_based import Arsenal; print('~~done (next)')"
results in
~~loading (1st)
/home/dude/aeon_test/pyvenv/lib/python3.12/site-packages/aeon/base/__init__.py:24: FutureWarning: The aeon package will soon be releasing v1.0.0 with the removal of legacy modules and interfaces such as BaseTransformer and BaseForecaster. This will contain breaking changes. See aeon-toolkit.org for more information. Set aeon.AEON_DEPRECATION_WARNING or the AEON_DEPRECATION_WARNING environmental variable to 'False' to disable this warning.
warnings.warn(
~~done (1st)
real 4m19,439s
user 4m12,878s
sys 0m10,163s
~~loading (next)
/home/dude/aeon_test/pyvenv/lib/python3.12/site-packages/aeon/base/__init__.py:24: FutureWarning: The aeon package will soon be releasing v1.0.0 with the removal of legacy modules and interfaces such as BaseTransformer and BaseForecaster. This will contain breaking changes. See aeon-toolkit.org for more information. Set aeon.AEON_DEPRECATION_WARNING or the AEON_DEPRECATION_WARNING environmental variable to 'False' to disable this warning.
warnings.warn(
~~done (next)
real 0m1,821s
user 0m1,975s
sys 0m3,774s
Why is that actually? Is that numba or something else compiling something in the back?? thanks
thanks for that, we will take a look
As shown in the 2nd comment: might be that a 1st loading always takes long.
I am very interested in the speed of stuff like Arsenal classification (during normal operation, not first loading)
Thanks.
hi, regarding the first question, I've just done a fresh install on windows through pycharm and it took about about 2 or 3 minutes, mostly scipy. I just tried with scikit-learn and it was a bit quicker, but still 1-2 mins and I think we have more core dependencies. Maybe your internet connection was flakey? I think it is just how it is and not really a bug, we cant really reduce our core dependencies any more. However, happy to hear any ideas on how to speed up the first build.
Regarding our implementation, its all done in numba and is we think as fast as it can be except for some possible minor tweaks.
Regarding implementing Arsenal and other Rocket classifiers in C++, I would say it would be quite easy for someone who knows C++ well, its basically lots of loops :)
hi, regarding the first question, I've just done a fresh install on windows through pycharm and it took about about 2 or 3 minutes, mostly scipy. I just tried with scikit-learn and it was a bit quicker, but still 1-2 mins and I think we have more core dependencies. Maybe your internet connection was flakey?
Hang on a second.
My issue was not the downloading (via pip install
), but that the very 1st call to...
#1st loading
python -c "print('~~loading (1st)'); from aeon.classification.convolution_based import Arsenal; print('~~done (1st)')"
... takes more than 4 minutes. (Probably because numba then kicks in and generates code, correct?)
But from then on... the ensuent calls (repeating the above) are fast.
Question:
How long does that 1st call take for you, just after having finished pip install
?
Thanks.
PS: I have no problem with it, if the 1st call takes long to generate or compile code; if it results in ensuent calls and actual classifications... being superfast. I just want to verify that this is normal behaviour.
I would assume numba compilation is the main culprit here, but not 100%. Is this only Arsenal or do you see this with other code you run? Best test would probably be something from deep_learning
.
I have noticed this, I think it is numba caching or some sort of import caching. We could probably add a warning to the webpage documentation at least, I don't see the numba function compilation being easily resolvable though, if it is even feasible.
I'll see if I can do some runs at a later point, very annoying since it has to be fresh 🙂.
I would assume numba compilation is the main culprit here, but not 100%. Is this only Arsenal or do you see this with other code you run?
Just the import is suffcient to cause a 4 minute lag (when run the 1st time, in fresh venv):
from aeon.classification.convolution_based import Arsenal
(I'm only using Arsenal)
By the way... the uncool thing with numba is... it starts to get complicated when trying to do pip install aeon
on ARM platforms such as raspberry pi: I need to separately compile LLVM in the correct version etc.
hi, regarding the first question, I've just done a fresh install on windows through pycharm and it took about about 2 or 3 minutes, mostly scipy. I just tried with scikit-learn and it was a bit quicker, but still 1-2 mins and I think we have more core dependencies. Maybe your internet connection was flakey?
Hang on a second. My issue was not the downloading (via
pip install
), but that the very 1st call to...
ah sorry, misunderstood.
Question: How long does that 1st call take for you, just after having finished
pip install
?
just done it, and it took about 2 minutes on a windows desk top, then is instant after that. As Matthew said, it will be the numba compilation. It has made me think of something though, it is possible it is compiling more functions than it needs. By modularising numba functions it means single runs like this may actually be doing more work than required. Efficient C programming and software engineering do not always go hand in hand :) We will discuss and see if we can sensibly measure this and maybe isolate more code.
PS: I have no problem with it, if the 1st call takes long to generate or compile code; if it results in ensuent calls and actual classifications... being superfast. I just want to verify that this is normal behaviour.
I think it is normal behaviour, although 4 mins is very slow for an import.
By the way... the uncool thing with numba is... it starts to get complicated when trying to do
pip install aeon
on ARM platforms such as raspberry pi: I need to separately compile LLVM in the correct version etc.
ouch, didnt know that, I have never used ARM platforms myself and am not good with such things, so cant really help. They claim to support ARM, maybe raise an issue over there?
https://numba.pydata.org/numba-doc/dev/user/installing.html
but if there is anything we can do our end to facilitate let us know
Probably related #1852. Unlikely to be resolved in the short term either case.
Adding a warming on the install page of the docs/(readme) with some short explanation might help new users to understand what is going on, I'll try to find some time to add it
Describe the bug
Hi, when doing
it takes forever.
my system
Ubuntu 24.04.1 LTS
(according tocat /etc/os-release
)Python 3.12.3
(according topython --version
after starting the venv (see below))reproduce (or does it work on your side?)
Any ideas?
details
stopping the freeze by hitting Ctrl-C, results in
or
Steps/Code to reproduce the bug
Expected results
should finish import quickly
Actual results
takes forever
Versions
Any ideas? thanks.