Ray, Numba, and pycache

I am using a number of Numba (v 0.53) JIT functions within ray (v1.4) actors. It appears as though the ray actors are not reading the numba cache (*.nbi, *nbc files in pycache ), and thus every time I run, there is significant overhead while the each of the actors compile the numba codes the first time they are seen by the actor.

Is there anyway to avoid the recompile? Can I point the ray actors at the pycache of the project?

We need to understand how numba finds its cache files. Is it always checking its working directory? When you run ray actor, it uses the different working dir from the driver. You can verify it from the code below.

@ray.remote
class A:
    def __init__(self):
        import os 
        dir_path = os.path.dirname(os.path.realpath(__file__))
        print(dir_path)

a = A.remote() # Then the working dir will be printed