Numba.core.cpu importing stuff from numba.experimental

Hello all.

I am wondering if there is a better way to handle install_registry calls given. here:

This is particularly causing a problem to me when I am bundling my package with pyinstaller(while having numba as a dependency). “_box” shared library file in numba.experimental.jitclass particularly causing trouble but I do not depend on any experimental feature and I am manually dropping experimental submodule to save the day. This is how I am handling things currently but I want to discuss here to see if we can have cleaner solutions on both end.

As far as I understood, experimental features meant to be for the users who want to use them and shouldn’t affect the stable API experience in the rest of the codebase. Aside from the inconvenience I am facing with pyinstaller, it can be useful to not import anything experimental unless user asks for it IMHO.

I am not sure if this is the right place to discuss on this but happy to migrate my question to correct platform if admins can direct me.

Hi @ACS,

Thanks for raising this. Given the nature of this request/discussion, please could you open an issue on the issue tracker for it Issues · numba/numba · GitHub ? Once there’s an issue number I’ll make sure it’s raised at Weekly Public Meeting every Tuesday for 2021 - #2. Thanks!

As a side note, the above code has undergone quite a few changes in recent months and is scheduled for more. Numba core is trying to reduce the reliance on multiple registries and import time assembly of the implemented functions. This is because there are too many difficult side effects to deal with, especially since the APIs for extending to new targets were added. These changes were made largely to try and prevent leaks of functions across targets and reduce side effects, i.e. make sure you can’t accidentally compile in a CPU function call on a GPU target. Whilst this isn’t specifically related to the use of numba.experimental the same code paths are used to avoid specific import time side effects and I’m not sure yet how easy it will be to untangle this. It might be easier to try and work out a solution for your use case.

1 Like

I made an issue here: numba-core-cpu-importing-stuff-from-numba-experimental · Issue #7532 · numba/numba · GitHub

Many thanks. We’ll use that to track this issue.