spynnaker.pyNN.extra_algorithms.splitter_components package

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()[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:

bool

abstract max_support_delay()[source]

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

Returns:

max delay supported in ticks

Return type:

int

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.

abstract handles_source_vertex(projection)[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:

bool

class spynnaker.pyNN.extra_algorithms.splitter_components.SplitterAbstractPopulationVertexFixed

Bases: AbstractSplitterCommon, AbstractSpynnakerSplitterDelay

Handles the splitting of the AbstractPopulationVertex using fixed slices.

accepts_edges_from_delay_vertex()[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:

bool

create_machine_vertex(vertex_slice, sdram, label, structural_sz, ring_buffer_shifts, weight_scales, index, max_atoms_per_core, synaptic_matrices, neuron_data)[source]
create_machine_vertices(chip_counter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices()[source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id)[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:

list(MachineVertex)

get_out_going_slices()[source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id)[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:

list(MachineVertex)

get_sdram_used_by_atoms(n_atoms, all_syn_block_sz, structural_sz)[source]

Gets the resources of a slice of atoms.

Parameters:

n_atoms (int) –

Return type:

MultiRegionSDRAM

get_source_specific_in_coming_vertices(source_vertex, partition_id)[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)

Return type:

list(tuple(MachineVertex, list(MachineVertex or ApplicationVertex)))

machine_vertices_for_recording(variable_to_record)[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()[source]

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

Returns:

max delay supported in ticks

Return type:

int

reset_called()[source]

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

set_governed_app_vertex(app_vertex)[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.SplitterAbstractPopulationVertexNeuronsSynapses(n_synapse_vertices=1, max_delay=None, allow_delay_extension=None)

Bases: AbstractSplitterCommon, AbstractSpynnakerSplitterDelay, AbstractSupportsOneToOneSDRAMInput

Splits an AbstractPopulationVertex 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.

Parameters:
  • n_synapse_vertices (int) – The number of synapse cores per neuron core

  • max_delay (int or None) – The maximum delay supported by each synapse core; by default this is computed based on the number of atoms per core, the number of synapse types, and the space available for delays on the core

  • allow_delay_extension (bool or None) – Whether delay extensions are allowed in the network. If max_delay is provided, this will default to True. If max_delay is not provided, and this is given as None, it will be computed based on whether delay extensions should be needed.

accepts_edges_from_delay_vertex()[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:

bool

create_machine_vertices(chip_counter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices()[source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id)[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:

list(MachineVertex)

get_internal_multicast_partitions()[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:

list(MulticastEdgePartition)

get_internal_sdram_partitions()[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:

list(AbstractSDRAMPartition)

get_out_going_slices()[source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id)[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:

list(MachineVertex)

get_same_chip_groups()[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:

list(list(MachineVertex), AbstractSDRAM)

get_source_specific_in_coming_vertices(source_vertex, partition_id)[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)

Return type:

list(tuple(MachineVertex, list(MachineVertex or ApplicationVertex)))

handles_source_vertex(projection)[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:

bool

is_direct_poisson_source(pre_vertex, connector, dynamics)[source]

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

Parameters:
Return type:

bool

machine_vertices_for_recording(variable_to_record)[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()[source]

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

Returns:

max delay supported in ticks

Return type:

int

property n_synapse_vertices

The number of synapse vertices per neuron vertex.

Return type:

int

reset_called()[source]

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

set_governed_app_vertex(app_vertex)[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.SplitterDelayVertexSlice

Bases: AbstractSplitterCommon

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, vertex_slice)[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:

DelayExtensionMachineVertex

create_machine_vertices(chip_counter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices()[source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id)[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:

list(MachineVertex)

get_machine_vertex(vertex_slice)[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:

DelayExtensionMachineVertex

get_out_going_slices()[source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id)[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:

list(MachineVertex)

get_sdram_used_by_atoms()[source]

Gets the amount of SDRAM used by the delay extension.

Return type:

ConstantSDRAM

get_source_specific_in_coming_vertices(source_vertex, partition_id)[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)

Return type:

list(tuple(MachineVertex, list(MachineVertex or ApplicationVertex)))

machine_vertices_for_recording(variable_to_record)[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)

reset_called()[source]

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

set_governed_app_vertex(app_vertex)[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

A splitter for Poisson sources that will ignore sources that are one-to-one connected to a single Population.

create_machine_vertices(chip_counter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices()[source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_slices()[source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id)[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:

list(MachineVertex)

get_same_chip_groups()[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:

list(list(MachineVertex), AbstractSDRAM)

property send_over_sdram

Whether this vertex is to be sent using SDRAM.

Return type:

bool

set_governed_app_vertex(app_vertex)[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.

spynnaker.pyNN.extra_algorithms.splitter_components.spynnaker_splitter_selector()

Add a splitter to every vertex that doesn’t already have one.

The default for AbstractPopulationVertex is the SplitterAbstractPopulationVertexFixed. The default for external device splitters are SplitterExternalDevice. The default for the rest is the SplitterFixedLegacy.

Raises:

PacmanConfigurationException – If a bad configuration is set