Skip to content

Commit

Permalink
ApplicationVertex never generate dataSpecs
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Nov 14, 2024
1 parent 0745a8f commit 0d558cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from spinn_utilities.abstract_base import AbstractBase, abstractmethod
from spinn_utilities.overrides import overrides
from spinn_utilities.require_subclass import require_subclass
from pacman.model.graphs.machine import MachineVertex
from pacman.model.placements import Placement
from pacman.model.resources import AbstractSDRAM

from .abstract_has_associated_binary import AbstractHasAssociatedBinary
if TYPE_CHECKING:
from spinn_front_end_common.interface.ds import DataSpecificationGenerator
Expand All @@ -41,3 +45,9 @@ def generate_data_specification(
The placement the vertex is located at
"""
raise NotImplementedError

@property
@overrides(MachineVertex.sdram_required)
@abstractmethod
def sdram_required(self) -> AbstractSDRAM:
raise NotImplementedError
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class _GraphDataSpecificationWriter(object):

def __init__(self) -> None:
self._sdram_usage: Dict[Tuple[int, int], int] = defaultdict(lambda: 0)
self._vertices_by_chip = defaultdict(list)
self._vertices_by_chip: Dict[Tuple[int, int],
List[AbstractGeneratesDataSpecification]] = defaultdict(list)

def run(self,
placement_order: Optional[Sequence[Placement]] = None) -> str:
Expand Down Expand Up @@ -104,16 +105,6 @@ def run(self,
vertex, AbstractRewritesDataSpecification):
vertices_to_reset.append(vertex)

# If the spec wasn't generated directly, and there is an
# application vertex, try with that
if not generated and vertex.app_vertex is not None:
generated = self.__generate_data_spec_for_vertices(
placement, vertex.app_vertex, ds_db)
if generated and isinstance(
vertex.app_vertex,
AbstractRewritesDataSpecification):
vertices_to_reset.append(vertex.app_vertex)

# Ensure that the vertices know their regions have been reloaded
for rewriter in vertices_to_reset:
rewriter.set_reload_required(False)
Expand Down

0 comments on commit 0d558cc

Please sign in to comment.