spynnaker.pyNN.extra_algorithms.splitter_components package

Module contents

class spynnaker.pyNN.extra_algorithms.splitter_components.AbstractSpynnakerSplitterDelay[source]

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

MAX_SUPPORTED_DELAY_TICS = 16
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
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.SplitterAbstractPopulationVertexSlice[source]

Bases: pacman.model.partitioner_splitters.abstract_splitters.abstract_splitter_slice.AbstractSplitterSlice, spynnaker.pyNN.extra_algorithms.splitter_components.abstract_spynnaker_splitter_delay.AbstractSpynnakerSplitterDelay

handles the splitting of the AbstractPopulationVertex via slice logic.

INVALID_POP_ERROR_MESSAGE = 'The vertex {} cannot be supported by the SplitterAbstractPopulationVertexSlice as the only vertex supported by this splitter is a AbstractPopulationVertex. Please use the correct splitter for your vertex and try again.'
SPLITTER_NAME = 'SplitterAbstractPopulationVertexSlice'
check_supported_constraints()[source]
Raises:PacmanInvalidParameterException – When partitioner constraints other than MaxVertexAtomsConstraint and FixedVertexAtomsConstraint are used.
constant_sdram(vertex_slice, graph)[source]

returns the constant sdram used by the vertex slice.

Parameters:
Return type:

ConstantSDRAM

cpu_cost(vertex_slice)[source]

get cpu cost for a slice of atoms

Parameters:vertex_slice (Slice) – slice of atoms
Return type:CPUCyclesPerTickResourcer
create_machine_vertex(vertex_slice, resources, label, remaining_constraints)[source]

creates a machine vertex

Parameters:
  • vertex_slice (Slice) – vertex slice
  • resources (ResourceTracker) – resources
  • label (str) – human readable label for machine vertex.
  • remaining_constraints (iterable(AbstractConstraint)) – none partitioner constraints.
Returns:

machine vertex

Return type:

MachineVertex

dtcm_cost(vertex_slice)[source]

get the dtcm cost for the slice of atoms

Parameters:vertex_slice (Slice) – atom slice for dtcm calc.
Return type:DTCMResource
get_in_coming_vertices(edge, outgoing_edge_partition, src_machine_vertex)[source]

gets incoming vertices and their acceptable edge types

The input vertices are the ones that will serve as dest vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters:
  • edge (ApplicationEdge) – app edge
  • outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition
  • src_machine_vertex (MachineVertex) – the src machine vertex
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

dict(MachineVertex,list(class))

get_out_going_vertices(edge, outgoing_edge_partition)[source]

gets pre vertices and their acceptable edge types

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters:
  • edge (ApplicationEdge) – app edge
  • outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

dict(MachineVertex,list(class))

get_resources_used_by_atoms(vertex_slice, graph)[source]

gets the resources of a slice of atoms from a given app vertex.

Parameters:
  • vertex_slice (Slice) – the slice to find the resources of.
  • vertex_slice – the slice
  • graph (MachineGraph) – app graph
Returns:

Resource container.

Return type:

Return type:

ResourceContainer

get_variable_sdram(vertex_slice)[source]

returns the variable sdram from the recorder.

Parameters:vertex_slice (Slice) – the atom slice for recording sdram
Returns:the variable sdram used by the neuron recorder
Return type:VariableSDRAM
set_governed_app_vertex(app_vertex)[source]

Sets a app 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(other_splitter)[source]

Bases: pacman.model.partitioner_splitters.abstract_splitters.abstract_dependent_splitter.AbstractDependentSplitter

handles the splitting of the DelayExtensionVertex via slice logic.

splitter for delay extensions

Parameters:other_splitter – the other splitter to split slices via.
DELAY_EXTENSION_SLICE_LABEL = 'DelayExtensionsMachineVertex for {} with slice {}'
DELAY_RECORDING_ERROR = 'The delay extensions does not record any variables. Therefore asking for them is deemed an error.'
ESTIMATED_CPU_CYCLES = 128
INVALID_POP_ERROR_MESSAGE = 'The vertex {} cannot be supported by the SplitterDelayVertexSlice as the only vertex supported by this splitter is a DelayExtensionVertex. Please use the correct splitter for your vertex and try again.'
NEED_EXACT_ERROR_MESSAGE = 'DelayExtensionsSplitters need exact incoming slices. Please fix and try again'
SPLITTER_NAME = 'SplitterDelayVertexSlice'
WORDS_PER_ATOM = 27
check_supported_constraints()[source]
Raises:PacmanInvalidParameterException – When partitioner constraints other than MaxVertexAtomsConstraint and FixedVertexAtomsConstraint are used.
constant_sdram(graph)[source]

returns the sdram used by the delay extension

Parameters:graph (ApplicationGraph) – app graph
Return type:ConstantSDRAM
cpu_cost(vertex_slice)[source]

returns the cpu cost of the delay extension for a slice of atoms

Parameters:vertex_slice (Slice) – slice of atoms
Return type:CPUCyclesPerTickResource
create_machine_vertex(vertex_slice, resource_tracker, label, remaining_constraints, graph)[source]

creates a delay extension machine vertex and adds to the tracker.

Parameters:
Returns:

machine vertex

Return type:

DelayExtensionMachineVertex

create_machine_vertices(resource_tracker, machine_graph, app_graph)[source]

method for specific splitter objects to use.

Parameters:
Returns:

true if successful, false otherwise

Return type:

bool

dtcm_cost(vertex_slice)[source]

returns the dtcm used by the delay extension slice.

Parameters:vertex_slice (Slice) – vertex slice
Return type:DTCMResource
get_in_coming_slices()[source]

A best effort prediction of the slices of the input vertices.

If this method is called after create_machine_vertices the splitter should return the actual slices of the input vertices. The second value returned is then always True

If this method is called before create_machine_vertices the splitter will have to make an estimate unless the actual slices it will use are already known. The second value returned is True if and only if the slices will not be changed.

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Returns:the slices incoming to this vertex, bool if estimate or exact
Return type:tuple(list(Slice), bool)
get_in_coming_vertices(edge, outgoing_edge_partition, src_machine_vertex)[source]

gets incoming vertices and their acceptable edge types

The input vertices are the ones that will serve as dest vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters:
  • edge (ApplicationEdge) – app edge
  • outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition
  • src_machine_vertex (MachineVertex) – the src machine vertex
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

dict(MachineVertex,list(class))

get_out_going_slices()[source]

A best effort prediction of the slices of the output vertices.

If this method is called after create_machine_vertices the splitter should return the actual slices of the output vertices. The second value returned is then always True

If this method is called before create_machine_vertices the splitter will have to make an estimate unless the actual slices it will use are already known. The second value returned is True if and only if the slices will not be changed.

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/down-stream splitter.

Returns:list of Slices and bool of estimate or not
Return type:tuple(list(Slice), bool)
get_out_going_vertices(edge, outgoing_edge_partition)[source]

gets pre vertices and their acceptable edge types

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters:
  • edge (ApplicationEdge) – app edge
  • outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

dict(MachineVertex,list(class))

get_resources_used_by_atoms(vertex_slice, graph)[source]

ger res for a APV

Parameters:
  • vertex_slice – the slice
  • graph – app graph
Return type:

ResourceContainer

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 verts 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 app 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.
source_of_delay_vertex
class spynnaker.pyNN.extra_algorithms.splitter_components.SpynnakerSplitterPartitioner[source]

Bases: pacman.operations.partition_algorithms.splitter_partitioner.SplitterPartitioner

a splitter partitioner that’s bespoke for spynnaker vertices.

__call__(app_graph, machine, plan_n_time_steps, pre_allocated_resources=None)[source]
Parameters:
Return type:

tuple(MachineGraph, int)

Raises:

PacmanPartitionException – when it cant partition

create_machine_edge(src_machine_vertex, dest_machine_vertex, common_edge_type, app_edge, machine_graph, app_outgoing_edge_partition, resource_tracker)[source]

Create the machine edge (if needed) and add it to the graph.

Some implementations of this method are able to detect that the requested edge is not actually needed so never create or add it.

Parameters:
  • src_machine_vertex (MachineVertex) – Src machine vertex of a edge
  • dest_machine_vertex (MachineVertex) – Dest machine vertex of a edge
  • common_edge_type (MachineEdge) – The edge type to build
  • app_edge (ApplicationEdge) – The app edge this machine edge is to be associated with.
  • machine_graph (MachineGraph) – Machine graph to add edge to.
  • app_outgoing_edge_partition (OutgoingEdgePartition) – Partition
  • resource_tracker (ResourceTracker) – The resource tracker.
class spynnaker.pyNN.extra_algorithms.splitter_components.SpynnakerSplitterSelector[source]

Bases: spinn_front_end_common.interface.splitter_selectors.splitter_selector.SplitterSelector

splitter object selector that allocates splitters to app vertices that have not yet been given a splitter object. default for APV is the SplitterAbstractPopulationVertexSlice default for external device splitters are SplitterOneToOneLegacy default for the rest is the SpynnakerSplitterSliceLegacy.

Parameters:app_graph (ApplicationGraph) – app graph
Raises:PacmanConfigurationException – If a bad configuration is set
PROGRESS_BAR_NAME = 'Adding Splitter selectors where appropriate'
__call__(app_graph)[source]

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

Parameters:app_graph (ApplicationGraph) – app graph
Raises:PacmanConfigurationException – If a bad configuration is set
static abstract_pop_heuristic(app_vertex)[source]

Assign the splitter for APV. Allows future overrides

Parameters:app_vertex (ApplicationGraph) – app vertex

Assign the splitter for FPGA link vertices. Allows future overrides

Parameters:app_vertex (ApplicationGraph) – app vertex

Assign the splitter for SpiNNaker link vertices. Allows future overrides

Parameters:app_vertex (ApplicationGraph) – app vertex
static spike_source_array_heuristic(app_vertex)[source]

Assign the splitter for SSA. Allows future overrides

Parameters:app_vertex (ApplicationGraph) – app vertex
static spike_source_poisson_heuristic(app_vertex)[source]

Assign the splitter for SSP. Allows future overrides

Parameters:app_vertex (ApplicationGraph) – app vertex
class spynnaker.pyNN.extra_algorithms.splitter_components.SpynnakerSplitterSliceLegacy[source]

Bases: pacman.model.partitioner_splitters.splitter_slice_legacy.SplitterSliceLegacy, spynnaker.pyNN.extra_algorithms.splitter_components.abstract_spynnaker_splitter_delay.AbstractSpynnakerSplitterDelay