-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Workers should inherit Pkg environment #28781
Comments
Can you explain a little bit more to whats happening? I have a large codebase I want to port to 1.0 that uses HPC/addprocs quite a bit. If I know better what is happening, maybe I can submit a PR |
I just got bitten by this issue while I was porting a small project from 0.6 to 1.0. As soon as I started using a separate environment for the project, worker processes started to throw In addition to @rened's suggestion, I would also suggest that |
@affans It seems that using Distributed
@everywhere using Pkg
@everywhere Pkg.activate(".") You can then use |
This requires some careful thinking about how best to do this. One possibility is to send a manifest from the master node to the workers and insist that the manifest be usable on all nodes. That's fine for non-dev packages and even for dev packages with relative paths but dev packages with absolute paths may be a bit of an issue. We could rewrite dev paths to use a commit instead and then send that over; of course, it requires that the workers know about the tree hash that's being used... |
I ran into the same problem and it took me a while to understand that the problem was with |
Another work around is to use the |
For now, that's the recommended way to do this. |
One thing one wants to be clear on is which enviroment a worker should be getting. As in: malmaud/TensorFlow.jl#493 |
Oh in the case of a package that owns a worker and want it it use it's environment it is even more complicated. Since even if the package created the worker, So workers need both the packages environment and the main environment. |
As an additional point, it turns out that setting |
I always run something like: addprocs(18, exeflags = "--project=$(Base.active_project())") would be nice if this could be the default, at least for local Until the GC issues with threading are fixed (e.g. #40644), then local While this can and should be fixed at the package level (i.e. minimize allocations), that will require a concerted effort, and in the mean time |
In addition to inheriting the project environment, I believe that local workers should use the same depot settings as well. (Technically, this is a separate issue, but I think it would be good to revisit and fix this at the same time as this.) Example of me working around this is here. |
If the |
…ng#43270) Local workers now inherit the package environment of the main process, i.e. the active project, LOAD_PATH, and DEPOT_PATH. This behavior can be overridden by passing the new `env` keyword argument, or by passing `--project` in the `exeflags` keyword argument. Fixes JuliaLang#28781, and closes JuliaLang#42089.
…ng#43270) Local workers now inherit the package environment of the main process, i.e. the active project, LOAD_PATH, and DEPOT_PATH. This behavior can be overridden by passing the new `env` keyword argument, or by passing `--project` in the `exeflags` keyword argument. Fixes JuliaLang#28781, and closes JuliaLang#42089.
(Moved over from JuliaLang/Pkg.jl#675)
If I have a project where I installed
MyPackage
and I can sayjulia --project -e "using MyPackage"
the following does only work when I manually activate the environment:
I would suggest that workers inherit the environment that is active when they are added with
addprocs
. Should there be any calls toPkg.activate
afteraddprocs
they have to be manually performed by the user on all workers.The text was updated successfully, but these errors were encountered: