spinn_machine.version package¶
Submodules¶
spinn_machine.version.abstract_version module¶
- class spinn_machine.version.abstract_version.AbstractVersion(max_cores_per_chip: int, max_sdram_per_chip: int)[source]¶
Bases:
objectBase class for the version classes.
Version classes are the main way to create a Machine object of the correct class.
The version classes contain properties that will change depending on the version.
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- abstract property chip_core_map: Dict[Tuple[int, int], int]¶
A map off the expected x,y coordinates on a standard board to the most likely number of cores on that chip.
- abstract property clock_speeds_hz: List[int]¶
The processor clock speeds in Hz this processor can run at
- create_machine(width: int | None, height: int | None, origin: str | None = None) Machine[source]¶
Creates a new empty machine based on the width, height and version.
- Parameters:
width – The width of the machine excluding any virtual chips
height – The height of the machine excluding any virtual chips
origin – Extra information about how this machine was created to be used in
str(version). Example “Virtual” or “Json”
- Returns:
A subclass of Machine with no chips in it
- Raises:
SpinnMachineInvalidParameterException – If the size is unexpected
- abstract property dtcm_bytes: int¶
The Data Tightly Coupled Memory available on a processor in bytes
- property expected_xys: Sequence[Tuple[int, int]]¶
List of the standard x,y coordinates of chips for this version.
Remember that will the board may have dead or excluded chips.
- abstractmethod fpga_links() List[Tuple[int, int, int, int, int]][source]¶
The list of Local X, Y, link, fpga_link_id and fpga_id
These are applied local to each Ethernet Chip and even if the link is connected to another board
- Returns:
List of Tuples of Local X, Y, link, fpga_link_id and fpga_id
- abstractmethod get_active_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int, sum_chip_active_time: float, router_packets: Dict[Tuple[int, int], Dict[str, int]]) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
sum_chip_active_time – Sum of times the cores were active in seconds
router_packets – The number of packets sent by each router
- Returns:
the active energy consumption of the system in joules
- abstractmethod get_idle_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
- Returns:
the idle energy consumption of the system in joules
- abstractmethod get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]¶
Get the coordinates of chips that should be Ethernet chips.
This may well be passed down to SpiNNakerTriadGeometry.
Note
This methods assumes that width and height would pass
verify_size(). If not, the results may be wrong.- Parameters:
width – The width of the machine to find the chips in
height – The height of the machine to find the chips in
- Returns:
A list of Tuples of X and Y coordinates
- abstractmethod get_router_report_packet_types() List[str][source]¶
- Returns:
The list of packet types that the router can send
- abstractmethod id_to_qx_qy_qp(core_id: int) Tuple[int, int, int][source]¶
Converts core id to quad coordinates
- Parameters:
core_id – id of the core
- Returns:
(qx, qy, qp)
- Raises:
NotImplementedError – If called on a version that does not support quads
- abstractmethod illegal_ethernet_message(x: int, y: int) str | None[source]¶
Checks if x and y could be for an Ethernet.
This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.
Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location
- Parameters:
x
y
- Returns:
An explanation that the x and y can never be an Ethernet
- property max_cores_per_chip: int¶
Gets the maximum number of cores per chip for the whole system.
There is no guarantee that there will be any chips with this many cores, only that there will be no cores with more.
- property max_sdram_per_chip: int¶
The maximum SDRAM per chip for the whole system.
While it is likely that all Chips will have this SDRAM this should not be counted on. Ask each Chip for its SDRAM.
- abstract property minimum_cores_expected: int¶
The minimum number of Chip that we expect from a Chip
If there are less that this number of Cores Machine.validate and other methods are allowed to raise an exception
- property n_chips_per_board: int¶
The normal number of chips on each board of this version.
Remember that will the board may have dead or excluded chips.
- abstract property n_router_entries: int¶
The standard number of router entries in a router table.
While it is likely that all chips will have this number it should not be counted on. Ask each chip’s router for the correct value.
- parse_cores_string(core_string: str) Iterable[int][source]¶
Parses a string representation of a core or cores
The main usage of this method is to support the cfg down_cores.
This may be a single positive int which will be taken as the virtual core id
This may be a single negative int which will be taken as the physical core id
This may be two int values separated by a minus which will be taken as a range of one of the above
Other formats are version specific. See version_parse_cores_string
- Parameters:
core_string – A string to parse
- Returns:
A list of cores, which might be just one
- abstractmethod quads_maps() Dict[int, Tuple[int, int, int]] | None[source]¶
If applicable returns a map of virtual id to quad qx, qy, qp
Spin 1 boards will return None!
- Returns:
None or a Dict from virtual id to a tuple of chip x, chip y and quad ID
- abstractmethod qx_qy_qp_to_id(qx: int, qy: int, qp: int) int[source]¶
Converts quad coordinates to the core id
- Parameters:
qx – quad x coordinate of the core
qy – quad y coordinate of the core
qp – quad p coordinate of the core
- Returns:
The core id on the Chip
- Raises:
NotImplementedError – If called on a version that does not support quads
- size_from_n_boards(n_boards: int) Tuple[int, int][source]¶
Returns the size needed to support this many boards.
- Parameters:
n_boards
- Raises:
SpinnMachineException – If multiple boards are needed but not supported
- Returns:
A tuple of width and height
- size_from_n_chips(n_chips: int) Tuple[int, int][source]¶
Returns the size needed to support this many chips.
Designed for use with virtual boards. Does not include a safety factor for blacklisted Chips or cores For real machines a slightly bigger Machine may be needed.
- Returns:
A tuple of width and height
- Raises:
SpinnMachineException – If multiple boards are needed but not supported
- size_from_n_cores(n_cores: int) Tuple[int, int][source]¶
Returns the size needed to support this many cores.
Takes into consideration scamp and monitor cores.
Designed for use with virtual boards. Does not include a safety factor for blacklisted cores or chips. For real machines a slightly bigger Machine may be needed.
- Parameters:
n_cores – Number of None Scamp and monitor cores needed
- Returns:
A tuple of width and height
- abstractmethod spinnaker_links() List[Tuple[int, int, int]][source]¶
The list of Local X, Y and link Id to add spinnaker links to
These are applied local to each Ethernet Chip and only if the link is not connected to another board
- Returns:
List of Tuples of Local X, Y, and spinnaker link Id
- abstract property supports_multiple_boards: bool¶
Specifies if this version allows machines of more than one board
- verify_size(width: int | None, height: int | None) None[source]¶
Checks that the width and height are allowed for this version.
- Parameters:
width – The width of the machine excluding any virtual chips
height – The height of the machine excluding any virtual chips
- Raises:
SpinnMachineException – If the size is unexpected
spinn_machine.version.vec2mesh_reader module¶
spinn_machine.version.version_201 module¶
- class spinn_machine.version.version_201.Version201[source]¶
Bases:
VersionSpin2Code for the 1 Chip test Spin2 board versions
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- property chip_core_map: Dict[Tuple[int, int], int]¶
A map off the expected x,y coordinates on a standard board to the most likely number of cores on that chip.
- fpga_links() List[Tuple[int, int, int, int, int]][source]¶
The list of Local X, Y, link, fpga_link_id and fpga_id
These are applied local to each Ethernet Chip and even if the link is connected to another board
- Returns:
List of Tuples of Local X, Y, link, fpga_link_id and fpga_id
- get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]¶
Get the coordinates of chips that should be Ethernet chips.
This may well be passed down to SpiNNakerTriadGeometry.
Note
This methods assumes that width and height would pass
verify_size(). If not, the results may be wrong.- Parameters:
width – The width of the machine to find the chips in
height – The height of the machine to find the chips in
- Returns:
A list of Tuples of X and Y coordinates
- illegal_ethernet_message(x: int, y: int) str | None[source]¶
Checks if x and y could be for an Ethernet.
This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.
Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location
- Parameters:
x
y
- Returns:
An explanation that the x and y can never be an Ethernet
spinn_machine.version.version_248 module¶
- class spinn_machine.version.version_248.Version248[source]¶
Bases:
VersionSpin2,Version48ChipsCode for the 48 Chip Spin2 board versions
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- property chip_core_map: Dict[Tuple[int, int], int]¶
A map off the expected x,y coordinates on a standard board to the most likely number of cores on that chip.
spinn_machine.version.version_3 module¶
- class spinn_machine.version.version_3.Version3[source]¶
Bases:
VersionSpin1Code for the small Spin1 4 Chip boards
Covers versions 2 and 3
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- WATTS_FOR_4_CHIP_BOARD_IDLE_COST: Final = 3.56¶
From measuring the power of an idle 4-chip board for 1 hour, the cost is 3.56W
- property chip_core_map: Dict[Tuple[int, int], int]¶
A map off the expected x,y coordinates on a standard board to the most likely number of cores on that chip.
- fpga_links() List[Tuple[int, int, int, int, int]][source]¶
The list of Local X, Y, link, fpga_link_id and fpga_id
These are applied local to each Ethernet Chip and even if the link is connected to another board
- Returns:
List of Tuples of Local X, Y, link, fpga_link_id and fpga_id
- get_active_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int, sum_chip_active_time: float, router_packets: Dict[Tuple[int, int], Dict[str, int]]) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
sum_chip_active_time – Sum of times the cores were active in seconds
router_packets – The number of packets sent by each router
- Returns:
the active energy consumption of the system in joules
- get_idle_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
- Returns:
the idle energy consumption of the system in joules
- get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]¶
Get the coordinates of chips that should be Ethernet chips.
This may well be passed down to SpiNNakerTriadGeometry.
Note
This methods assumes that width and height would pass
verify_size(). If not, the results may be wrong.- Parameters:
width – The width of the machine to find the chips in
height – The height of the machine to find the chips in
- Returns:
A list of Tuples of X and Y coordinates
- illegal_ethernet_message(x: int, y: int) str | None[source]¶
Checks if x and y could be for an Ethernet.
This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.
Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location
- Parameters:
x
y
- Returns:
An explanation that the x and y can never be an Ethernet
spinn_machine.version.version_48_chips module¶
- class spinn_machine.version.version_48_chips.Version48Chips(max_cores_per_chip: int, max_sdram_per_chip: int)[source]¶
Bases:
AbstractVersionCode shared by 48 Chip boards
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]¶
Get the coordinates of chips that should be Ethernet chips.
This may well be passed down to SpiNNakerTriadGeometry.
Note
This methods assumes that width and height would pass
verify_size(). If not, the results may be wrong.- Parameters:
width – The width of the machine to find the chips in
height – The height of the machine to find the chips in
- Returns:
A list of Tuples of X and Y coordinates
- illegal_ethernet_message(x: int, y: int) str | None[source]¶
Checks if x and y could be for an Ethernet.
This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.
Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location
- Parameters:
x
y
- Returns:
An explanation that the x and y can never be an Ethernet
spinn_machine.version.version_5 module¶
- class spinn_machine.version.version_5.Version5[source]¶
Bases:
VersionSpin1,Version48ChipsCode for the large Spin1 48 Chip boards
Covers versions 4 and 5
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- WATTS_FOR_48_CHIP_BOARD_IDLE_COST: Final = 26.84¶
from Optimising the overall power usage on the SpiNNaker neuromimetic platform, an idle board uses 26.84W
- WATTS_FOR_48_CHIP_BOX_COST_OVERHEAD: Final = 5.04¶
from Optimising the overall power usage on the SpiNNaker neuromimetic platform, an idle board uses 26.84W and from measurement of a boxed board with all cores idle for 1 hour including the power supply and all parts, uses 31.88W, so the overhead is 5.04W
- WATTS_FOR_FRAME_IDLE_COST: Final = 117¶
measured from the real power meter and timing between the photos for a days powered off this is the cost of just a frame itself, including the switch and cooling, while the system is idle.
- WATTS_PER_FRAME_ACTIVE_COST_OVERHEAD: Final = 37.163557999999995¶
measured from the loading of the column and extrapolated this is the cost of just a frame itself, including the switch and cooling, while the system is active, over the idle cost for simplicity
- property chip_core_map: Dict[Tuple[int, int], int]¶
A map off the expected x,y coordinates on a standard board to the most likely number of cores on that chip.
- fpga_links() List[Tuple[int, int, int, int, int]][source]¶
The list of Local X, Y, link, fpga_link_id and fpga_id
These are applied local to each Ethernet Chip and even if the link is connected to another board
- Returns:
List of Tuples of Local X, Y, link, fpga_link_id and fpga_id
- get_active_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int, sum_chip_active_time: float, router_packets: Dict[Tuple[int, int], Dict[str, int]]) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
sum_chip_active_time – Sum of times the cores were active in seconds
router_packets – The number of packets sent by each router
- Returns:
the active energy consumption of the system in joules
- get_idle_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
- Returns:
the idle energy consumption of the system in joules
spinn_machine.version.version_spin1 module¶
- class spinn_machine.version.version_spin1.VersionSpin1[source]¶
Bases:
AbstractVersionShared code for all Spin1 board versions
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- COST_PER_PACKET_TYPE = {'External_FR_Packets': 1.8e-09, 'External_Multicast_Packets': 1e-09, 'External_NN_Packets': 1e-09, 'External_P2P_Packets': 1.8e-09, 'Local_FR_Packets': 1.8e-09, 'Local_Multicast_Packets': 1e-09, 'Local_NN_Packets': 1e-09, 'Local_P2P_Packets': 1.8e-09, 'Reinjected': 1e-09}¶
Cost of each packet type
- JOULES_PER_PACKET: Final = 1e-09¶
stated in papers (SpiNNaker: A 1-W 18 core system-on-Chip for Massively-Parallel Neural Network Simulation) 25pJ per bit - spike packets are 40 bits so 1nJ per spike
- JOULES_PER_ROUTER_BIT = 2.5e-11¶
stated in papers (SpiNNaker: A 1-W 18 core system-on-Chip for Massively-Parallel Neural Network Simulation) 25pJ per bit
- WATTS_PER_CORE_ACTIVE_OVERHEAD: Final = 0.034¶
From measuring the power of all 48 chips on a boxed board with all cores idle for 1 hour and 806 cores active for 1 hour we get 31.88W idle and 59.38W active, so 27.50W active overhead, which is 0.034W per core
- WATTS_PER_IDLE_CHIP: Final = 0.35¶
From Optimising the overall power usage on the SpiNNaker neuromimetic platform - all chips on a 48-chip board together use 5.23 + 5.17 + 5.52W + SDRAM of 0.90W = 16.82W when idle, so each chip use 0.35W
- get_router_report_packet_types() List[str][source]¶
- Returns:
The list of packet types that the router can send
- id_to_qx_qy_qp(core_id: int) Tuple[int, int, int][source]¶
Converts core id to quad coordinates
- Parameters:
core_id – id of the core
- Returns:
(qx, qy, qp)
- Raises:
NotImplementedError – If called on a version that does not support quads
- property minimum_cores_expected: int¶
The minimum number of Chip that we expect from a Chip
If there are less that this number of Cores Machine.validate and other methods are allowed to raise an exception
- property n_router_entries: int¶
The standard number of router entries in a router table.
While it is likely that all chips will have this number it should not be counted on. Ask each chip’s router for the correct value.
- quads_maps() None[source]¶
If applicable returns a map of virtual id to quad qx, qy, qp
Spin 1 boards will return None!
- Returns:
None or a Dict from virtual id to a tuple of chip x, chip y and quad ID
- qx_qy_qp_to_id(qx: int, qy: int, qp: int) int[source]¶
Converts quad coordinates to the core id
- Parameters:
qx – quad x coordinate of the core
qy – quad y coordinate of the core
qp – quad p coordinate of the core
- Returns:
The core id on the Chip
- Raises:
NotImplementedError – If called on a version that does not support quads
spinn_machine.version.version_spin2 module¶
- class spinn_machine.version.version_spin2.VersionSpin2[source]¶
Bases:
AbstractVersionCode for the Spin2 board versions
- Parameters:
max_cores_per_chip – Expected number of cores on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
max_sdram_per_chip – Expected amount of SDRAM on a fully operational Chip. Ignored if cfg sets a lower value (not recommended)
- get_active_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int, sum_chip_active_time: float, router_packets: Dict[Tuple[int, int], Dict[str, int]]) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
sum_chip_active_time – Sum of times the cores were active in seconds
router_packets – The number of packets sent by each router
- Returns:
the active energy consumption of the system in joules
- get_idle_energy(time_s: float, n_frames: int, n_boards: int, n_chips: int) float[source]¶
- Parameters:
time_s – The time to calculate the energy for in seconds
n_frames – The number of frames
n_boards – The number of boards
n_chips – The number of chips
- Returns:
the idle energy consumption of the system in joules
- get_router_report_packet_types() List[str][source]¶
- Returns:
The list of packet types that the router can send
- id_to_qx_qy_qp(core_id: int) Tuple[int, int, int][source]¶
Converts core id to quad coordinates
- Parameters:
core_id – id of the core
- Returns:
(qx, qy, qp)
- Raises:
NotImplementedError – If called on a version that does not support quads
- property minimum_cores_expected: int¶
The minimum number of Chip that we expect from a Chip
If there are less that this number of Cores Machine.validate and other methods are allowed to raise an exception
- property n_router_entries: int¶
The standard number of router entries in a router table.
While it is likely that all chips will have this number it should not be counted on. Ask each chip’s router for the correct value.
- quads_maps() Dict[int, Tuple[int, int, int]][source]¶
If applicable returns a map of virtual id to quad qx, qy, qp
Spin 1 boards will return None!
- Returns:
None or a Dict from virtual id to a tuple of chip x, chip y and quad ID
- qx_qy_qp_to_id(qx: int, qy: int, qp: int) int[source]¶
Converts quad coordinates to the core id
- Parameters:
qx – quad x coordinate of the core
qy – quad y coordinate of the core
qp – quad p coordinate of the core
- Returns:
The core id on the Chip
- Raises:
NotImplementedError – If called on a version that does not support quads
spinn_machine.version.version_strings module¶
- class spinn_machine.version.version_strings.VersionStrings(value)[source]¶
Bases:
EnumA description of strings in cfg settings to say test versions
As additional Versions are added this should allow easy testing of these as far as possible.
- Parameters:
value – enum ID for this version
text – label for this enum
versions – machine versions that this group includes
- ANY = 1¶
- BIG = 3¶
- EIGHT_BY_EIGHT = 5¶
- FOUR_PLUS = 2¶
- WITH_FPGAS = 6¶
- classmethod from_string(value: str) VersionStrings[source]¶
Gets a VersionString object from a String
- Parameters:
value – label
- Returns:
VersionStrings Enum with this label
- property options: List[int]¶
The list of the versions covered by this string
This list can grow as new versions are added
Module contents¶
- spinn_machine.version.version_factory() AbstractVersion¶
Creates a Machine Version class based on cfg settings.
- Returns:
A subclass of AbstractVersion
- Raises:
SpinnMachineException – If the cfg version is not set correctly