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
-
-
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'¶ The message to use when the Population is invalid
-
check_supported_constraints
()[source]¶ Raises: PacmanInvalidParameterException – When partitioner constraints other than MaxVertexAtomsConstraint
andFixedVertexAtomsConstraint
are used.
-
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:
-
create_machine_vertices
(resource_tracker, machine_graph)[source]¶ method for specific splitter objects to use.
Parameters: - resource_tracker (ResourceTracker) – machine resources
- machine_graph (MachineGraph) – machine graph
Returns: true if successful, false otherwise
Return type:
-
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)[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
Returns: Resource container.
Return type: ResourceContainer Gets the resources of a slice of atoms
Return type:
-
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
andFixedVertexAtomsConstraint
are used.
-
constant_sdram
(graph, vertex_slice)[source]¶ returns the sdram used by the delay extension
Parameters: - graph (ApplicationGraph) – app graph
- vertex_slice (Slice) – The slice to get the size of
Return type:
-
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, index, resource_tracker, label, remaining_constraints, graph)[source]¶ creates a delay extension machine vertex and adds to the tracker.
Parameters: - vertex_slice (Slice) – vertex slice
- resource_tracker (ResourceTracker) – resources
- label (str) – human readable label for machine vertex.
- remaining_constraints (iterable(AbstractConstraint)) – none partitioner constraints.
- graph (ApplicationGraph) – the app graph
Returns: machine vertex
Return type:
-
create_machine_vertices
(resource_tracker, machine_graph, app_graph)[source]¶ method for specific splitter objects to use.
Parameters: - resource_tracker (ResourceTracker) – machine resources
- machine_graph (MachineGraph) – machine graph
Returns: true if successful, false otherwise
Return type:
-
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:
-
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)
-
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
¶
-
-
spynnaker.pyNN.extra_algorithms.splitter_components.
spynnaker_splitter_partitioner
(app_graph, machine, plan_n_time_steps, pre_allocated_resources=None)[source]¶ a splitter partitioner that’s bespoke for spynnaker vertices.
Parameters: - app_graph (ApplicationGraph) – app graph
- machine (Machine) – machine
- plan_n_time_steps (int) – the number of time steps to run for
- pre_allocated_resources (PreAllocatedResourceContainer or None) – any pre-allocated res to account for before doing any splitting.
Return type: Raises: PacmanPartitionException – when it cant partition
-
spynnaker.pyNN.extra_algorithms.splitter_components.
spynnaker_splitter_selector
(app_graph)[source]¶ Add a splitter to every vertex that doesn’t already have one.
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
-
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
-
class
spynnaker.pyNN.extra_algorithms.splitter_components.
SplitterAbstractPopulationVertexNeuronsSynapses
(n_synapse_vertices=1, max_delay=None, allow_delay_extension=None)[source]¶ Bases:
pacman.model.partitioner_splitters.abstract_splitters.abstract_splitter_common.AbstractSplitterCommon
,spynnaker.pyNN.extra_algorithms.splitter_components.abstract_spynnaker_splitter_delay.AbstractSpynnakerSplitterDelay
,spynnaker.pyNN.extra_algorithms.splitter_components.abstract_supports_one_to_one_sdram_input.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.
-
INVALID_POP_ERROR_MESSAGE
= 'The vertex {} cannot be supported by the SplitterAbstractPopVertexNeuronsSynapses as the only vertex supported by this splitter is a AbstractPopulationVertex. Please use the correct splitter for your vertex and try again.'¶
-
SPLITTER_NAME
= 'SplitterAbstractPopulationVertexNeuronsSynapses'¶
-
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
(resource_tracker, machine_graph)[source]¶ method for specific splitter objects to use.
Parameters: - resource_tracker (ResourceTracker) – machine resources
- machine_graph (MachineGraph) – machine graph
Returns: true if successful, false otherwise
Return type:
-
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))
-
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)
-
max_support_delay
()[source]¶ returns the max amount of delay this post vertex can support.
Returns: max delay supported in ticks Return type: int
-
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.
SplitterPoissonDelegate
[source]¶ Bases:
spynnaker.pyNN.extra_algorithms.splitter_components.spynnaker_splitter_slice_legacy.SpynnakerSplitterSliceLegacy
A splitter for Poisson sources that will ignore sources that are one-to-one connected to a single Population
-
INVALID_POP_ERROR_MESSAGE
= 'The vertex {} cannot be supported by the SplitterPoissonDelegate as the only vertex supported by this splitter is a SpikeSourcePoissonVertex. Please use the correct splitter for your vertex and try again.'¶
-
create_machine_vertices
(resource_tracker, machine_graph)[source]¶ method for specific splitter objects to use.
Parameters: - resource_tracker (ResourceTracker) – machine resources
- machine_graph (MachineGraph) – machine graph
Returns: true if successful, false otherwise
Return type:
-
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_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)
-
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.
AbstractSupportsOneToOneSDRAMInput
[source]¶ Bases:
object
A marker 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