Limit number of cores per client

Hi guys, when I use the flower-authenitcation example that doesn’t use local-simulation how do I limit the number of cores per client? (Write in English

1 Like

Hello @sarahfalco, there is no built-in way to achieve since the SuperNodes and the execution of ClientApps happen as standard python processes. Therefore, you can use the same techniques to limit CPU utilization as in any other python program. For example, if your ClientApp is using PyTorch and you want to limit how much CPU it can use, you. may set something like:

import torch

torch.set_num_threads(1)      # Limit intra-op parallelism
torch.set_num_interop_threads(1)  # Limit inter-op parallelism

But a more general approach would be to use cgroups or running your SuperNodoes in Docker and limit the resources of each container. These are some ideas, i hope it helps!

1 Like