diff --git a/doc/changelog.md b/doc/changelog.md index 752957bfdc..e666de03a2 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -49,6 +49,7 @@ Description - Implement workaround for Tensorflow that allows RedisAI to build with GCC-14 - Add instructions for installing SmartSim on PML's Scylla +- Fix typos in documentation Detailed Notes @@ -64,6 +65,7 @@ Detailed Notes have yet to be installed at a system-wide level. Scylla has its own entry in the documentation. ([SmartSim-PR733](https://github.com/CrayLabs/SmartSim/pull/733)) +- Fix typos in the `train_surrogate` tutorial documentation ### 0.8.0 diff --git a/doc/tutorials/ml_training/surrogate/README.md b/doc/tutorials/ml_training/surrogate/README.md index 823d27500b..ea2e8a68ff 100644 --- a/doc/tutorials/ml_training/surrogate/README.md +++ b/doc/tutorials/ml_training/surrogate/README.md @@ -3,6 +3,6 @@ In this example, a neural network is trained to act like a surrogate model and to solve a well-known physical problem, i.e. computing the steady state of heat diffusion. The training -dataset is constructed by running simualations *while* the model is being trained. +dataset is constructed by running simulations *while* the model is being trained. -The notebook also displays how the surrogate model prediction improves during training. \ No newline at end of file +The notebook also displays how the surrogate model prediction improves during training. diff --git a/doc/tutorials/ml_training/surrogate/train_surrogate.ipynb b/doc/tutorials/ml_training/surrogate/train_surrogate.ipynb index 5625b86b99..76a7b8c05f 100644 --- a/doc/tutorials/ml_training/surrogate/train_surrogate.ipynb +++ b/doc/tutorials/ml_training/surrogate/train_surrogate.ipynb @@ -15,7 +15,7 @@ "\n", "In this notebook, a neural network is trained to act like a surrogate model and to solve a\n", "well-known physical problem, i.e. computing the steady state of heat diffusion. The training\n", - "dataset is constructed by running simualations *while* the model is being trained.\n", + "dataset is constructed by running simulations *while* the model is being trained.\n", "\n", "## 2D Heat Diffusion and Steady State\n", "Throughout this notebook, the heat equation will be solved on the two-dimensional domain $[0,1]\\times[0,1]$, setting the initial temperature to 0 K, except\n", diff --git a/smartsim/_core/_install/platform.py b/smartsim/_core/_install/platform.py index bef13c6a0a..f49195498b 100644 --- a/smartsim/_core/_install/platform.py +++ b/smartsim/_core/_install/platform.py @@ -82,6 +82,8 @@ class Device(enum.Enum): CUDA12 = "cuda-12" ROCM5 = "rocm-5" ROCM6 = "rocm-6" + # TODO: check to see if this got overwritten/ gpu was removed + GPU = "gpu" @classmethod def from_str(cls, str_: str) -> "Device": diff --git a/smartsim/_core/entrypoints/dragon_client.py b/smartsim/_core/entrypoints/dragon_client.py index 2fb865346c..1dd62abebd 100644 --- a/smartsim/_core/entrypoints/dragon_client.py +++ b/smartsim/_core/entrypoints/dragon_client.py @@ -148,8 +148,8 @@ def execute_entrypoint(args: DragonClientEntrypointArgs) -> int: requests.append(DragonShutdownRequest(immediate=False, frontend_shutdown=True)) - # TODO: DragonConnector constructor needs a path - connector = DragonConnector() + # TODO: needs path + connector = DragonConnector(".") for request in requests: response = connector.send_request(request) diff --git a/smartsim/_core/mli/client/protoclient.py b/smartsim/_core/mli/client/protoclient.py index 46598a8171..1a38d42412 100644 --- a/smartsim/_core/mli/client/protoclient.py +++ b/smartsim/_core/mli/client/protoclient.py @@ -30,6 +30,7 @@ import dragon.channels from dragon.globalservices.api_setup import connect_to_infrastructure +# TODO: fix import for mpi4py.MPI, add in setup.py --> mpi4py try: from mpi4py import MPI # type: ignore[import-not-found] except Exception: diff --git a/smartsim/_core/mli/infrastructure/control/dragon_util.py b/smartsim/_core/mli/infrastructure/control/dragon_util.py index 95c3e60524..166d9ce3da 100644 --- a/smartsim/_core/mli/infrastructure/control/dragon_util.py +++ b/smartsim/_core/mli/infrastructure/control/dragon_util.py @@ -31,9 +31,6 @@ import typing as t import pytest -from smartsim.log import get_logger - -dragon = pytest.importorskip("dragon") # isort: off @@ -43,6 +40,9 @@ # isort: on +from smartsim.log import get_logger + +dragon = pytest.importorskip("dragon") logger = get_logger(__name__) diff --git a/smartsim/_core/shell/shell_launcher.py b/smartsim/_core/shell/shell_launcher.py index 530ac8a641..385b31fd0c 100644 --- a/smartsim/_core/shell/shell_launcher.py +++ b/smartsim/_core/shell/shell_launcher.py @@ -126,7 +126,8 @@ def __init__(self) -> None: """Initialize a new shell launcher.""" self._launched: dict[LaunchedJobID, sp.Popen[bytes]] = {} - def check_popen_inputs(self, shell_command: ShellLauncherCommand) -> None: + @staticmethod + def check_popen_inputs(shell_command: ShellLauncherCommand) -> None: """Validate that the contents of a shell command are valid. :param shell_command: The command to validate diff --git a/smartsim/launchable/mpmd_job.py b/smartsim/launchable/mpmd_job.py index de9545032b..2b59746c22 100644 --- a/smartsim/launchable/mpmd_job.py +++ b/smartsim/launchable/mpmd_job.py @@ -60,7 +60,7 @@ def _check_entity(mpmd_pairs: t.List[MPMDPair]) -> None: ret: SmartSimEntity | None = None for mpmd_pair in mpmd_pairs: if flag == 1: - if type(ret) == type(mpmd_pair.entity): + if isinstance(ret,type(mpmd_pair.entity)): flag = 0 else: raise SSUnsupportedError( @@ -110,11 +110,13 @@ def get_launch_steps(self) -> LaunchCommands: def __str__(self) -> str: # pragma: no cover """returns A user-readable string of a MPMD Job""" - fmt = lambda mpmd_pair: textwrap.dedent( - f"""\ - == MPMD Pair == - {mpmd_pair.entity} - {mpmd_pair.launch_settings} - """ - ) - return "\n".join(map(fmt, self.mpmd_pairs)) + + def _fmt(mpmd_pair: MPMDPair) -> str: + return textwrap.dedent( + f"""\ + == MPMD Pair == + {mpmd_pair.entity} + {mpmd_pair.launch_settings} + """ + ) + return "\n".join(map(_fmt, self.mpmd_pairs)) diff --git a/smartsim/settings/arguments/launch/alps.py b/smartsim/settings/arguments/launch/alps.py index 6aec8a8097..379c7002df 100644 --- a/smartsim/settings/arguments/launch/alps.py +++ b/smartsim/settings/arguments/launch/alps.py @@ -39,12 +39,12 @@ logger = get_logger(__name__) _as_aprun_command = make_shell_format_fn(run_command="aprun") -# pylint: disable=no-self-use @dispatch(with_format=_as_aprun_command, to_launcher=ShellLauncher) class AprunLaunchArguments(ShellLaunchArguments): - def _reserved_launch_args(self) -> set[str]: + @staticmethod + def _reserved_launch_args() -> set[str]: """Return reserved launch arguments. :returns: The set of reserved launcher arguments diff --git a/smartsim/settings/arguments/launch/lsf.py b/smartsim/settings/arguments/launch/lsf.py index 64447819cc..4a605de5d0 100644 --- a/smartsim/settings/arguments/launch/lsf.py +++ b/smartsim/settings/arguments/launch/lsf.py @@ -40,10 +40,6 @@ logger = get_logger(__name__) -# *************************************** -# TODO: Remove pylint disable after merge -# *************************************** -# pylint: disable=no-self-use def _as_jsrun_command( @@ -76,7 +72,8 @@ def launcher_str(self) -> str: """ return LauncherType.LSF.value - def _reserved_launch_args(self) -> set[str]: + @staticmethod + def _reserved_launch_args() -> set[str]: """Return reserved launch arguments. :returns: The set of reserved launcher arguments diff --git a/smartsim/settings/arguments/launch/mpi.py b/smartsim/settings/arguments/launch/mpi.py index 009bd3a462..d2f20331c7 100644 --- a/smartsim/settings/arguments/launch/mpi.py +++ b/smartsim/settings/arguments/launch/mpi.py @@ -38,10 +38,6 @@ logger = get_logger(__name__) -# *************************************** -# TODO: Remove pylint disable after merge -# *************************************** -# pylint: disable=no-self-use _as_mpirun_command = make_shell_format_fn("mpirun") _as_mpiexec_command = make_shell_format_fn("mpiexec") @@ -49,7 +45,8 @@ class _BaseMPILaunchArguments(ShellLaunchArguments): - def _reserved_launch_args(self) -> set[str]: + @staticmethod + def _reserved_launch_args() -> set[str]: """Return reserved launch arguments. :returns: The set of reserved launcher arguments diff --git a/smartsim/settings/arguments/launch/pals.py b/smartsim/settings/arguments/launch/pals.py index 829b414abc..a60485e5d5 100644 --- a/smartsim/settings/arguments/launch/pals.py +++ b/smartsim/settings/arguments/launch/pals.py @@ -39,10 +39,6 @@ logger = get_logger(__name__) _as_pals_command = make_shell_format_fn(run_command="mpiexec") -# *************************************** -# TODO: Remove pylint disable after merge -# *************************************** -# pylint: disable=no-self-use @dispatch(with_format=_as_pals_command, to_launcher=ShellLauncher) @@ -54,7 +50,8 @@ def launcher_str(self) -> str: """ return LauncherType.PALS.value - def _reserved_launch_args(self) -> set[str]: + @staticmethod + def _reserved_launch_args() -> set[str]: """Return reserved launch arguments. :returns: The set of reserved launcher arguments diff --git a/smartsim/settings/arguments/launch/slurm.py b/smartsim/settings/arguments/launch/slurm.py index 5e19f99caf..66f8e59c90 100644 --- a/smartsim/settings/arguments/launch/slurm.py +++ b/smartsim/settings/arguments/launch/slurm.py @@ -42,11 +42,6 @@ logger = get_logger(__name__) -# *************************************** -# TODO: Remove pylint disable after merge -# *************************************** -# pylint: disable=no-self-use - def _as_srun_command( args: ShellLaunchArguments, @@ -78,7 +73,8 @@ def launcher_str(self) -> str: """ return LauncherType.SLURM.value - def _reserved_launch_args(self) -> set[str]: + @staticmethod + def _reserved_launch_args() -> set[str]: """Return reserved launch arguments. :returns: The set of reserved launcher arguments @@ -316,7 +312,8 @@ def format_comma_sep_env_vars( return fmt_exported_env, compound_env - def _check_env_vars(self, env_vars: t.Mapping[str, str | None]) -> None: + @staticmethod + def _check_env_vars(env_vars: t.Mapping[str, str | None]) -> None: """Warn a user trying to set a variable which is set in the environment Given Slurm's env var precedence, trying to export a variable which is already diff --git a/smartsim/settings/sge_settings.py b/smartsim/settings/sge_settings.py index 757d167c64..dbe9ce3b7b 100644 --- a/smartsim/settings/sge_settings.py +++ b/smartsim/settings/sge_settings.py @@ -36,8 +36,9 @@ # *************************************** # TODO: Remove pylint disable after merge # *************************************** -# pylint: disable=no-self-use,no-member - +# pylint: disable=no-member +# TODO: 'BsubBatchArguments','SlurmBatchArguments', +# 'QsubBatchArguments' has no 'items' member class SgeQsubBatchSettings(BatchSettings): def __init__( @@ -94,12 +95,14 @@ def resources(self, resources: t.Dict[str, t.Union[str, int]]) -> None: self._sanity_check_resources(resources) self._resources = resources.copy() - def set_hostlist(self, host_list: t.Union[str, t.List[str]]) -> None: + @staticmethod + def set_hostlist(host_list: t.Union[str, t.List[str]]) -> None: raise LauncherUnsupportedFeature( "SGE does not support requesting specific hosts in batch jobs" ) - def set_queue(self, queue: str) -> None: + @staticmethod + def set_queue(queue: str) -> None: raise LauncherUnsupportedFeature("SGE does not support specifying queues") def set_shebang(self, shebang: str) -> None: @@ -124,7 +127,8 @@ def set_walltime(self, walltime: str) -> None: if walltime: self.set_resource("h_rt", walltime) - def set_nodes(self, num_nodes: t.Optional[int]) -> None: + @staticmethod + def set_nodes(num_nodes: t.Optional[int]) -> None: """Set the number of nodes, invalid for SGE :param nodes: Number of nodes, any integer other than 0 is invalid