TensorPlay
API reference
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-08

tensorplay.distributed.elastic.multiprocessing API

Functions 2

Classes 5

#

PContext

classFull reference ↗
class tensorplay.distributed.elastic.multiprocessing.PContext(name: str, entrypoint: ~collections.abc.Callable | str, args: tuple, envs: dict[int, dict[str, str]], logs_specs: ~tensorplay.distributed.elastic.multiprocessing.api.LogsSpecs | None = None, log_dir: str | None = None, redirects: ~tensorplay.distributed.elastic.multiprocessing.redirects.Std | dict[int, ~tensorplay.distributed.elastic.multiprocessing.redirects.Std] = <Std.NONE: 0>, tee: ~tensorplay.distributed.elastic.multiprocessing.redirects.Std | dict[int, ~tensorplay.distributed.elastic.multiprocessing.redirects.Std] = <Std.NONE: 0>, log_line_prefixes: dict[int, str] | None = None, duplicate_stdout_filters: list[str] | None = None, duplicate_stderr_filters: list[str] | None = None)[source]

Base class owning a homogeneous group of worker processes.

close(death_sig: Signals | None = None, timeout: int = 30) → None[source]

Terminate all workers with death_sig, escalating to kill.

poll() → RunProcsResult | None[source]

Return the terminal result, or None while workers are running.

start() → None[source]

Launch all workers.

wait(timeout: float = -1, period: float = 1) → RunProcsResult | None[source]

Block until completion (or timeout seconds); returns the result.

#

ProcessFailure

classFull reference ↗
class tensorplay.distributed.elastic.multiprocessing.ProcessFailure(local_rank: int, pid: int, exitcode: int, error_file: str | None = None, error_file_data: dict[str, Any] | None = None, message: str = '', timestamp: int = 0)[source]

Structured failure of one worker process.

#

Redirects

classFull reference ↗
class tensorplay.distributed.elastic.multiprocessing.Redirects(stdouts: Std | dict[int, ~tensorplay.distributed.elastic.multiprocessing.redirects.Std]=<Std.NONE: 0>, stderrs: Std | dict[int, ~tensorplay.distributed.elastic.multiprocessing.redirects.Std]=<Std.NONE: 0>)[source]

Per-stream redirection modes for a worker group.

#

RunProcsResult

classFull reference ↗
class tensorplay.distributed.elastic.multiprocessing.RunProcsResult(state: str = 'UNKNOWN', return_values: dict[int, ~typing.Any]=<factory>, failures: dict[int, ~tensorplay.distributed.elastic.multiprocessing.errors.ProcessFailure]=<factory>, stdouts: dict[int, str]=<factory>, stderrs: dict[int, str]=<factory>)[source]

Outcome of monitoring a worker group to completion.

is_failed() → bool[source]

Whether any worker failed.

#

Std

classFull reference ↗
class tensorplay.distributed.elastic.multiprocessing.Std(*values)[source]

Which standard streams a worker’s output should go to.

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

The ratio is in lowest terms and has a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate()

Returns self, the complex conjugate of any int.

denominator

the denominator of a rational number in lowest terms

classmethod from_bytes(bytes, byteorder='big', *, signed=False)
classmethod from_str(vm: str) → Std | dict[int, Std][source]

Parse to_map-style strings: 0/1/2/3 or i:j:k.

The per-rank form maps rank i (or default) to a mode; both 0:1 (shorthand for 0:1:1) and full triples are accepted.

imag

the imaginary part of a complex number

is_integer()

Returns True. Exists for duck type compatibility with float.is_integer.

numerator

the numerator of a rational number in lowest terms

real

the real part of a complex number

to_bytes(length=1, byteorder='big', *, signed=False)

Exceptions 2

On this page

Ask DeepWiki