GPUParallel
Release v0.2.2. (Installation)
Joblib-like interface for parallel GPU computations (e.g. data preprocessing):
import torch
from gpuparallel import GPUParallel, delayed
def perform(idx, gpu_id, **kwargs):
tensor = torch.Tensor([idx]).to(gpu_id)
return (tensor * tensor).item()
result = GPUParallel(n_gpu=2)(delayed(perform)(idx) for idx in range(5))
print(sorted(result)) # [0.0, 1.0, 4.0, 9.0, 16.0]
Features
Sync mode for tasks debug (use
n_gpu = 0
)Progressbar with tqdm:
progressbar=True
Optional ignoring task errors:
ignore_errors=True
See Quickstart and API Reference for details.