statsforecast icon indicating copy to clipboard operation
statsforecast copied to clipboard

[FEAT] Add environment variables for `njit`'s `cache=True` and `nogil=True`

Open AzulGarza opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. To speed up numba functions, cache=True can be used to avoid compilation times each time the function is invoked; and nogil=True can be used to release Python's GIL which can be useful since when doing multiprocessing numba compiles the function for every process.

Describe the solution you'd like I've been thinking about a solution for a while and I think the best thing to do is to include environment variables for each argument, as suggested here.

Describe alternatives you've considered Maybe default both arguments to True, but it is too restrictive.

AzulGarza avatar Jun 02 '22 05:06 AzulGarza

This should also resolve https://github.com/alan-turing-institute/sktime/pull/2527.

AzulGarza avatar Jun 02 '22 05:06 AzulGarza

Is there any update on this ? Seems, currently it is neither directly possible in Numba or in the StatsForecast package. But would be really useful feature. I thought of enabling cache by default and let the users use the numba environment [NUMBA_DISABLE_JIT] (https://numba.readthedocs.io/en/stable/reference/envvars.html#envvar-NUMBA_DISABLE_JIT) to toggle using the caching function but using that environment variable results in errors.

VivCh14 avatar Jun 05 '23 13:06 VivCh14

This was added in #651

jmoralez avatar Nov 28 '23 23:11 jmoralez