lenskit.parallel.config#
Functions
Return the effective CPU count using the best available data. |
|
Make sure LensKit parallelism is configured, and configure with defaults if it is not. |
|
Ensure that parallelism is configured and return the configuration. |
|
|
Set up and configure LensKit parallelism. |
Get a parallel configuration for a subprocess. |
Classes
|
- class lenskit.parallel.config.ParallelConfig(processes: 'int', threads: 'int', backend_threads: 'int', child_threads: 'int')#
Bases:
object
- lenskit.parallel.config.initialize(config=None, *, processes=None, threads=None, backend_threads=None, child_threads=None)#
Set up and configure LensKit parallelism. This only needs to be called if you want to control when and how parallelism is set up; components using parallelism will call
ensure_init()
, which will call this function with its default arguments if it has not been called.See also
- Parameters:
processes (int | None) – The number of processes to use for multiprocessing evaluations (see
LK_NUM_PROCS
)threads (int | None) – The number of threads to use for parallel model training and similar operations (see
LK_NUM_THREADS
).backend_threads (int | None) – The number of threads underlying computational engines should use (see
LK_NUM_BACKEND_THREADS
).child_threads (int | None) – The number of threads backends are allowed to use in the worker processes in multiprocessing operations (see
LK_NUM_CHILD_THREADS
).config (ParallelConfig | None)
- lenskit.parallel.config.ensure_parallel_init()#
Make sure LensKit parallelism is configured, and configure with defaults if it is not.
Components using parallelism or intensive computations should call this function before they begin training.
- lenskit.parallel.config.get_parallel_config()#
Ensure that parallelism is configured and return the configuration.
- Return type:
- lenskit.parallel.config.subprocess_config()#
Get a parallel configuration for a subprocess.
- Return type:
- lenskit.parallel.config.effective_cpu_count()#
Return the effective CPU count using the best available data. Tries the following in order:
- Return type: