-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feature/427-batch-…
…parallelized-calculations-of-beta-shapley # Conflicts: # tests/value/test_semivalues.py
- Loading branch information
Showing
31 changed files
with
145 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
9 changes: 6 additions & 3 deletions
9
src/pydvl/utils/parallel/backends/joblib.py → src/pydvl/parallel/backends/joblib.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import logging | ||
from dataclasses import dataclass | ||
from typing import Literal, Optional, Tuple, Union | ||
|
||
__all__ = ["ParallelConfig"] | ||
|
||
|
||
@dataclass(frozen=True) | ||
class ParallelConfig: | ||
"""Configuration for parallel computation backend. | ||
Args: | ||
backend: Type of backend to use. Defaults to 'joblib' | ||
address: Address of existing remote or local cluster to use. | ||
n_cpus_local: Number of CPUs to use when creating a local ray cluster. | ||
This has no effect when using an existing ray cluster. | ||
logging_level: Logging level for the parallel backend's worker. | ||
wait_timeout: Timeout in seconds for waiting on futures. | ||
""" | ||
|
||
backend: Literal["joblib", "ray"] = "joblib" | ||
address: Optional[Union[str, Tuple[str, int]]] = None | ||
n_cpus_local: Optional[int] = None | ||
logging_level: int = logging.WARNING | ||
wait_timeout: float = 1.0 | ||
|
||
def __post_init__(self) -> None: | ||
# FIXME: this is specific to ray | ||
if self.address is not None and self.n_cpus_local is not None: | ||
raise ValueError("When `address` is set, `n_cpus_local` should be None.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
# This module is deprecated | ||
!!! warning "Redirects" | ||
Imports from this module will be redirected to | ||
[pydvl.parallel][pydvl.parallel] only until v0.9.0. Please update your | ||
imports. | ||
""" | ||
import logging | ||
|
||
from ..parallel.backend import * | ||
from ..parallel.config import * | ||
from ..parallel.futures import * | ||
from ..parallel.map_reduce import * | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
# This string for the benefit of deprecation searches: | ||
# remove_in="0.9.0" | ||
log.warning( | ||
"Importing parallel tools from pydvl.utils is deprecated. " | ||
"Please import directly from pydvl.parallel. " | ||
"Redirected imports will be removed in v0.9.0" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.