From cd6aa3dbe3f51e0b90301c00c232c2a63bd4cca5 Mon Sep 17 00:00:00 2001 From: Roy Jacobson Date: Mon, 11 Nov 2024 17:12:06 +0200 Subject: [PATCH 1/2] [Doc] Describe how to manage multithreading --- docs/faq.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index 11947930..a099d84f 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -56,3 +56,10 @@ FAQ to run, depending on computer hardware specifications. Cellpose will take a long time to run on large images. Using hardware with a faster CPU and with more available memory will speed up the process. Using a GPU will also speed up the process, especially if you are training with a large dataset. + + +**Q: How can I control the amount of threads cellpose is using?** + + Under the hood, Cellpose is using PyTorch for parallelization. PyTorch is configurable through the environment + variables ``OMP_NUM_THREADS`` or ``MKL_NUM_THREADS`` as described + `here `_. From 9c1f38a3cf31913f5ed9608aa91799e89526ae6e Mon Sep 17 00:00:00 2001 From: Roy Jacobson Date: Mon, 11 Nov 2024 17:31:25 +0200 Subject: [PATCH 2/2] [DOC] Add torch.set_num_threads --- docs/faq.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/faq.rst b/docs/faq.rst index a099d84f..a6eeb6a7 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -60,6 +60,7 @@ FAQ **Q: How can I control the amount of threads cellpose is using?** - Under the hood, Cellpose is using PyTorch for parallelization. PyTorch is configurable through the environment + Under the hood, Cellpose is using PyTorch for parallelization. Number of threads for PyTorch can be set + using `torch.set_num_threads `_ or through the environment variables ``OMP_NUM_THREADS`` or ``MKL_NUM_THREADS`` as described `here `_.