From 6018415c8f7fccc283e385c9f60176241411c823 Mon Sep 17 00:00:00 2001 From: Basem Mohammed <95645899+Basemism@users.noreply.github.com> Date: Wed, 2 Sep 2026 11:47:02 +0200 Subject: [PATCH] mem-ruby,configs: honor configurable Ruby link width Apply --link-width-bits to SimpleNetwork external and internal links in the crossbar and XY-mesh topologies. Convert the option from bits to the byte-based bandwidth_factor used by SimpleNetwork while retaining the existing 128-bit default. Also pass the selected width to CrossbarGarnet external links so GPU and CPU topology configurations use the same explicit link-width setting. --- configs/topologies/Crossbar.py | 7 +++++++ configs/topologies/CrossbarGarnet.py | 4 +++- configs/topologies/Mesh_XY.py | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configs/topologies/Crossbar.py b/configs/topologies/Crossbar.py index f6d4e545eca..bbf427cad48 100644 --- a/configs/topologies/Crossbar.py +++ b/configs/topologies/Crossbar.py @@ -39,6 +39,10 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): link_latency = options.link_latency # used by simple and garnet router_latency = options.router_latency # only used by garnet + # bandwidth_factor is used by SimpleNetwork (in bytes); + # --link-width-bits converts to bytes for consistency. + bw = getattr(options, "link_width_bits", 128) // 8 + # Create an individual router for each controller plus one more for # the centralized crossbar. The large numbers of routers are needed # because external links do not model outgoing bandwidth in the @@ -57,6 +61,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): ext_node=n, int_node=routers[i], latency=link_latency, + bandwidth_factor=bw, ) for (i, n) in enumerate(self.nodes) ] @@ -72,6 +77,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): src_node=routers[i], dst_node=xbar, latency=link_latency, + bandwidth_factor=bw, ) ) @@ -84,6 +90,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): src_node=xbar, dst_node=routers[i], latency=link_latency, + bandwidth_factor=bw, ) ) diff --git a/configs/topologies/CrossbarGarnet.py b/configs/topologies/CrossbarGarnet.py index 74d69e846f0..9bd0e090712 100644 --- a/configs/topologies/CrossbarGarnet.py +++ b/configs/topologies/CrossbarGarnet.py @@ -38,11 +38,13 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): # the associated allocator. # For simple network, use Crossbar.py + bw = getattr(options, "link_width_bits", 128) // 8 + xbar = Router(router_id=0) network.routers = xbar ext_links = [ - ExtLink(link_id=i, ext_node=n, int_node=xbar) + ExtLink(link_id=i, ext_node=n, int_node=xbar, bandwidth_factor=bw) for (i, n) in enumerate(self.nodes) ] network.ext_links = ext_links diff --git a/configs/topologies/Mesh_XY.py b/configs/topologies/Mesh_XY.py index 974422be41e..2f4968ffd71 100644 --- a/configs/topologies/Mesh_XY.py +++ b/configs/topologies/Mesh_XY.py @@ -56,6 +56,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): # Can be over-ridden on a per link/router basis link_latency = options.link_latency # used by simple and garnet router_latency = options.router_latency # only used by garnet + bw = getattr(options, "link_width_bits", 128) // 8 # There must be an evenly divisible number of cntrls to routers # Also, obviously the number or rows must be <= the number of routers @@ -95,6 +96,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): ext_node=n, int_node=routers[router_id], latency=link_latency, + bandwidth_factor=bw, ) ) link_count += 1 @@ -110,6 +112,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): ext_node=node, int_node=routers[0], latency=link_latency, + bandwidth_factor=bw, ) ) link_count += 1 @@ -147,6 +150,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): dst_inport="West", latency=link_latency, weight=1, + bandwidth_factor=bw, supported_vnets=[v] if v is not None else [], ) ) @@ -168,6 +172,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): dst_inport="East", latency=link_latency, weight=1, + bandwidth_factor=bw, supported_vnets=[v] if v is not None else [], ) ) @@ -189,6 +194,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): dst_inport="South", latency=link_latency, weight=2, + bandwidth_factor=bw, supported_vnets=[v] if v is not None else [], ) ) @@ -210,6 +216,7 @@ def makeTopology(self, options, network, IntLink, ExtLink, Router): dst_inport="North", latency=link_latency, weight=2, + bandwidth_factor=bw, supported_vnets=[v] if v is not None else [], ) )