Skip to content

Commit f30292f

Browse files
committed
Minor doc improvement for parallel
1 parent 636c41f commit f30292f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/getting-started/installation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ Additionally, the [Influence functions][pydvl.influence] module requires PyTorch
5555

5656
ray is used to distribute workloads across nodes in a cluster (it can be used
5757
locally as well, but for this we recommend joblib instead). Please follow the
58-
instructions in their documentation to set up the cluster.
58+
instructions in their documentation to set up the cluster. Once you have a
59+
running cluster, you can use it by passing the address of the head node to
60+
parallel methods via [ParallelConfig][pydvl.utils.parallel].
5961

6062
## Setting up the cache
6163

src/pydvl/utils/parallel/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""
22
This module provides a common interface to parallelization backends. The list of
3-
supported backends is [here][pydvl.utils.parallel.backends].
3+
supported backends is [here][pydvl.utils.parallel.backends]. Backends can be
4+
selected with the `backend` argument of an instance of
5+
[ParallelConfig][pydvl.utils.config.ParallelConfig], as seen in the examples
6+
below.
47
58
We use [executors][concurrent.futures.Executor] to submit tasks in parallel. The
69
basic high-level pattern is
@@ -23,7 +26,7 @@
2326
from pydvl.utils.config import ParallelConfig
2427
2528
config = ParallelConfig(backend="joblib")
26-
with init_executor() as executor:
29+
with init_executor(config=config) as executor:
2730
results = list(executor.map(lambda x: x + 1, range(5)))
2831
assert results == [1, 2, 3, 4, 5]
2932
```

0 commit comments

Comments
 (0)