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[Any, ...], dtype[float64]]) bool[source]
Parameters:
  • post_vertex – The receiving vertex

  • pre_vertex – The vertex sending into the Projection

  • connector – The connector in use in the Projection

  • dynamics – The synapse dynamics in use in the Projection

  • delay – The delay in use in the Projection

Returns:

True if a given Poisson source can be created by this splitter.

Module contents

class spynnaker.pyNN.extra_algorithms.splitter_components.AbstractSpynnakerSplitterDelay

Bases: object

Defines 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.

Returns:

True if extra delays can be supported using delay vertices

abstractmethod max_support_delay() int[source]

returns the max amount of delay this post vertex can support.

Returns:

max delay supported in ticks

class spynnaker.pyNN.extra_algorithms.splitter_components.AbstractSupportsOneToOneSDRAMInput

Bases: object

An 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 – The projection to check the source of

Returns:

True if the target can handle this projection

class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterDelayVertexSlice

Bases: AbstractSplitterCommon[DelayExtensionVertex]

Handles the splitting of the DelayExtensionVertex via 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_app_vertex – The source of the delay

  • vertex_slice – The neurons this Machine Vertex should cover.

Returns:

machine vertex

create_machine_vertices(chip_counter: ChipCounter) None[source]

Method for specific splitter objects to override.

Parameters:

chip_counter – counter of used chips

get_in_coming_slices() Sequence[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

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 – The identifier of the incoming partition

Returns:

machine post-vertices for a given partition

get_machine_vertex(vertex_slice: Slice) DelayExtensionMachineVertex[source]
Parameters:

vertex_slice – The slice to get the data for

Returns:

A delay extension machine vertex for the vertex slice.

get_out_going_slices() Sequence[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

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 – The identifier of the outgoing partition

Returns:

machine pre-vertices for this partition

get_sdram_used_by_atoms() AbstractSDRAM[source]
Returns:

The amount of SDRAM used by the delay extension.

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 – The source to get incoming vertices for

  • partition_id – 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 – the variable to get machine vertices for.

Returns:

list of machine vertices

reset_called() None[source]

Reset the splitter to be as if it has not operated a splitting yet.

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 – 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 – counter of used chips

get_in_coming_slices() List[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

get_out_going_slices() List[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

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 – The identifier of the outgoing partition

Returns:

machine pre-vertices for this partition

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.

Returns:

A list of vertices and the SDRAM cost that should be counted for that Vertex.

property send_over_sdram: bool

Whether this vertex is to be sent using SDRAM.

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 – 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], AbstractSpynnakerSplitterDelay

Abstract 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.

Returns:

True if extra delays can be supported using delay vertices

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 – the variable to get machine vertices for.

Returns:

list of machine vertices

max_support_delay() int[source]

returns the max amount of delay this post vertex can support.

Returns:

max delay supported in ticks

reset_called() None[source]

Reset the splitter to be as if it has not operated a splitting yet.

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 – the app vertex to govern

Raises:

PacmanConfigurationException – if the app vertex has already been set.

class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterPopulationVertexFixed

Bases: SplitterPopulationVertex

Handles the splitting of the PopulationVertex using fixed slices.

create_machine_vertex(vertex_slice: Slice, sdram: AbstractSDRAM, label: str, structural_sz: int, ring_buffer_shifts: Sequence[int], weight_scales: ndarray[tuple[Any, ...], dtype[floating]], index: int, max_atoms_per_core: int, synaptic_matrices: SynapticMatrices, neuron_data: NeuronData) PopulationMachineCommon[source]
Returns:

A new Machine vertex for this slice.

create_machine_vertices(chip_counter: ChipCounter) None[source]

Method for specific splitter objects to override.

Parameters:

chip_counter – counter of used chips

get_in_coming_slices() List[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

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 – The identifier of the incoming partition

Returns:

machine post-vertices for a given partition

get_out_going_slices() List[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

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 – The identifier of the outgoing partition

Returns:

machine pre-vertices for this partition

get_sdram_used_by_atoms(n_atoms: int, all_syn_block_sz: int, structural_sz: int) AbstractSDRAM[source]
Returns:

The SDRAM resources of a slice of atoms.

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 – The source to get incoming vertices for

  • partition_id – 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 – the variable to get machine vertices for.

Returns:

list of machine vertices

class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterPopulationVertexNeuronsSynapses

Bases: SplitterPopulationVertex, AbstractSupportsOneToOneSDRAMInput

Splits an PopulationVertex so 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 – counter of used chips

get_in_coming_slices() Sequence[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

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 – The identifier of the incoming partition

Returns:

machine post-vertices for a given partition

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

Returns:

Only the partitions (if any) handled by Multicast

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

Returns:

Only the partitions (if any) handled by SDRAM

get_out_going_slices() Sequence[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

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 – The identifier of the outgoing partition

Returns:

machine pre-vertices for this partition

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.

Returns:

A list of vertices and the SDRAM cost that should be counted for that Vertex.

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 – The source to get incoming vertices for

  • partition_id – 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 – The projection to check the source of

Returns:

True if the target can handle this projection

machine_vertices_for_recording(variable_to_record: str) Sequence[MachineVertex][source]

Gets the machine vertices which are recording this variable.

Parameters:

variable_to_record – the variable to get machine vertices for.

Returns:

list of machine vertices

reset_called() None[source]

Reset the splitter to be as if it has not operated a splitting yet.

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 PopulationVertex is the SplitterPopulationVertexFixed. The default for external device splitters are SplitterExternalDevice. The default for the rest is the SplitterFixedLegacy.

Raises:

PacmanConfigurationException – If a bad configuration is set