From aed14eb3577c93c943d7285728c00749dc1c20d0 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 22 Apr 2024 06:27:20 +0100 Subject: [PATCH 1/3] fpga does not yet work with spin2 48 chip boards --- .../router_algorithms_tests/test_routers.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/unittests/operations_tests/router_algorithms_tests/test_routers.py b/unittests/operations_tests/router_algorithms_tests/test_routers.py index b77d178e7..cd41e325f 100644 --- a/unittests/operations_tests/router_algorithms_tests/test_routers.py +++ b/unittests/operations_tests/router_algorithms_tests/test_routers.py @@ -13,6 +13,7 @@ # limitations under the License. from spinn_utilities.timer import Timer from spinn_utilities.config_holder import set_config +from spinn_machine.version import FIVE from spinn_machine.version.version_strings import VersionStrings from spinn_machine.virtual_machine import ( virtual_machine_by_boards, virtual_machine_by_cores) @@ -646,7 +647,8 @@ def test_internal_and_split(params): def test_spinnaker_link(params): algorithm, n_vertices, n_m_vertices = params unittest_setup() - set_config("Machine", "versions", VersionStrings.BIG.text) + # TODO SPIN2 spinnaker links + set_config("Machine", "version", FIVE) writer = PacmanDataWriter.mock() in_device = ApplicationSpiNNakerLinkVertex(100, 0) in_device.splitter = SplitterExternalDevice() @@ -670,7 +672,8 @@ def test_spinnaker_link(params): def test_fpga_link(params): algorithm, n_vertices, n_m_vertices = params unittest_setup() - set_config("Machine", "versions", VersionStrings.BIG.text) + # TODO spin2 fpga + set_config("Machine", "version", 5) writer = PacmanDataWriter.mock() in_device = ApplicationFPGAVertex( 100, [FPGAConnection(0, 0, None, None)], None) @@ -697,7 +700,8 @@ def test_fpga_link(params): def test_fpga_link_overlap(params): algorithm, _n_vertices, _n_m_vertices = params unittest_setup() - set_config("Machine", "versions", VersionStrings.BIG.text) + # TODO Spin2 links + set_config("Machine", "version", 5) writer = PacmanDataWriter.mock() set_config("Machine", "down_chips", "6,1") in_device = ApplicationFPGAVertex( From d8efe5785dbf1adf8d65fc63b1e70fdc3897f9f2 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 22 Apr 2024 15:25:52 +0100 Subject: [PATCH 2/3] use versions big instead of MULTIPLE_BOARDS --- .../test_application_placer.py | 16 +++++++++------- .../router_algorithms_tests/test_routers.py | 2 +- .../test_tags_board_addresses.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/unittests/operations_tests/placer_algorithms_tests/test_application_placer.py b/unittests/operations_tests/placer_algorithms_tests/test_application_placer.py index fc502da36..5532a842b 100644 --- a/unittests/operations_tests/placer_algorithms_tests/test_application_placer.py +++ b/unittests/operations_tests/placer_algorithms_tests/test_application_placer.py @@ -94,7 +94,7 @@ def _make_vertices( def test_application_placer(): unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) writer = PacmanDataWriter.mock() # fixed early works as this vertex is looked at first fixed = SimpleTestVertex(10, "FIXED", max_atoms_per_core=1) @@ -112,7 +112,7 @@ def test_application_placer(): def test_application_placer_large_groups(): unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) writer = PacmanDataWriter.mock() version = writer.get_machine_version() # fixed early works as this vertex is looked at first @@ -133,16 +133,18 @@ def test_application_placer_large_groups(): def test_application_placer_too_few_boards(): unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) writer = PacmanDataWriter.mock() # fixed early works as this vertex is looked at first fixed = SimpleTestVertex(10, "FIXED", max_atoms_per_core=1) fixed.splitter = SplitterFixedLegacy() fixed.set_fixed_location(0, 0) writer.add_vertex(fixed) + version = writer.get_machine_version() + n_machine_vertices = version.max_cores_per_chip - 2 fixed.splitter.create_machine_vertices(ChipCounter()) for i in range(56): - _make_vertices(writer, 1000, 14, 5, f"app_vertex_{i}") + _make_vertices(writer, 1000, 14, n_machine_vertices, f"app_vertex_{i}") # intentionally too small writer.set_machine(virtual_machine_by_cores( n_cores=writer.get_n_machine_vertices() / 2)) @@ -155,7 +157,7 @@ def test_application_placer_too_few_boards(): def test_application_placer_restart_needed(): unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) writer = PacmanDataWriter.mock() for (x, y) in [(1, 0), (1, 1), (0, 1)]: fixed = SimpleTestVertex(15, f"FIXED {x}:{y}", max_atoms_per_core=1) @@ -173,7 +175,7 @@ def test_application_placer_restart_needed(): def test_application_placer_late_fixed(): unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) writer = PacmanDataWriter.mock() for i in range(56): _make_vertices(writer, 1000, 14, 5, f"app_vertex_{i}") @@ -191,7 +193,7 @@ def test_application_placer_late_fixed(): def test_application_placer_fill_chips(): unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) writer = PacmanDataWriter.mock() # fixed early works as this vertex is looked at first fixed = SimpleTestVertex(10, "FIXED", max_atoms_per_core=1) diff --git a/unittests/operations_tests/router_algorithms_tests/test_routers.py b/unittests/operations_tests/router_algorithms_tests/test_routers.py index cd41e325f..4c6ae87f5 100644 --- a/unittests/operations_tests/router_algorithms_tests/test_routers.py +++ b/unittests/operations_tests/router_algorithms_tests/test_routers.py @@ -626,7 +626,7 @@ def test_internal_only(params): def test_internal_and_split(params): algorithm, n_vertices, n_m_vertices = params unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) writer = PacmanDataWriter.mock() for i in range(n_vertices): _make_vertices_split( diff --git a/unittests/operations_tests/tag_allocator_tests/test_tags_board_addresses.py b/unittests/operations_tests/tag_allocator_tests/test_tags_board_addresses.py index a0826cb39..3215a9355 100644 --- a/unittests/operations_tests/tag_allocator_tests/test_tags_board_addresses.py +++ b/unittests/operations_tests/tag_allocator_tests/test_tags_board_addresses.py @@ -33,7 +33,7 @@ class TestTagsBoardAddresses(unittest.TestCase): """ def setUp(self): unittest_setup() - set_config("Machine", "versions", VersionStrings.MULTIPLE_BOARDS.text) + set_config("Machine", "versions", VersionStrings.BIG.text) def test_ip_tags(self): writer = PacmanDataWriter.mock() From f11e6d00369566326c42803f36a81e42d4654839 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 22 Apr 2024 15:52:09 +0100 Subject: [PATCH 3/3] mark tests as version Five as that is the boards the data came from --- .../test_checked_unordered_pair_compression.py | 5 +++-- .../test_ordered_covering_compression.py | 5 +++-- .../router_compressor_tests/test_pair_compression.py | 5 +++-- .../router_compressor_tests/test_range_compressor.py | 5 +++-- .../test_unordered_pair_compression.py | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/unittests/operations_tests/router_compressor_tests/test_checked_unordered_pair_compression.py b/unittests/operations_tests/router_compressor_tests/test_checked_unordered_pair_compression.py index 17d8ba794..30f4fb944 100644 --- a/unittests/operations_tests/router_compressor_tests/test_checked_unordered_pair_compression.py +++ b/unittests/operations_tests/router_compressor_tests/test_checked_unordered_pair_compression.py @@ -18,7 +18,7 @@ from spinn_utilities.config_holder import set_config from spinn_machine import virtual_machine -from spinn_machine.version.version_strings import VersionStrings +from spinn_machine.version import FIVE from pacman.config_setup import unittest_setup from pacman.data.pacman_data_writer import PacmanDataWriter from pacman.model.routing_tables.multicast_routing_tables import (from_json) @@ -31,7 +31,8 @@ class TestUnorderedPairCompressor(unittest.TestCase): def setUp(self): unittest_setup() - set_config("Machine", "versions", VersionStrings.WRAPPABLE.text) + # This tests needs exactly version 5 as on Spin2 it would fit + set_config("Machine", "version", FIVE) def test_onordered_pair_big(self): diff --git a/unittests/operations_tests/router_compressor_tests/test_ordered_covering_compression.py b/unittests/operations_tests/router_compressor_tests/test_ordered_covering_compression.py index 455fee7b9..096d7b55e 100644 --- a/unittests/operations_tests/router_compressor_tests/test_ordered_covering_compression.py +++ b/unittests/operations_tests/router_compressor_tests/test_ordered_covering_compression.py @@ -18,7 +18,7 @@ from spinn_utilities.config_holder import set_config from spinn_machine import virtual_machine -from spinn_machine.version.version_strings import VersionStrings +from spinn_machine.version import FIVE from pacman.config_setup import unittest_setup from pacman.data.pacman_data_writer import PacmanDataWriter from pacman.model.routing_tables.multicast_routing_tables import (from_json) @@ -32,7 +32,8 @@ class TestOrderedCoveringCompressor(unittest.TestCase): def setUp(self): unittest_setup() - set_config("Machine", "versions", VersionStrings.WRAPPABLE.text) + # tests against version 5 as Spin2 would not need compression + set_config("Machine", "version", FIVE) def test_oc_big(self): class_file = sys.modules[self.__module__].__file__ diff --git a/unittests/operations_tests/router_compressor_tests/test_pair_compression.py b/unittests/operations_tests/router_compressor_tests/test_pair_compression.py index 0b69868f3..8dcb8562d 100644 --- a/unittests/operations_tests/router_compressor_tests/test_pair_compression.py +++ b/unittests/operations_tests/router_compressor_tests/test_pair_compression.py @@ -18,7 +18,7 @@ from spinn_utilities.config_holder import set_config from spinn_machine import virtual_machine -from spinn_machine.version.version_strings import VersionStrings +from spinn_machine.version import FIVE from pacman.config_setup import unittest_setup from pacman.data.pacman_data_writer import PacmanDataWriter from pacman.model.routing_tables.multicast_routing_tables import (from_json) @@ -31,7 +31,8 @@ class TestPairCompressor(unittest.TestCase): def setUp(self): unittest_setup() - set_config("Machine", "versions", VersionStrings.WRAPPABLE.text) + # tests against version 5 as Spin2 would not need compression + set_config("Machine", "version", FIVE) def do_pair_big(self, c_sort): class_file = sys.modules[self.__module__].__file__ diff --git a/unittests/operations_tests/router_compressor_tests/test_range_compressor.py b/unittests/operations_tests/router_compressor_tests/test_range_compressor.py index 7aabbf7eb..99a224a06 100644 --- a/unittests/operations_tests/router_compressor_tests/test_range_compressor.py +++ b/unittests/operations_tests/router_compressor_tests/test_range_compressor.py @@ -16,7 +16,7 @@ import sys import unittest from spinn_utilities.config_holder import set_config -from spinn_machine.version.version_strings import VersionStrings +from spinn_machine.version import FIVE from pacman.config_setup import unittest_setup from pacman.data.pacman_data_writer import PacmanDataWriter from pacman.model.routing_tables import MulticastRoutingTables @@ -32,7 +32,8 @@ class TestRangeCompressor(unittest.TestCase): def setUp(self): unittest_setup() - set_config("Machine", "versions", VersionStrings.WRAPPABLE.text) + # tests against version 5 as Spin2 would not need compression + set_config("Machine", "version", FIVE) set_config( "Mapping", "router_table_compress_as_far_as_possible", True) diff --git a/unittests/operations_tests/router_compressor_tests/test_unordered_pair_compression.py b/unittests/operations_tests/router_compressor_tests/test_unordered_pair_compression.py index 957286c13..5c8f28e13 100644 --- a/unittests/operations_tests/router_compressor_tests/test_unordered_pair_compression.py +++ b/unittests/operations_tests/router_compressor_tests/test_unordered_pair_compression.py @@ -18,7 +18,7 @@ from spinn_utilities.config_holder import set_config from spinn_machine import virtual_machine -from spinn_machine.version.version_strings import VersionStrings +from spinn_machine.version import FIVE from pacman.config_setup import unittest_setup from pacman.data.pacman_data_writer import PacmanDataWriter from pacman.model.routing_tables.multicast_routing_tables import (from_json) @@ -32,7 +32,8 @@ class TestUnorderedPairCompressor(unittest.TestCase): def setUp(self): unittest_setup() - set_config("Machine", "versions", VersionStrings.WRAPPABLE.text) + # tests against version 5 as Spin2 would not need compression + set_config("Machine", "version", FIVE) def test_onordered_pair_big(self): class_file = sys.modules[self.__module__].__file__