pyphi.cost#

Analytic workload counting for single-system analyses.

Counts the work a pyphi.analyze() call would perform — system partitions swept by the system irreducibility analysis, candidate mechanisms, connectivity-pruned purview evaluations, and mechanism partitions per (mechanism, purview) pair — without computing any φ. Counts are produced by driving the same enumeration machinery the analysis uses under the active configuration, so the partition schemes, the connectivity, and the alphabet are all reflected exactly.

Counts are turned into work units by weighting each axis by its measured relative cost, so a unit is the same amount of work whatever mix of purview evaluations and partition sweeps produces it. One further constant, SECONDS_PER_UNIT, converts units to CPU seconds on reference hardware; units_for_runtime() inverts it, which is how a per-shard runtime target becomes a units_per_job budget.

Module attributes

PURVIEW_EVALUATION_UNITS

Work units one purview evaluation costs, taking one partition as the unit.

SECONDS_PER_UNIT

CPU seconds one work unit costs on reference hardware.

REPERTOIRE_FACTOR

Repertoires concurrently alive during a mechanism-partition sweep.

BASE_MEMORY_BYTES

interpreter, imports, substrate TPM, task payload.

CACHE_HEADROOM_BYTES

Memory a shard's request grants its repertoire caches.

Functions

estimate_analysis(substrate[, state, ...])

Count the workload of a single-system analysis, without running it.

mechanism_workloads(substrate[, subset, ...])

Per-mechanism workload under a scope, keyed by mechanism.

partition_sweep_count(mechanism_size, ...)

Memoized mechanism-partition count for one (mechanism, purview) pair under the active mechanism partition scheme.

round_memory_bytes(n)

Round a byte count up to the next 512 MB request boundary.

runtime_seconds(units)

Estimated CPU seconds to compute units work units.

shard_cache_budget_bytes(memory_bytes)

Cache ceiling for a shard whose memory request is memory_bytes.

shard_memory_bytes(max_repertoire_cells)

Estimated peak memory of a shard from its largest repertoire.

units_for_runtime(seconds)

The units_per_job budget targeting seconds of CPU per shard.

Classes

AnalysisEstimate(n_units, state_space_size, ...)

The workload of a single-system analysis, before running it.

MechanismWorkload(units, max_repertoire_cells)

One mechanism's scoped workload and peak-memory driver.