espnet3.parallel.parallel.build_local_gpu_cluster
Less than 1 minute
espnet3.parallel.parallel.build_local_gpu_cluster
espnet3.parallel.parallel.build_local_gpu_cluster(n_workers: int, options: dict) → Client
Create a Dask LocalCUDACluster using available GPUs.
This requires dask_cuda package.
- Parameters:
- n_workers (int) – Number of Dask workers (must not exceed number of GPUs).
- options (dict) – Additional options for the LocalCUDACluster.
- Returns: Dask client connected to the GPU cluster.
- Return type: Client
- Raises:
- RuntimeError – If
dask_cudais not installed. - ValueError – If
n_workersexceeds the number of available GPUs.
- RuntimeError – If
Example
>>> client = build_local_gpu_cluster(n_workers=2, options={})
>>> client.close()