Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version and testing for Spin2 #1442

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions unittests/model_tests/neuron/test_synaptic_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from spinn_utilities.overrides import overrides
from spinn_utilities.config_holder import set_config
from spinn_machine.version.version_strings import VersionStrings
from spinnman.transceiver.mockable_transceiver import MockableTransceiver
from spinnman.transceiver import Transceiver
from pacman.model.placements import Placement
Expand Down Expand Up @@ -103,7 +104,7 @@ def say_false(self, *args, **kwargs):

def test_write_data_spec():
unittest_setup()
set_config("Machine", "version", 5)
set_config("Machine", "versions", VersionStrings.ANY.text)
writer = SpynnakerDataWriter.mock()
# UGLY but the mock transceiver NEED generate_on_machine to be False
AbstractGenerateConnectorOnMachine.generate_on_machine = say_false
Expand Down Expand Up @@ -433,7 +434,7 @@ def test_pop_based_master_pop_table_standard(
undelayed_indices_connected, delayed_indices_connected,
n_pre_neurons, neurons_per_core, max_delay):
unittest_setup()
set_config("Machine", "version", 5)
set_config("Machine", "versions", VersionStrings.FOUR_PLUS.text)
writer = SpynnakerDataWriter.mock()

# Build a from list connector with the delays we want
Expand Down Expand Up @@ -476,7 +477,7 @@ def test_pop_based_master_pop_table_standard(

# Generate the data
with DsSqlliteDatabase() as db:
spec = DataSpecificationGenerator(1, 2, 3, post_mac_vertex, db)
spec = DataSpecificationGenerator(1, 0, 3, post_mac_vertex, db)

regions = SynapseRegions(
synapse_params=5, synapse_dynamics=6, structural_dynamics=7,
Expand All @@ -494,7 +495,7 @@ def test_pop_based_master_pop_table_standard(
spec, post_vertex_slice, references)

# Read the population table and check entries
info = list(db.get_region_pointers_and_content(1, 2, 3))
info = list(db.get_region_pointers_and_content(1, 0, 3))
region, _, region_data = info[1]
assert region == 3
mpop_data = numpy.frombuffer(region_data, dtype="uint8").view("uint32")
Expand Down
5 changes: 2 additions & 3 deletions unittests/test_integration_using_virtual_board/spynnaker.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[Machine]
machine_spec_file = None
width = 8
height = 8
version = 5
version = None
versions = Any
virtual_board = True
machineName = None
spalloc_server = None
Expand Down
3 changes: 1 addition & 2 deletions unittests/test_sata_connectors/spynnaker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ machine_spec_file = None

machineName = None
version = None
versions = Multiple boards

remote_spinnaker_url = None

Expand All @@ -14,8 +15,6 @@ virtual_board = True
down_cores = None
down_chips = None
down_links = 2,5,2:2,5,3:6,1,2:6,1,3:10,9,2:10,9,3
width = 12
height = 12

[Mode]
# mode = Production or Debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

def do_run():
# Setup
p.setup(timestep=1.0)
p.setup(timestep=1.0, n_boards_required=3)

src_1 = p.Population(
None,
Expand Down
3 changes: 1 addition & 2 deletions unittests/test_spinnaker_link_connectors/spynnaker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
spalloc_server = None
machineName = None
version = None
versions = Multiple boards
virtual_board = True
down_cores = None
down_chips = None
down_links = 0,0,4:4,8,4:8,4,4
width = 12
height = 12

[Mode]
# mode = Production or Debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

def do_run():
# Setup
p.setup(timestep=1.0)
p.setup(timestep=1.0, n_boards_required=3)

# FPGA Retina
retina_device = p.external_devices.ExternalFPGARetinaDevice
Expand Down
5 changes: 2 additions & 3 deletions unittests/test_using_virtual_board/spynnaker.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[Machine]
width = 8
height = 8
version = 5
version = None
versions = ANY
virtual_board = True
machineName = None
spalloc_server = None
Expand Down
10 changes: 7 additions & 3 deletions unittests/test_using_virtual_board/test_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ def test_placement_constraint(self):

"""
sim.setup(timestep=1.0)
width, height = SpynnakerDataView.get_machine_version().board_shape
# pick and XY in the middle of the board
x = (width + 1) // 3
y = (height + 1) // 3
set_config("Reports", "write_application_graph_placer_report", True)
sim.set_number_of_neurons_per_core(sim.IF_curr_exp, 50)

pop_1 = sim.Population(200, sim.IF_curr_exp(), label="pop_1")
pop_1.add_placement_constraint(x=1, y=1)
pop_1.add_placement_constraint(x=x, y=y)
input = sim.Population(1, sim.SpikeSourceArray(spike_times=[0]),
label="input")
sim.Projection(input, pop_1, sim.AllToAllConnector(),
Expand All @@ -44,5 +48,5 @@ def test_placement_constraint(self):
sim.end()
self.assertGreater(len(placements), 0)
for pl in placements:
self.assertEqual(1, pl.x)
self.assertEqual(1, pl.y)
self.assertEqual(x, pl.x)
self.assertEqual(y, pl.y)
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[Machine]
width = 8
height = 8
version = 5
version = None
versions = Any
virtual_board = True
machineName = None
spalloc_server = None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[Machine]
machine_spec_file = None
width = 8
height = 8
version = 5
version = None
versions = Any
virtual_board = True
machineName = None
spalloc_server = None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[Machine]
virtual_board = True
width = 8
height = 8
version = 5
version = None
versions = Any
machine_name = None
remote_spinnaker_url = None
spalloc_server = None
Expand Down
Loading