API Reference¶
- class gpuparallel.GPUParallel(n_gpu=1, n_workers_per_gpu=1, init_fn: Optional[Callable] = None, progressbar=True, ignore_errors=True)[source]¶
Bases:
object
- __init__(n_gpu=1, n_workers_per_gpu=1, init_fn: Optional[Callable] = None, progressbar=True, ignore_errors=True)[source]¶
- Parameters
n_gpu – Number of GPUs to use. The library doesn’t check if GPUs really available, it is simply provide consistent
worker_id
andgpu_id
to bothinit_fn
and task functions.n_gpu = 0
turns on synced debug mode.n_workers_per_gpu – Number of workers on every GPU.
init_fn – Function which will be called during worker init. Function must have parameters
worker_id
andgpu_id
(or**kwargs
). Helpful to init all common stuff (e.g. neural networks) here.progressbar – Allow to use tqdm progressbar.
ignore_errors – Either ignore errors inside tasks or raise them.