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

Create tsai.basics to speed up loading #320

Closed
oguiza opened this issue Dec 16, 2021 · 3 comments
Closed

Create tsai.basics to speed up loading #320

oguiza opened this issue Dec 16, 2021 · 3 comments
Labels
enhancement New feature or request performance

Comments

@oguiza
Copy link
Contributor

oguiza commented Dec 16, 2021

from tsai.all import * loads all modules in tsai, which is convenient but takes a long time and it’s unnecessary in most cases.
It’d be useful to have an alternative that loads the most frequently used modules in tsai, like fastai.basics does. This would reduce the time to load the main modules.

@oguiza oguiza added enhancement New feature or request performance labels Dec 16, 2021
@oguiza oguiza closed this as completed in 6a3b187 Mar 1, 2022
@oguiza
Copy link
Contributor Author

oguiza commented Mar 1, 2022

Additional information
Here's a time comparison performed in Google Colab. All timings are taken after a runtime restart.

  • For benchmarking:
    import fastai takes 0.009s
    from fastai.basics import * takes .4s

  • before fixing this issue :
    import tsai takes 0.006s
    from tsai.basics import * is not available
    from tsai.all import * takes 158s

  • after fixing this issue :
    import tsai takes 0.007s
    from tsai.basics import * takes 4s
    from tsai.all import * takes 3s

This is a great performance improvement. You can continue using tsai as you were using it before, but it will load much faster.

The main reason for this improvement is that tsfresh (one of the dependencies is not loaded by default as it was before. It takes very long to load this library, and it's barely used in the library. There's no need to load it.

@oguiza oguiza reopened this Mar 1, 2022
@oguiza oguiza closed this as completed Mar 1, 2022
@vrodriguezf
Copy link
Contributor

This is huge Ignacio, many thanks!

@oguiza
Copy link
Contributor Author

oguiza commented Mar 2, 2022

This is huge Ignacio, many thanks!

Thanks, Victor!! 😃
I'm now trying to also significantly reduce the time to pip install it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

No branches or pull requests

2 participants