spynnaker.pyNN.extra_algorithms.splitter_components package¶
Submodules¶
spynnaker.pyNN.extra_algorithms.splitter_components.splitter_utils module¶
- spynnaker.pyNN.extra_algorithms.splitter_components.splitter_utils.is_direct_poisson_source(post_vertex: ApplicationVertex, pre_vertex: ApplicationVertex, connector: AbstractConnector, dynamics: AbstractSynapseDynamics, delay: float | str | RandomDistribution | ndarray[tuple[int, ...], dtype[float64]]) bool[source]¶
Determine if a given Poisson source can be created by this splitter.
- Parameters:
pre_vertex (ApplicationVertex) – The vertex sending into the Projection
connector (AbstractConnector) – The connector in use in the Projection
dynamics (AbstractSynapseDynamics) – The synapse dynamics in use in the Projection
delay – The delay in use in the Projection
- Return type:
Module contents¶
- class spynnaker.pyNN.extra_algorithms.splitter_components.AbstractSpynnakerSplitterDelay¶
Bases:
objectDefines that a splitter is able to handle delays in some way.
Ideally the splitter, and therefore the vertices it creates, are able to handle some delay themselves and if more is needed have the ability to accept spikes from a
DelayExtensionMachineVertex.- accepts_edges_from_delay_vertex() bool[source]¶
Confirms that the splitter’s vertices can handle spikes coming from a
DelayExtensionMachineVertex.If this method returns False and the users ask for a delay larger than that allowed by
max_support_delay(), an exception will be raised saying a different splitter is required.- Return type:
- class spynnaker.pyNN.extra_algorithms.splitter_components.AbstractSupportsOneToOneSDRAMInput¶
Bases:
objectAn interface for a splitter that supports one-to-one input using SDRAM. The splitter is assumed to handle the splitting on any inputs that are actually one-to-one, as it will have to create the vertices.
- abstractmethod handles_source_vertex(projection: Projection) bool[source]¶
Determine if the source vertex of the given projection is to be handled by the target splitter.
- Parameters:
projection (Projection) – The projection to check the source of
- Return type:
- class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterDelayVertexSlice¶
Bases:
AbstractSplitterCommon[DelayExtensionVertex]Handles the splitting of the
DelayExtensionVertexvia slice logic.- DELAY_RECORDING_ERROR = 'The delay extensions does not record any variables. Therefore asking for them is deemed an error.'¶
- NEED_EXACT_ERROR_MESSAGE = 'DelayExtensionsSplitters need exact incoming slices. Please fix and try again'¶
- create_machine_vertex(source_app_vertex: ApplicationVertex, vertex_slice: Slice) DelayExtensionMachineVertex[source]¶
Creates a delay extension machine vertex and adds to the tracker.
- Parameters:
source_vertex (MachineVertex) – The source of the delay
- Returns:
machine vertex
- Return type:
- create_machine_vertices(chip_counter: ChipCounter) None[source]¶
Method for specific splitter objects to override.
- Parameters:
chip_counter (ChipCounter) – counter of used chips
- get_in_coming_vertices(partition_id: str) Sequence[MachineVertex][source]¶
Get machine post-vertices for a given partition.
The input vertices are the ones that will serve as target vertices for external edges.
Note
This method returns all that could be used for any source machine vertex in the given partition.
- Parameters:
partition_id (str) – The identifier of the incoming partition
- Return type:
- get_machine_vertex(vertex_slice: Slice) DelayExtensionMachineVertex[source]¶
Get a delay extension machine vertex for a given vertex slice.
- Parameters:
vertex_slice (Slice) – The slice to get the data for
- Return type:
- get_out_going_vertices(partition_id: str) Sequence[MachineVertex][source]¶
Get machine pre-vertices.
The output vertices are the ones that will serve as source vertices for external edges.
- Parameters:
partition_id (str) – The identifier of the outgoing partition
- Return type:
- get_sdram_used_by_atoms() AbstractSDRAM[source]¶
Gets the amount of SDRAM used by the delay extension.
- Return type:
- get_source_specific_in_coming_vertices(source_vertex: ApplicationVertex, partition_id: str) Sequence[Tuple[DelayExtensionMachineVertex, Sequence[MachineVertex]]][source]¶
Get machine post-vertices for a given source.
The input vertices are the ones that will serve as target vertices for external edges.
Note
This method allows filtering of the targets for a specific source machine vertex.
This default method makes every machine vertex a target for the source. This should be overridden if there are specific machine vertices for any given source vertex.
- Parameters:
source_vertex (ApplicationVertex) – The source to get incoming vertices for
partition_id (str) – The identifier of the incoming partition
- Returns:
A list of tuples of (target machine vertex, list of source machine or application vertices that should hit the target)
- machine_vertices_for_recording(variable_to_record: str) Iterable[MachineVertex][source]¶
Gets the machine vertices which are recording this variable.
- Parameters:
variable_to_record (str) – the variable to get machine vertices for.
- Returns:
list of machine vertices
- Return type:
iterable(MachineVertex)
- set_governed_app_vertex(app_vertex: DelayExtensionVertex) None[source]¶
Sets a application vertex to be governed by this splitter object. Once set it can’t be reset.
- Parameters:
app_vertex (ApplicationVertex) – the app vertex to govern
- Raises:
PacmanConfigurationException – if the app vertex has already been set.
- class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterPoissonDelegate¶
Bases:
SplitterFixedLegacy[SpikeSourcePoissonVertex]A splitter for Poisson sources that will ignore sources that are one-to-one connected to a single Population.
- create_machine_vertices(chip_counter: ChipCounter) None[source]¶
Method for specific splitter objects to override.
- Parameters:
chip_counter (ChipCounter) – counter of used chips
- get_out_going_vertices(partition_id: str) List[MachineVertex][source]¶
Get machine pre-vertices.
The output vertices are the ones that will serve as source vertices for external edges.
- Parameters:
partition_id (str) – The identifier of the outgoing partition
- Return type:
- get_same_chip_groups() Sequence[Tuple[Sequence[MachineVertex], AbstractSDRAM]][source]¶
Get a list of lists of vertices and SDRAM which must be allocated on the same chip. By default this returns a list of each machine vertex and its SDRAM; override if there are groups of machine vertices on the same chip.
- Return type:
- set_governed_app_vertex(app_vertex: SpikeSourcePoissonVertex) None[source]¶
Sets a application vertex to be governed by this splitter object. Once set it can’t be reset.
- Parameters:
app_vertex (ApplicationVertex) – the app vertex to govern
- Raises:
PacmanConfigurationException – if the app vertex has already been set.
- class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterPopulationVertex¶
Bases:
AbstractSplitterCommon[PopulationVertex],AbstractSpynnakerSplitterDelayAbstract base class of splitters for
PopulationVertex.- accepts_edges_from_delay_vertex() bool[source]¶
Confirms that the splitter’s vertices can handle spikes coming from a
DelayExtensionMachineVertex.If this method returns False and the users ask for a delay larger than that allowed by
max_support_delay(), an exception will be raised saying a different splitter is required.- Return type:
- abstractmethod machine_vertices_for_recording(variable_to_record: str) Iterable[MachineVertex][source]¶
Gets the machine vertices which are recording this variable.
- Parameters:
variable_to_record (str) – the variable to get machine vertices for.
- Returns:
list of machine vertices
- Return type:
iterable(MachineVertex)
- max_support_delay() int[source]¶
returns the max amount of delay this post vertex can support.
- Returns:
max delay supported in ticks
- Return type:
- set_governed_app_vertex(app_vertex: PopulationVertex) None[source]¶
Sets a application vertex to be governed by this splitter object. Once set it can’t be reset.
- Parameters:
app_vertex (ApplicationVertex) – the app vertex to govern
- Raises:
PacmanConfigurationException – if the app vertex has already been set.
- class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterPopulationVertexFixed¶
Bases:
SplitterPopulationVertexHandles the splitting of the
PopulationVertexusing fixed slices.- create_machine_vertex(vertex_slice: Slice, sdram: AbstractSDRAM, label: str, structural_sz: int, ring_buffer_shifts: Sequence[int], weight_scales: ndarray[tuple[int, ...], dtype[floating]], index: int, max_atoms_per_core: int, synaptic_matrices: SynapticMatrices, neuron_data: NeuronData) PopulationMachineCommon[source]¶
Create the machine vertex for a slice.
- Parameters:
vertex_slice (Slice)
sdram (AbstractSDRAM)
label (str)
structural_sz (int)
weight_scales (ndarray)
index (int)
max_atoms_per_core (int)
synaptic_matrices (SynapticMatrices)
neuron_data (NeuronData)
- Return type:
- create_machine_vertices(chip_counter: ChipCounter) None[source]¶
Method for specific splitter objects to override.
- Parameters:
chip_counter (ChipCounter) – counter of used chips
- get_in_coming_vertices(partition_id: str) Sequence[MachineVertex][source]¶
Get machine post-vertices for a given partition.
The input vertices are the ones that will serve as target vertices for external edges.
Note
This method returns all that could be used for any source machine vertex in the given partition.
- Parameters:
partition_id (str) – The identifier of the incoming partition
- Return type:
- get_out_going_vertices(partition_id: str) Sequence[MachineVertex][source]¶
Get machine pre-vertices.
The output vertices are the ones that will serve as source vertices for external edges.
- Parameters:
partition_id (str) – The identifier of the outgoing partition
- Return type:
- get_sdram_used_by_atoms(n_atoms: int, all_syn_block_sz: int, structural_sz: int) AbstractSDRAM[source]¶
Gets the resources of a slice of atoms.
- Parameters:
n_atoms (int)
- Return type:
- get_source_specific_in_coming_vertices(source_vertex: ApplicationVertex, partition_id: str) List[Tuple[MachineVertex, Sequence[AbstractVertex]]][source]¶
Get machine post-vertices for a given source.
The input vertices are the ones that will serve as target vertices for external edges.
Note
This method allows filtering of the targets for a specific source machine vertex.
This default method makes every machine vertex a target for the source. This should be overridden if there are specific machine vertices for any given source vertex.
- Parameters:
source_vertex (ApplicationVertex) – The source to get incoming vertices for
partition_id (str) – The identifier of the incoming partition
- Returns:
A list of tuples of (target machine vertex, list of source machine or application vertices that should hit the target)
- machine_vertices_for_recording(variable_to_record: str) Iterable[MachineVertex][source]¶
Gets the machine vertices which are recording this variable.
- Parameters:
variable_to_record (str) – the variable to get machine vertices for.
- Returns:
list of machine vertices
- Return type:
iterable(MachineVertex)
- class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterPopulationVertexNeuronsSynapses¶
Bases:
SplitterPopulationVertex,AbstractSupportsOneToOneSDRAMInputSplits an
PopulationVertexso that there are separate neuron cores each being fed by one or more synapse cores. Incoming one-to-one Poisson cores are also added here if they meet the criteria.- create_machine_vertices(chip_counter: ChipCounter) None[source]¶
Method for specific splitter objects to override.
- Parameters:
chip_counter (ChipCounter) – counter of used chips
- get_in_coming_vertices(partition_id: str) Sequence[PopulationSynapsesMachineVertexCommon][source]¶
Get machine post-vertices for a given partition.
The input vertices are the ones that will serve as target vertices for external edges.
Note
This method returns all that could be used for any source machine vertex in the given partition.
- Parameters:
partition_id (str) – The identifier of the incoming partition
- Return type:
- get_internal_multicast_partitions() List[MulticastEdgePartition][source]¶
Get edge partitions between machine vertices that are to be handled by Multicast. Returns empty by default, override if there are Multicast connections between internal vertices
- Return type:
- get_internal_sdram_partitions() List[SourceSegmentedSDRAMMachinePartition][source]¶
Get edge partitions between machine vertices that are to be handled by SDRAM. Returns empty by default, override if there are SDRAM connections between internal vertices
- Return type:
- get_out_going_vertices(partition_id: str) Sequence[PopulationNeuronsMachineVertex][source]¶
Get machine pre-vertices.
The output vertices are the ones that will serve as source vertices for external edges.
- Parameters:
partition_id (str) – The identifier of the outgoing partition
- Return type:
- get_same_chip_groups() List[Tuple[List[MachineVertex], AbstractSDRAM]][source]¶
Get a list of lists of vertices and SDRAM which must be allocated on the same chip. By default this returns a list of each machine vertex and its SDRAM; override if there are groups of machine vertices on the same chip.
- Return type:
- get_source_specific_in_coming_vertices(source_vertex: ApplicationVertex, partition_id: str) Sequence[Tuple[MachineVertex, Sequence[AbstractVertex]]][source]¶
Get machine post-vertices for a given source.
The input vertices are the ones that will serve as target vertices for external edges.
Note
This method allows filtering of the targets for a specific source machine vertex.
This default method makes every machine vertex a target for the source. This should be overridden if there are specific machine vertices for any given source vertex.
- Parameters:
source_vertex (ApplicationVertex) – The source to get incoming vertices for
partition_id (str) – The identifier of the incoming partition
- Returns:
A list of tuples of (target machine vertex, list of source machine or application vertices that should hit the target)
- handles_source_vertex(projection: Projection) bool[source]¶
Determine if the source vertex of the given projection is to be handled by the target splitter.
- Parameters:
projection (Projection) – The projection to check the source of
- Return type:
- machine_vertices_for_recording(variable_to_record: str) Sequence[MachineVertex][source]¶
Gets the machine vertices which are recording this variable.
- Parameters:
variable_to_record (str) – the variable to get machine vertices for.
- Returns:
list of machine vertices
- Return type:
iterable(MachineVertex)
- spynnaker.pyNN.extra_algorithms.splitter_components.spynnaker_splitter_selector() None¶
Add a splitter to every vertex that doesn’t already have one.
The default for
PopulationVertexis theSplitterPopulationVertexFixed. The default for external device splitters areSplitterExternalDevice. The default for the rest is theSplitterFixedLegacy.- Raises:
PacmanConfigurationException – If a bad configuration is set