Skip to content

Commit

Permalink
Some more changes in measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Nov 7, 2024
1 parent 1d7aec6 commit 40262e3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
4 changes: 3 additions & 1 deletion spinn_machine/version/abstract_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
logger = FormatAdapter(logging.getLogger(__name__))

ChipXY: TypeAlias = Tuple[int, int]
# Dict of the number of packets sent by each router in each category
RouterPackets: TypeAlias = Dict[ChipXY, Dict[str, int]]
ChipActiveTime: TypeAlias = Dict[ChipXY, float]
# Dict of the time the cores were active in seconds, and the number of cores
ChipActiveTime: TypeAlias = Dict[ChipXY, Tuple[float, int]]

CORE_RANGE = re.compile(r"(\d+)-(\d+)")
CORE_SINGLE = re.compile(r"(-*)(\d+)")
Expand Down
29 changes: 12 additions & 17 deletions spinn_machine/version/version_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ class Version5(VersionSpin1, Version48Chips):
"""
__slots__ = ()

#: given from Indar's measurements
WATTS_PER_BOARD_FPGAS: Final = 0.584635

#: 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
Expand All @@ -56,13 +53,13 @@ class Version5(VersionSpin1, Version48Chips):

# pylint: disable=invalid-name
#: measured from the real power meter and timing between the photos
#: for a day powered off
WATTS_FOR_BOXED_48_CHIP_FRAME_IDLE_COST: Final = 4.5833333
#: for a day with just the cooling fans of the boxed board.
WATTS_FOR_48_CHIP_BOX_COST_OVERHEAD: Final = 4.5833333

# pylint: disable=invalid-name
#: measured from the real power meter and timing between the photos
#: for a day powered off
WATTS_FOR_UNBOXED_48_CHIP_FRAME_IDLE_COST: Final = 4.5833333
WATTS_FOR_48_CHIP_BOARD_IDLE_COST: Final = 4.5833333

@property
@overrides(VersionSpin1.name)
Expand Down Expand Up @@ -117,17 +114,15 @@ def get_idle_energy(

# The container of the boards idle energy
if n_frames != 0:
energy += n_frames * self.WATTS_FOR_FRAME_IDLE_COST * time_s
elif n_boards == 1:
energy += (
self.WATTS_FOR_BOXED_48_CHIP_FRAME_IDLE_COST * time_s)
else:
energy += (
n_boards * self.WATTS_FOR_UNBOXED_48_CHIP_FRAME_IDLE_COST *
time_s)

# The FPGA idle energy
energy += n_boards * self.WATTS_PER_BOARD_FPGAS * time_s
if n_boards > 1:
energy += n_frames * self.WATTS_FOR_FRAME_IDLE_COST * time_s
elif n_boards == 1:
energy += (
n_frames * self.WATTS_FOR_48_CHIP_BOX_COST_OVERHEAD *
time_s)

# The FPGAs + board idle energy, excluding the chips
energy += n_boards * self.WATTS_FOR_48_CHIP_BOARD_IDLE_COST * time_s
return energy

@overrides(VersionSpin1.get_active_energy)
Expand Down
4 changes: 3 additions & 1 deletion spinn_machine/version/version_spin1.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def _get_router_active_energy(

def _get_core_active_energy(
self, core_active_times: ChipActiveTime) -> float:
# TODO: treat cores that are active sometimes differently to cores that
# are always idle
return sum(
time * self.WATTS_PER_CORE_ACTIVE_OVERHEAD
for time in core_active_times.values())
for time, _n_cores in core_active_times.values())

0 comments on commit 40262e3

Please sign in to comment.