Skip to content

Config

ParallelConfig dataclass

Configuration for parallel computation backend.

PARAMETER DESCRIPTION
backend

Type of backend to use. Defaults to 'joblib'

TYPE: Literal['joblib', 'ray'] DEFAULT: 'joblib'

address

Address of existing remote or local cluster to use.

TYPE: Optional[Union[str, Tuple[str, int]]] DEFAULT: None

n_cpus_local

Number of CPUs to use when creating a local ray cluster. This has no effect when using an existing ray cluster.

TYPE: Optional[int] DEFAULT: None

logging_level

Logging level for the parallel backend's worker.

TYPE: int DEFAULT: WARNING

wait_timeout

Timeout in seconds for waiting on futures.

TYPE: float DEFAULT: 1.0

MemcachedClientConfig dataclass

Configuration of the memcached client.

PARAMETER DESCRIPTION
server

A tuple of (IP|domain name, port).

TYPE: Tuple[str, int] DEFAULT: ('localhost', 11211)

connect_timeout

How many seconds to wait before raising ConnectionRefusedError on failure to connect.

TYPE: float DEFAULT: 1.0

timeout

seconds to wait for send or recv calls on the socket connected to memcached.

TYPE: float DEFAULT: 1.0

no_delay

set the TCP_NODELAY flag, which may help with performance in some cases.

TYPE: bool DEFAULT: True

serde

a serializer / deserializer ("serde"). The default PickleSerde should work in most cases. See pymemcached's documentation for details.

TYPE: PickleSerde DEFAULT: PickleSerde(pickle_version=PICKLE_VERSION)

MemcachedConfig dataclass

Configuration for memcached(), providing memoization of function calls.

Instances of this class are typically used as arguments for the construction of a Utility.

PARAMETER DESCRIPTION
client_config

Configuration for the connection to the memcached server.

TYPE: MemcachedClientConfig DEFAULT: field(default_factory=MemcachedClientConfig)

time_threshold

computations taking less time than this many seconds are not cached.

TYPE: float DEFAULT: 0.3

allow_repeated_evaluations

If True, repeated calls to a function with the same arguments will be allowed and outputs averaged until the running standard deviation of the mean stabilises below rtol_stderr * mean.

TYPE: bool DEFAULT: False

rtol_stderr

relative tolerance for repeated evaluations. More precisely, memcached() will stop evaluating the function once the standard deviation of the mean is smaller than rtol_stderr * mean.

TYPE: float DEFAULT: 0.1

min_repetitions

minimum number of times that a function evaluation on the same arguments is repeated before returning cached values. Useful for stochastic functions only. If the model training is very noisy, set this number to higher values to reduce variance.

TYPE: int DEFAULT: 3

ignore_args

Do not take these keyword arguments into account when hashing the wrapped function for usage as key in memcached.

TYPE: Optional[Iterable[str]] DEFAULT: None


Last update: 2023-10-14
Created: 2023-10-14