lava.magma.core.sync

lava.magma.core.sync.domain

digraph inheritance848405e600 { bgcolor=transparent; rankdir=TB; size=""; "SyncDomain" [URL="../lava/lava.magma.core.sync.html#lava.magma.core.sync.domain.SyncDomain",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Specify to run a group of `Processes` using a specific `SyncProtocol`."]; }
class lava.magma.core.sync.domain.SyncDomain(name, protocol=None, processes=None)

Bases: object

Specify to run a group of Processes using a specific SyncProtocol.

A SyncProtocol defines how and when Processes are synchronized and communication is possible. The SyncDomain maps a list of Processes to a given SyncProtocol.

Parameters:
  • name (str) – Name of the SyncDomain.

  • protocol (AbstractSyncProtocol) – SyncProtocol the Processes are mapped to.

  • processes (ty.List[AbstractProcess]) – List of Processes to run in the given SyncProtocol.

add_process(process)
set_protocol(protocol)

lava.magma.core.sync.protocol

digraph inheritance2c7902761b { bgcolor=transparent; rankdir=TB; size=""; "AbstractSyncProtocol" [URL="../lava/lava.magma.core.sync.html#lava.magma.core.sync.protocol.AbstractSyncProtocol",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for `SyncProtocols`."]; }
class lava.magma.core.sync.protocol.AbstractSyncProtocol

Bases: object

Base class for SyncProtocols.

A SyncProtocol defines how and when the Processes in a SyncDomain are synchronized and communication is possible. SyncProtocols need to implement the runtime_service()’ method which returns a map between hardware resources and the corresponding `RuntimeServices.

For example:

>>> @property
>>> def runtime_service(self) -> ty.Dict[Resource, AbstractRuntimeService]:
>>>     return {CPU: LoihiPyRuntimeService,
>>>             LMT: NxSdkRuntimeService,
>>>             NeuroCore: NxSdkRuntimeService,
>>>             Loihi1NeuroCore: NxSdkRuntimeService,
>>>             Loihi2NeuroCore: NxSdkRuntimeService}

The phases of execution and synchronizations points are implemented in the specific RuntimeService.

abstract property runtime_service