Xtra-Computing / FedTree

A tree-based federated learning system (MLSys 2023)
https://fedtree.readthedocs.io/en/latest/index.html
Apache License 2.0
140 stars 38 forks source link

Is there any solution to bind `FedTree-train` program to specific cpu cores in standalone simulation? #56

Closed DarkHighness closed 1 year ago

DarkHighness commented 1 year ago

Hi, first, thank you for this great project!

I am running FedTree on one docker container and would like to bind FedTree-train program to some specific cpus instead of using whatever it can takes, which may causes problem when it uses too much resource.

Best regards, Twiliness

QinbinLi commented 1 year ago

Hi @DarkHighness ,

There are two solutions.

  1. You can use export OMP_NUM_THREADS=xxx to specify the number of threads used before running FedTree.
  2. You can also use taskset command to specify the CPU used to run the fedtree program, e.g., taskset -c 0-3 ./build/bin/FedTree-train examples/machine.conf to use only CPUs 0-3 to run Fedtree.
DarkHighness commented 1 year ago

Thanks for your timely reply!

Solution 1 works fine.