[serve] Add docs on configuring cv2 parallelism (#12652)

This commit is contained in:
Edward Oakes
2020-12-08 16:03:13 -06:00
committed by GitHub
parent 50f28811ac
commit fd4e025da6
2 changed files with 9 additions and 1 deletions
+6
View File
@@ -81,6 +81,12 @@ If you *do* want to enable this parallelism in your Serve backend, just set OMP_
client.create_backend("parallel_backend", MyBackend, 12)
.. note::
Some other libraries may not respect ``OMP_NUM_THREADS`` and have their own way to configure parallelism.
For example, if you're using OpenCV, you'll need to manually set the number of threads using ``cv2.setNumThreads(num_threads)`` (set to 0 to disable multi-threading).
You can check the configuration using ``cv2.getNumThreads()`` and ``cv2.getNumberOfCPUs()``.
.. _serve-batching:
Batching to improve performance