spynnaker.pyNN package

Subpackages

Submodules

spynnaker.pyNN.config_setup module

spynnaker.pyNN.config_setup.add_spynnaker_cfg() None[source]

Add the local configuration and all dependent configuration files.

spynnaker.pyNN.config_setup.cfg_paths_skipped() Set[str][source]

Set of cfg path that would not be found based on other cfg settings

Assuming mode = Debug

spynnaker.pyNN.config_setup.setup_configs() None[source]

Sets up the configurations including the users configuration file.

Clears out any previous read configurations but does not load the new configurations so a warning is generated if a configuration is used before setup is called.

spynnaker.pyNN.config_setup.unittest_setup() None[source]

Does all the steps that may be required before a unit-test.

Resets the configurations so only the local default configurations are included. The user configuration is not included!

Unsets any previous simulators and temporary directories

Note

This file should only be called from sPyNNaker tests that do not call sim.setup

spynnaker.pyNN.exceptions module

exception spynnaker.pyNN.exceptions.DelayExtensionException[source]

Bases: ConfigurationException

Raised when a delay extension vertex fails.

exception spynnaker.pyNN.exceptions.FilterableException[source]

Bases: SpynnakerException

Raised when it is not possible to determine if an edge should be filtered.

exception spynnaker.pyNN.exceptions.InvalidParameterType[source]

Bases: SpynnakerException

Raised when a parameter is not recognised.

exception spynnaker.pyNN.exceptions.MemReadException[source]

Bases: SpynnakerException

Raised when the PyNN front end fails to read a certain memory region.

exception spynnaker.pyNN.exceptions.SpynnakerSplitterConfigurationException[source]

Bases: ConfigurationException

Raised when a splitter configuration fails.

exception spynnaker.pyNN.exceptions.SynapseRowTooBigException(max_size: int, message: str)[source]

Bases: SpynnakerException

Raised when a synapse row is bigger than is allowed.

Parameters:
  • max_size – the maximum permitted size of row

  • message – the exception message

property max_size: int

The maximum size allowed.

exception spynnaker.pyNN.exceptions.SynapticBlockGenerationException[source]

Bases: ConfigurationException

Raised when the synaptic manager fails to generate a synaptic block.

exception spynnaker.pyNN.exceptions.SynapticBlockReadException[source]

Bases: ConfigurationException

Raised when the synaptic manager fails to read a synaptic block or convert it into readable values.

exception spynnaker.pyNN.exceptions.SynapticConfigurationException[source]

Bases: ConfigurationException

Raised when the synaptic manager fails for some reason.

exception spynnaker.pyNN.exceptions.SynapticMaxIncomingAtomsSupportException[source]

Bases: ConfigurationException

Raised when a synaptic sublist exceeds the max atoms possible to be supported.

spynnaker.pyNN.random_distribution module

spynnaker.pyNN.setup_pynn module

This script installs sPyNNaker so that it usable as the pyNN.spiNNaker module.

Note

This modifies your pyNN installation!

spynnaker.pyNN.setup_pynn.install_spynnaker_into(module: ModuleType) None[source]

Do the actual installation by creating a package within the given module’s implementation. This is very nasty!

Parameters:

module (ModuleType)

spynnaker.pyNN.setup_pynn.version_satisfies(module: ModuleType, requirement: str) bool[source]

Perform a version check. This code could be smarter…

Parameters:
Returns:

Whether the module’s version satisfies the given requirement

Return type:

bool

spynnaker.pyNN.spinnaker module

spynnaker.pyNN.spynnaker_external_device_plugin_manager module

class spynnaker.pyNN.spynnaker_external_device_plugin_manager.SpynnakerExternalDevicePluginManager[source]

Bases: object

User-level interface for the external device plug-in manager.

static activate_live_output_for(population: Population, *, database_notify_host: str | None = None, database_notify_port_num: int | None = None, database_ack_port_num: int | None = None, port: int | None = None, host: str | None = None, tag: int | None = None, strip_sdp: bool = True, use_prefix: bool = False, key_prefix: int | None = None, prefix_type: EIEIOPrefix | None = None, message_type: EIEIOType = EIEIOType.KEY_32_BIT, right_shift: int = 0, payload_as_time_stamps: bool = True, notify: bool = True, use_payload_prefix: bool = True, payload_prefix: int | None = None, payload_right_shift: int = 0, number_of_packets_sent_per_time_step: int = 0, translate_keys: bool = False, partition_ids: Iterable[str] | None = None) None[source]

Output the spikes from a given population from SpiNNaker as they occur in the simulation.

Parameters:
  • population (Population) – The population to activate the live output for

  • database_notify_host (str) – The hostname for the device which is listening to the database notification.

  • database_ack_port_num (int) – The port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution

  • database_notify_port_num (int) – The port number to which a external device will receive the database is ready command

  • key_prefix (int or None) – the prefix to be applied to the key

  • prefix_type (EIEIOPrefix) – if the prefix type is 32 bit or 16 bit

  • message_type (EIEIOType) – If the message is a EIEIO command message, or an EIEIO data message with 16 bit or 32 bit keys.

  • payload_as_time_stamps (bool)

  • right_shift (int)

  • use_payload_prefix (bool)

  • notify (bool)

  • payload_prefix (int or None)

  • payload_right_shift (int)

  • number_of_packets_sent_per_time_step (int)

  • port (int) – The UDP port to which the live spikes will be sent. If not specified, the port will be taken from the “live_spike_port” parameter in the “Recording” section of the sPyNNaker configuration file.

  • host (str) – The host name or IP address to which the live spikes will be sent. If not specified, the host will be taken from the “live_spike_host” parameter in the “Recording” section of the sPyNNaker configuration file.

  • tag (int) – The IP tag to be used for the spikes. If not specified, one will be automatically assigned

  • strip_sdp (bool) – Determines if the SDP headers will be stripped from the transmitted packet.

  • use_prefix (bool) – Determines if the spike packet will contain a common prefix for the spikes

  • label (str) – The label of the gatherer vertex

  • partition_ids (list(str)) – The names of the partitions to create edges for

  • translate_keys (bool) – Whether the incoming keys from the cores should be translated to global keys rather than core-based keys

static activate_live_output_to(population: Population, device: Population | ApplicationVertex, partition_id: str = 'SPIKE') None[source]

Activate the output of spikes from a population to an external device.

Note

All spikes will be sent to the device.

Parameters:
  • population (Population) – The pyNN population object from which spikes will be sent.

  • device (Population or ApplicationVertex) – The pyNN population or external device to which the spikes will be sent.

  • partition_id (str) – The partition ID to activate live output to.

static add_application_vertex(vertex: ApplicationVertex) None[source]

Adds an Application vertex to the user graph.

Semantic sugar for SpynnakerDataView.add_vertex(vertex)

Parameters:

vertex (ApplicationVertex)

static add_database_socket_address(database_notify_host: str | None, database_notify_port_num: int | None, database_ack_port_num: int | None) None[source]
Parameters:
  • database_notify_host (str or None) – Host to talk to tell that the database (and application) is ready.

  • database_notify_port_num (int or None) – Port to talk to tell that the database (and application) is ready.

  • database_ack_port_num (int or None) – Port on which to listen for an acknowledgement that the simulation should start.

static add_edge(vertex: ApplicationVertex, device_vertex: ApplicationVertex, partition_id: str) ApplicationEdge[source]

Add an edge between two vertices (often a vertex and a external device) on a given partition.

Parameters:
  • vertex (ApplicationVertex) – the pre-population vertex to connect the edge from

  • device_vertex (ApplicationVertex) – the post-population vertex to connect the edge to

  • partition_id (str) – the partition identifier for making nets

static add_poisson_live_rate_control(poisson_population: Population, *, control_label_extension: str = '_control', receive_port: int | None = None, database_notify_host: str | None = None, database_notify_port_num: int | None = None, database_ack_port_num: int | None = None, notify: bool = True, reserve_reverse_ip_tag: bool = False) None[source]

Add a live rate controller to a Poisson population.

Parameters:
  • poisson_population (Population) – The population to control

  • control_label_extension (str) – An extension to add to the label of the Poisson source. Must match up with the equivalent in the SpynnakerPoissonControlConnection

  • receive_port (int) – The port that the SpiNNaker board should listen on

  • database_notify_host (str) – the hostname for the device which is listening to the database notification.

  • database_ack_port_num (int) – the port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution

  • database_notify_port_num (int) – The port number to which an external device will receive the database is ready command

  • notify (bool) – adds to the notification protocol if set.

  • reserve_reverse_ip_tag (bool) – True if a reverse IP tag is to be used, False if SDP is to be used (default)

static update_live_packet_gather_tracker(vertex_to_record_from: ApplicationVertex, params: LivePacketGatherParameters, partition_ids: Iterable[str]) None[source]

Add an edge from a vertex to the live packet gatherer, builds as needed and has all the parameters for the creation of the live packet gatherer if needed.

Parameters:

spynnaker.pyNN.types module

Types (and related) that are useful for implementing connectors.

spynnaker.pyNN.types.is_scalar(value: float | str | RandomDistribution | ndarray[tuple[int, ...], dtype[float64]] | None) TypeGuard[int | float][source]

Are the weights or delays a simple integer or float?

Module contents