You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following this discussion, I would like to make the dask tasks use only one thread each, even if they use BLAS / OMP.
I'm not sure here is the best place to ask, but how can we achieve that on a cluster?
I suppose we could modify the command line of the job scheduler to be able to export some variables.
Without dask, I have seen some other solutions with pure python code that modify os.environ before importing numpy, but I'm not sure how dask handles the imports.
Following [this discussion](https://stackoverflow.com/questions/52895211/how-do-dask-threads-interact-with-openblas-mkl), I would like to make the dask tasks use only one thread each, even if they use BLAS / OMP.
I'm not sure here is the best place to ask, but how can we achieve that on a cluster?
I suppose we could modify the command line of the job scheduler to be able to export some variables.
Without dask, I have seen some other solutions with pure python code that modify `os.environ` before importing numpy, but I'm not sure how dask handles the imports.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#179
Oh, very nice! Sorry, I should have looked better in the documentation.
Maybe we could provide a nice argument that sets all those variables to the same value?
Personally I have to google them again every time I need them, so this would be appreciable.
I'm not sure this is a very frequent user case. Just out of curiosity: When and why do you need to restrict each task to one thread?
I want to know exactly the CPU usage of my workers.
If I "promise" to the job scheduler that I will use n cores (1 per task) but the BLAS/OMP routines use more, I'll definitely disrupt the other users, and some aggressive job schedulers might kill your workers.
I prefer to avoid proposing too many functionalities in the codebase, especially if they would be used only by a handful of people.
As I formulated it, it wasn't really useful and can be done without this functionality.
What I need is a way to allocate cores*task_threads cores and set *_NUM_THREADS=task_threads.
So if one wants task_threads=1 then env_extra is enough, but otherwise it is necessary to be able to allocate more cores.
In my use case, task_threads=1 is perfect so I won't take offence if you decide no one needs that.
I don't know on what issue I should answer (maybe we should close one or both to create a new one that summarizes the two).
As pointed by the code on the other issue, the interface is different between schedulers. It would be good to unify the apis for the number of cores.
You would be right to argue that this problem is not frequent enough to change the api, but having a consistent api will allow to better explain the threads, processes, etc....
As pointed by the code on the other issue, the interface is different between schedulers. It would be good to unify the apis for the number of cores.
Yes I think your totally right about this. So I will not try to argue as there is two of you needing this (is this a friend of you 🙂 ?). As this issue was first on ENV var, and I think we've answer that part. I propose to close this issue in favor of #181 which is focused on the second problem you mention. Happy to leave it open though if you think you need to clarify things in the docs or anywhere in the code.
Activity
willirath commentedon Oct 20, 2018
louisabraham commentedon Oct 20, 2018
Oh, very nice! Sorry, I should have looked better in the documentation.
Maybe we could provide a nice argument that sets all those variables to the same value?
Personally I have to google them again every time I need them, so this would be appreciable.
willirath commentedon Oct 20, 2018
guillaumeeb commentedon Oct 20, 2018
I prefer to avoid proposing too many functionalities in the codebase, especially if they would be used only by a handful of people.
You can use
env_extraas proposed by @willirath, and store your defaults in a configuration file.We could also add some documentation for this, explaining why it can be needed, and how to configure it.
louisabraham commentedon Oct 20, 2018
I want to know exactly the CPU usage of my workers.
If I "promise" to the job scheduler that I will use n cores (1 per task) but the BLAS/OMP routines use more, I'll definitely disrupt the other users, and some aggressive job schedulers might kill your workers.
As I formulated it, it wasn't really useful and can be done without this functionality.
What I need is a way to allocate
cores*task_threadscores and set*_NUM_THREADS=task_threads.So if one wants
task_threads=1thenenv_extrais enough, but otherwise it is necessary to be able to allocate more cores.In my use case,
task_threads=1is perfect so I won't take offence if you decide no one needs that.guillaumeeb commentedon Oct 20, 2018
If you need to do something like this, then use
ncpusto tell LSF you will need more resources than just the one used by the workers:Does that sound OK for your need?
louisabraham commentedon Oct 23, 2018
I don't know on what issue I should answer (maybe we should close one or both to create a new one that summarizes the two).
As pointed by the code on the other issue, the interface is different between schedulers. It would be good to unify the apis for the number of cores.
You would be right to argue that this problem is not frequent enough to change the api, but having a consistent api will allow to better explain the threads, processes, etc....
guillaumeeb commentedon Oct 23, 2018
Yes I think your totally right about this. So I will not try to argue as there is two of you needing this (is this a friend of you 🙂 ?). As this issue was first on ENV var, and I think we've answer that part. I propose to close this issue in favor of #181 which is focused on the second problem you mention. Happy to leave it open though if you think you need to clarify things in the docs or anywhere in the code.
louisabraham commentedon Oct 24, 2018
I swear we don't know each other!
Agreed to close this.