From b4418e8e0b1c0aa187f2e8a5e5ce0379749eebb1 Mon Sep 17 00:00:00 2001 From: Jesse Hines Date: Thu, 2 Oct 2025 13:18:18 -0400 Subject: [PATCH 1/6] Add missing dep Used by fastsim scheduler --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 732315e..8cc586d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,7 @@ dependencies = [ "gym==0.26.2", "dill==0.4.0", "argcomplete==3.6.2", + "pyzmq==27.1.0", "pre-commit" ] -- GitLab From 9e453dad4731fb8af73dce3fdcdb9a0181fbb71f Mon Sep 17 00:00:00 2001 From: Jesse Hines Date: Thu, 2 Oct 2025 14:17:04 -0400 Subject: [PATCH 2/6] Set workload to replay This makes it easier to work with in the simulation dashboard tables --- raps/sim_config.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/raps/sim_config.py b/raps/sim_config.py index 2f9bc44..e19d0c0 100644 --- a/raps/sim_config.py +++ b/raps/sim_config.py @@ -25,7 +25,7 @@ class SimConfig(RAPSBaseModel, abc.ABC): """ Include the FMU cooling model """ simulate_network: bool = False """ Include network model """ - weather: bool | None = None + weather: bool = False """ Include weather information in the cooling model. Defaults to True if replay, False otherwise. @@ -134,7 +134,7 @@ class SimConfig(RAPSBaseModel, abc.ABC): """ Grab data from live system. """ # Workload arguments (TODO split into separate model) - workload: Literal['random', 'benchmark', 'peak', 'idle', 'synthetic', 'multitenant'] | None = None + workload: Literal['random', 'benchmark', 'peak', 'idle', 'synthetic', 'multitenant', 'replay'] = "random" """ Type of synthetic workload """ multimodal: list[float] = [1.0] @@ -312,13 +312,16 @@ class SimConfig(RAPSBaseModel, abc.ABC): if td is not None: convert_to_time_unit(td, self.time_unit) # will throw if invalid - if not self.replay and not self.workload: - self.workload = "random" + if self.replay: + if "workload" not in self.model_fields_set: + self.workload = "replay" + elif self.workload != 'replay': + raise ValueError('workload must be either omitted or "replay" when --replay is set') if self.cooling: self.layout = "layout2" - if self.weather is None: + if 'weather' not in self.model_fields_set: self.weather = self.cooling and bool(self.replay) if self.jobsize_is_power_of is not None and self.jobsize_is_of_degree is not None: -- GitLab From 8a1a64273a7376b4566428f77b4a171ca090ae67 Mon Sep 17 00:00:00 2001 From: Jesse Hines Date: Thu, 2 Oct 2025 14:42:05 -0400 Subject: [PATCH 3/6] Fix doc comments We don't use time_unit to parse the input time deltas anymore --- raps/sim_config.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/raps/sim_config.py b/raps/sim_config.py index e19d0c0..49e0d2f 100644 --- a/raps/sim_config.py +++ b/raps/sim_config.py @@ -223,18 +223,15 @@ class SimConfig(RAPSBaseModel, abc.ABC): # Downtime downtime_first: SmartTimedelta | None = None """ - First downtime (unit specified by `time_unit`, default seconds). - Can pass a string like 27m, 3h, 7d + First downtime. Can pass a string like 27m, 3h, 7d """ downtime_interval: SmartTimedelta | None = None """ - Interval between downtimes (unit specified by `time_unit`, default seconds). - Can pass a string like 123, 27m, 3h, 7d + Interval between downtimes. Can pass a string like 123, 27m, 3h, 7d """ downtime_length: SmartTimedelta | None = None """ - Downtime length (unit specified by `time_unit`, default seconds). - Can pass a string like 123, 27m, 3h, 7d + Downtime length. Can pass a string like 123, 27m, 3h, 7d """ @cached_property -- GitLab From 22d2b25bee6fc78ceabe4f247e357200b49dd336 Mon Sep 17 00:00:00 2001 From: Jesse Hines Date: Thu, 2 Oct 2025 15:08:44 -0400 Subject: [PATCH 4/6] Add some type annotations --- raps/sim_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/raps/sim_config.py b/raps/sim_config.py index 49e0d2f..01439f3 100644 --- a/raps/sim_config.py +++ b/raps/sim_config.py @@ -15,7 +15,7 @@ from raps.utils import ( from raps.system_config import ( SystemConfig, get_partition_configs, get_system_config, list_systems, resolve_system_reference, ) -from pydantic import model_validator, Field +from pydantic import model_validator, Field, BeforeValidator Distribution = Literal['uniform', 'weibull', 'normal'] @@ -54,7 +54,7 @@ class SimConfig(RAPSBaseModel, abc.ABC): Step size for the power simulation (default seconds). Can pass a string like 15s, 1m, 1h, 1ms """ - time_unit: timedelta = timedelta(seconds=1) + time_unit: A[timedelta, BeforeValidator(parse_time_unit)] = timedelta(seconds=1) """ The base unit of the simulation, determining how often it will tick the job scheduler. """ @@ -266,6 +266,7 @@ class SimConfig(RAPSBaseModel, abc.ABC): "time_delta", "time", "fastforward", "downtime_first", "downtime_interval", "downtime_length", ] + # infer time unit from other timedelta fields if it wasn't set explicitly if data.get('time_unit') is None: time_unit = min( [infer_time_unit(data[f]) for f in td_fields if data.get(f)], -- GitLab From b679b05fa4313a55102de6f99ab32be3f83b6a85 Mon Sep 17 00:00:00 2001 From: Jesse Hines Date: Thu, 2 Oct 2025 16:31:19 -0400 Subject: [PATCH 5/6] More tweaks to workload and replay --- raps/sim_config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/raps/sim_config.py b/raps/sim_config.py index 01439f3..350c873 100644 --- a/raps/sim_config.py +++ b/raps/sim_config.py @@ -310,11 +310,12 @@ class SimConfig(RAPSBaseModel, abc.ABC): if td is not None: convert_to_time_unit(td, self.time_unit) # will throw if invalid - if self.replay: - if "workload" not in self.model_fields_set: - self.workload = "replay" - elif self.workload != 'replay': - raise ValueError('workload must be either omitted or "replay" when --replay is set') + if "workload" not in self.model_fields_set and self.replay: + self.workload = "replay" # default to replay if --replay is set + if self.workload == "replay" and not self.replay: + raise ValueError('--replay must be set when workload type is "replay"') + elif self.workload != "replay" and self.replay: + raise ValueError('workload must be either omitted or "replay" when --replay is set') if self.cooling: self.layout = "layout2" -- GitLab From b4c6b3d59c26c5c432b74c8520837f4ed5b8cac8 Mon Sep 17 00:00:00 2001 From: Jesse Hines Date: Thu, 2 Oct 2025 16:33:37 -0400 Subject: [PATCH 6/6] Fix test stats --- tests/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util.py b/tests/util.py index 20c9054..4082d4f 100644 --- a/tests/util.py +++ b/tests/util.py @@ -92,6 +92,6 @@ def run_multi_part_engine(sim_config, include_ticks=False) -> tuple[MultiPartEng stats['tick_datas'].append(tick) for partition, engine in multi_engine.engines.items(): - stats['partitions'][partition] = engine.get_stats() + stats['partitions'][partition] = get_stats(engine) return multi_engine, stats -- GitLab