backends
run.backends
What each backend can do, as the workflow planner reads it.
BACKENDS is the table tvbo.run.workflow.plan consults: BackendSpec.vectorize_axes decides which sweep axes stay inside one backend invocation (vmap, EnsembleProblem, batched solve) and which a workflow engine fans out as separate tasks, and tvbo run --shard slices only the axes a backend vectorises. It is a plain Python table, so importing it pulls in neither rdflib nor owlready2.
Task and capability names are the tvbo:SimulationTask and tvbo:BackendCapability individuals of ontology/tvb-o-axioms.ttl (section 4.1). The table is written by hand rather than read from that file, and the ontology declares no vectorisable axes, so the ontology is the vocabulary here and not the source of the values.
Attributes
| Name | Description |
|---|---|
| AXIS_KINDS | |
| BACKENDS |
Classes
| Name | Description |
|---|---|
| BackendSpec | Static description of a backend’s capabilities. |
BackendSpec
run.backends.BackendSpec(
name,
label,
tasks,
capabilities,
vectorize_axes=frozenset(),
aliases=(),
)Static description of a backend’s capabilities.
Methods
| Name | Description |
|---|---|
| can_vectorize | Whether a sweep axis of axis_kind (one of AXIS_KINDS) can stay inside one invocation of this backend. |
| supports_task | Whether this backend performs task, a tvbo:SimulationTask name. |
can_vectorize
run.backends.BackendSpec.can_vectorize(axis_kind)Whether a sweep axis of axis_kind (one of AXIS_KINDS) can stay inside one invocation of this backend.
supports_task
run.backends.BackendSpec.supports_task(task)Whether this backend performs task, a tvbo:SimulationTask name.
Functions
| Name | Description |
|---|---|
| axis_kind_of | Classify an exploration axis by its dotted parameter path. |
| effective_backend | The backend that runs experiment: requested when given, else its declared execution.backend, else tvboptim. |
| list_backends | Every registered backend, in registration order. |
| resolve_backend | Look up a backend by canonical key or alias. |
axis_kind_of
run.backends.axis_kind_of(parameter_path)Classify an exploration axis by its dotted parameter path.
Examples
>>> axis_kind_of("ReducedWongWang.G")
'parameters'
>>> axis_kind_of("integrator.noise_seed")
'noise_seed'
>>> axis_kind_of("initial_conditions.x")
'initial_conditions'
>>> axis_kind_of("sample.subject_id")
'subjects'effective_backend
run.backends.effective_backend(experiment, requested=None)The backend that runs experiment: requested when given, else its declared execution.backend, else tvboptim.
An explicit --backend wins for the whole run; otherwise each experiment self-selects (a spiking network declares brian2), so one study can mix a mean-field sweep and a spiking column and run each on the right engine.
list_backends
run.backends.list_backends()Every registered backend, in registration order.
resolve_backend
run.backends.resolve_backend(name)Look up a backend by canonical key or alias.