diff --git a/doc/changelog.md b/doc/changelog.md index bfe42c804..004be997a 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -13,6 +13,7 @@ Jump to: Description +- Filenames conform to snake case - Update SmartSim environment variables using new naming convention - Refactor `exception_handler` - Add RequestDispatcher and the possibility of batching inference requests diff --git a/ex/high_throughput_inference/mli_driver.py b/ex/high_throughput_inference/mli_driver.py index 807a70b21..36f427937 100644 --- a/ex/high_throughput_inference/mli_driver.py +++ b/ex/high_throughput_inference/mli_driver.py @@ -13,7 +13,7 @@ NUM_RANKS = 4 NUM_WORKERS = 1 filedir = os.path.dirname(__file__) -worker_manager_script_name = os.path.join(filedir, "standalone_workermanager.py") +worker_manager_script_name = os.path.join(filedir, "standalone_worker_manager.py") app_script_name = os.path.join(filedir, "mock_app.py") model_name = os.path.join(filedir, f"resnet50.{DEVICE}.pt") diff --git a/ex/high_throughput_inference/mock_app.py b/ex/high_throughput_inference/mock_app.py index 517d18fb2..dcc52296e 100644 --- a/ex/high_throughput_inference/mock_app.py +++ b/ex/high_throughput_inference/mock_app.py @@ -43,7 +43,7 @@ import torch from mpi4py import MPI -from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import ( +from smartsim._core.mli.infrastructure.storage.dragon_feature_store import ( DragonFeatureStore, ) from smartsim._core.mli.message_handler import MessageHandler diff --git a/ex/high_throughput_inference/standalone_workermanager.py b/ex/high_throughput_inference/standalone_worker_manager.py similarity index 92% rename from ex/high_throughput_inference/standalone_workermanager.py rename to ex/high_throughput_inference/standalone_worker_manager.py index 0b8c61251..feb1af1ae 100644 --- a/ex/high_throughput_inference/standalone_workermanager.py +++ b/ex/high_throughput_inference/standalone_worker_manager.py @@ -58,17 +58,17 @@ from smartsim._core.entrypoints.service import Service from smartsim._core.mli.comm.channel.channel import CommChannelBase -from smartsim._core.mli.comm.channel.dragonchannel import DragonCommChannel -from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel -from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import ( +from smartsim._core.mli.comm.channel.dragon_channel import DragonCommChannel +from smartsim._core.mli.comm.channel.dragon_fli import DragonFLIChannel +from smartsim._core.mli.infrastructure.storage.dragon_feature_store import ( DragonFeatureStore, ) -from smartsim._core.mli.infrastructure.control.requestdispatcher import ( +from smartsim._core.mli.infrastructure.control.request_dispatcher import ( RequestDispatcher, ) -from smartsim._core.mli.infrastructure.control.workermanager import WorkerManager -from smartsim._core.mli.infrastructure.environmentloader import EnvironmentConfigLoader -from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import ( +from smartsim._core.mli.infrastructure.control.worker_manager import WorkerManager +from smartsim._core.mli.infrastructure.environment_loader import EnvironmentConfigLoader +from smartsim._core.mli.infrastructure.storage.dragon_feature_store import ( DragonFeatureStore, ) from smartsim._core.mli.infrastructure.worker.worker import MachineLearningWorkerBase diff --git a/smartsim/_core/mli/comm/channel/dragonchannel.py b/smartsim/_core/mli/comm/channel/dragon_channel.py similarity index 100% rename from smartsim/_core/mli/comm/channel/dragonchannel.py rename to smartsim/_core/mli/comm/channel/dragon_channel.py diff --git a/smartsim/_core/mli/comm/channel/dragonfli.py b/smartsim/_core/mli/comm/channel/dragon_fli.py similarity index 100% rename from smartsim/_core/mli/comm/channel/dragonfli.py rename to smartsim/_core/mli/comm/channel/dragon_fli.py diff --git a/smartsim/_core/mli/infrastructure/control/devicemanager.py b/smartsim/_core/mli/infrastructure/control/device_manager.py similarity index 98% rename from smartsim/_core/mli/infrastructure/control/devicemanager.py rename to smartsim/_core/mli/infrastructure/control/device_manager.py index 3570bd51e..54d58507e 100644 --- a/smartsim/_core/mli/infrastructure/control/devicemanager.py +++ b/smartsim/_core/mli/infrastructure/control/device_manager.py @@ -28,7 +28,7 @@ from contextlib import _GeneratorContextManager, contextmanager from .....log import get_logger -from ...infrastructure.storage.featurestore import FeatureStore +from ..storage.feature_store import FeatureStore from ..worker.worker import MachineLearningWorkerBase, RequestBatch logger = get_logger(__name__) diff --git a/smartsim/_core/mli/infrastructure/control/requestdispatcher.py b/smartsim/_core/mli/infrastructure/control/request_dispatcher.py similarity index 99% rename from smartsim/_core/mli/infrastructure/control/requestdispatcher.py rename to smartsim/_core/mli/infrastructure/control/request_dispatcher.py index d56912a8f..513dc5f63 100644 --- a/smartsim/_core/mli/infrastructure/control/requestdispatcher.py +++ b/smartsim/_core/mli/infrastructure/control/request_dispatcher.py @@ -47,9 +47,9 @@ from .....error import SmartSimError from .....log import get_logger from ....utils.timings import PerfTimer -from ...infrastructure.environmentloader import EnvironmentConfigLoader -from ...infrastructure.storage.featurestore import FeatureStore -from ...infrastructure.worker.worker import ( +from ..environment_loader import EnvironmentConfigLoader +from ..storage.feature_store import FeatureStore +from ..worker.worker import ( InferenceRequest, MachineLearningWorkerBase, ModelIdentifier, diff --git a/smartsim/_core/mli/infrastructure/control/workermanager.py b/smartsim/_core/mli/infrastructure/control/worker_manager.py similarity index 98% rename from smartsim/_core/mli/infrastructure/control/workermanager.py rename to smartsim/_core/mli/infrastructure/control/worker_manager.py index 54a245b81..d831a879a 100644 --- a/smartsim/_core/mli/infrastructure/control/workermanager.py +++ b/smartsim/_core/mli/infrastructure/control/worker_manager.py @@ -38,20 +38,20 @@ import typing as t from queue import Empty -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStore from .....log import get_logger from ....entrypoints.service import Service from ....utils.timings import PerfTimer -from ...infrastructure.environmentloader import EnvironmentConfigLoader -from ...infrastructure.worker.worker import ( +from ...message_handler import MessageHandler +from ..environment_loader import EnvironmentConfigLoader +from ..worker.worker import ( InferenceReply, LoadModelResult, MachineLearningWorkerBase, RequestBatch, ) -from ...message_handler import MessageHandler -from .devicemanager import DeviceManager, WorkerDevice +from .device_manager import DeviceManager, WorkerDevice from .error_handling import build_failure_reply, exception_handler if t.TYPE_CHECKING: diff --git a/smartsim/_core/mli/infrastructure/environmentloader.py b/smartsim/_core/mli/infrastructure/environment_loader.py similarity index 98% rename from smartsim/_core/mli/infrastructure/environmentloader.py rename to smartsim/_core/mli/infrastructure/environment_loader.py index 99202ef2e..c8b158a5a 100644 --- a/smartsim/_core/mli/infrastructure/environmentloader.py +++ b/smartsim/_core/mli/infrastructure/environment_loader.py @@ -28,7 +28,7 @@ import typing as t from smartsim._core.mli.comm.channel.channel import CommChannelBase -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStore from smartsim.log import get_logger logger = get_logger(__name__) diff --git a/smartsim/_core/mli/infrastructure/storage/dragonfeaturestore.py b/smartsim/_core/mli/infrastructure/storage/dragon_feature_store.py similarity index 98% rename from smartsim/_core/mli/infrastructure/storage/dragonfeaturestore.py rename to smartsim/_core/mli/infrastructure/storage/dragon_feature_store.py index e89abcd2a..aee4aac52 100644 --- a/smartsim/_core/mli/infrastructure/storage/dragonfeaturestore.py +++ b/smartsim/_core/mli/infrastructure/storage/dragon_feature_store.py @@ -32,7 +32,7 @@ # isort: on -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStore from smartsim.error import SmartSimError from smartsim.log import get_logger diff --git a/smartsim/_core/mli/infrastructure/storage/featurestore.py b/smartsim/_core/mli/infrastructure/storage/feature_store.py similarity index 100% rename from smartsim/_core/mli/infrastructure/storage/featurestore.py rename to smartsim/_core/mli/infrastructure/storage/feature_store.py diff --git a/smartsim/_core/mli/infrastructure/worker/worker.py b/smartsim/_core/mli/infrastructure/worker/worker.py index 25e4dc49f..41de23b56 100644 --- a/smartsim/_core/mli/infrastructure/worker/worker.py +++ b/smartsim/_core/mli/infrastructure/worker/worker.py @@ -37,9 +37,9 @@ from .....error import SmartSimError from .....log import get_logger from ...comm.channel.channel import CommChannelBase -from ...infrastructure.storage.featurestore import FeatureStore, FeatureStoreKey from ...message_handler import MessageHandler from ...mli_schemas.model.model_capnp import Model +from ..storage.feature_store import FeatureStore, FeatureStoreKey if t.TYPE_CHECKING: from smartsim._core.mli.mli_schemas.response.response_capnp import Status diff --git a/tests/dragon/featurestore.py b/tests/dragon/feature_store.py similarity index 98% rename from tests/dragon/featurestore.py rename to tests/dragon/feature_store.py index d06035fd7..178b675e6 100644 --- a/tests/dragon/featurestore.py +++ b/tests/dragon/feature_store.py @@ -28,7 +28,7 @@ import typing as t import smartsim.error as sse -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStore from smartsim.log import get_logger logger = get_logger(__name__) diff --git a/tests/dragon/test_core_machine_learning_worker.py b/tests/dragon/test_core_machine_learning_worker.py index 231a97124..ed9ac625c 100644 --- a/tests/dragon/test_core_machine_learning_worker.py +++ b/tests/dragon/test_core_machine_learning_worker.py @@ -34,7 +34,7 @@ import torch import smartsim.error as sse -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStoreKey +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStoreKey from smartsim._core.mli.infrastructure.worker.worker import ( InferenceRequest, MachineLearningWorkerCore, @@ -44,7 +44,7 @@ ) from smartsim._core.utils import installed_redisai_backends -from .featurestore import FileSystemFeatureStore, MemoryFeatureStore +from .feature_store import FileSystemFeatureStore, MemoryFeatureStore # The tests in this file belong to the dragon group pytestmark = pytest.mark.dragon diff --git a/tests/dragon/test_device_manager.py b/tests/dragon/test_device_manager.py index 8edeb60fb..c58879cb6 100644 --- a/tests/dragon/test_device_manager.py +++ b/tests/dragon/test_device_manager.py @@ -30,11 +30,11 @@ dragon = pytest.importorskip("dragon") -from smartsim._core.mli.infrastructure.control.devicemanager import ( +from smartsim._core.mli.infrastructure.control.device_manager import ( DeviceManager, WorkerDevice, ) -from smartsim._core.mli.infrastructure.storage.featurestore import ( +from smartsim._core.mli.infrastructure.storage.feature_store import ( FeatureStore, FeatureStoreKey, ) diff --git a/tests/dragon/test_environment_loader.py b/tests/dragon/test_environment_loader.py index 8f2716488..c3331336e 100644 --- a/tests/dragon/test_environment_loader.py +++ b/tests/dragon/test_environment_loader.py @@ -33,10 +33,10 @@ from dragon.data.ddict.ddict import DDict from dragon.fli import DragonFLIError, FLInterface -from smartsim._core.mli.comm.channel.dragonchannel import DragonCommChannel -from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel -from smartsim._core.mli.infrastructure.environmentloader import EnvironmentConfigLoader -from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import ( +from smartsim._core.mli.comm.channel.dragon_channel import DragonCommChannel +from smartsim._core.mli.comm.channel.dragon_fli import DragonFLIChannel +from smartsim._core.mli.infrastructure.environment_loader import EnvironmentConfigLoader +from smartsim._core.mli.infrastructure.storage.dragon_feature_store import ( DragonFeatureStore, ) diff --git a/tests/dragon/test_error_handling.py b/tests/dragon/test_error_handling.py index 0e737101f..7f823a1c4 100644 --- a/tests/dragon/test_error_handling.py +++ b/tests/dragon/test_error_handling.py @@ -38,20 +38,20 @@ from dragon.fli import FLInterface from dragon.mpbridge.queues import DragonQueue -from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel -from smartsim._core.mli.infrastructure.control.devicemanager import WorkerDevice -from smartsim._core.mli.infrastructure.control.requestdispatcher import ( +from smartsim._core.mli.comm.channel.dragon_fli import DragonFLIChannel +from smartsim._core.mli.infrastructure.control.device_manager import WorkerDevice +from smartsim._core.mli.infrastructure.control.request_dispatcher import ( RequestDispatcher, ) -from smartsim._core.mli.infrastructure.control.workermanager import ( +from smartsim._core.mli.infrastructure.control.worker_manager import ( WorkerManager, exception_handler, ) -from smartsim._core.mli.infrastructure.environmentloader import EnvironmentConfigLoader -from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import ( +from smartsim._core.mli.infrastructure.environment_loader import EnvironmentConfigLoader +from smartsim._core.mli.infrastructure.storage.dragon_feature_store import ( DragonFeatureStore, ) -from smartsim._core.mli.infrastructure.storage.featurestore import ( +from smartsim._core.mli.infrastructure.storage.feature_store import ( FeatureStore, FeatureStoreKey, ) @@ -314,12 +314,12 @@ def mock_exception_handler(exc, reply_channel, failure_message): return exception_handler(exc, mock_reply_channel, failure_message) monkeypatch.setattr( - "smartsim._core.mli.infrastructure.control.workermanager.exception_handler", + "smartsim._core.mli.infrastructure.control.worker_manager.exception_handler", mock_exception_handler, ) monkeypatch.setattr( - "smartsim._core.mli.infrastructure.control.requestdispatcher.exception_handler", + "smartsim._core.mli.infrastructure.control.request_dispatcher.exception_handler", mock_exception_handler, ) diff --git a/tests/dragon/test_reply_building.py b/tests/dragon/test_reply_building.py index 5f179bbae..7a8e63780 100644 --- a/tests/dragon/test_reply_building.py +++ b/tests/dragon/test_reply_building.py @@ -30,7 +30,7 @@ dragon = pytest.importorskip("dragon") -from smartsim._core.mli.infrastructure.control.workermanager import build_failure_reply +from smartsim._core.mli.infrastructure.control.worker_manager import build_failure_reply from smartsim._core.mli.infrastructure.worker.worker import InferenceReply if t.TYPE_CHECKING: diff --git a/tests/dragon/test_request_dispatcher.py b/tests/dragon/test_request_dispatcher.py index c8d97dd7e..eeb8cd238 100644 --- a/tests/dragon/test_request_dispatcher.py +++ b/tests/dragon/test_request_dispatcher.py @@ -61,24 +61,24 @@ from smartsim._core.entrypoints.service import Service from smartsim._core.mli.comm.channel.channel import CommChannelBase -from smartsim._core.mli.comm.channel.dragonchannel import DragonCommChannel -from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel -from smartsim._core.mli.infrastructure.control.requestdispatcher import ( +from smartsim._core.mli.comm.channel.dragon_channel import DragonCommChannel +from smartsim._core.mli.comm.channel.dragon_fli import DragonFLIChannel +from smartsim._core.mli.infrastructure.control.request_dispatcher import ( RequestBatch, RequestDispatcher, ) -from smartsim._core.mli.infrastructure.control.workermanager import ( +from smartsim._core.mli.infrastructure.control.worker_manager import ( EnvironmentConfigLoader, ) -from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import ( +from smartsim._core.mli.infrastructure.storage.dragon_feature_store import ( DragonFeatureStore, ) -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStore from smartsim._core.mli.infrastructure.worker.torch_worker import TorchWorker from smartsim._core.mli.message_handler import MessageHandler from smartsim.log import get_logger -from .featurestore import FileSystemFeatureStore +from .feature_store import FileSystemFeatureStore from .utils.channel import FileSystemCommChannel logger = get_logger(__name__) diff --git a/tests/dragon/test_torch_worker.py b/tests/dragon/test_torch_worker.py index 88e800240..9a5ed6309 100644 --- a/tests/dragon/test_torch_worker.py +++ b/tests/dragon/test_torch_worker.py @@ -37,7 +37,7 @@ from torch import nn from torch.nn import functional as F -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStoreKey +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStoreKey from smartsim._core.mli.infrastructure.worker.torch_worker import TorchWorker from smartsim._core.mli.infrastructure.worker.worker import ( ExecuteResult, diff --git a/tests/dragon/test_worker_manager.py b/tests/dragon/test_worker_manager.py index a33416425..1ebc512a5 100644 --- a/tests/dragon/test_worker_manager.py +++ b/tests/dragon/test_worker_manager.py @@ -49,20 +49,20 @@ from dragon.mpbridge.queues import DragonQueue from smartsim._core.mli.comm.channel.channel import CommChannelBase -from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel -from smartsim._core.mli.infrastructure.control.workermanager import ( +from smartsim._core.mli.comm.channel.dragon_fli import DragonFLIChannel +from smartsim._core.mli.infrastructure.control.worker_manager import ( EnvironmentConfigLoader, WorkerManager, ) -from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import ( +from smartsim._core.mli.infrastructure.storage.dragon_feature_store import ( DragonFeatureStore, ) -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStore from smartsim._core.mli.infrastructure.worker.torch_worker import TorchWorker from smartsim._core.mli.message_handler import MessageHandler from smartsim.log import get_logger -from .featurestore import FileSystemFeatureStore +from .feature_store import FileSystemFeatureStore from .utils.channel import FileSystemCommChannel logger = get_logger(__name__) diff --git a/tests/mli/featurestore.py b/tests/mli/feature_store.py similarity index 98% rename from tests/mli/featurestore.py rename to tests/mli/feature_store.py index de748ae6e..7ecc01814 100644 --- a/tests/mli/featurestore.py +++ b/tests/mli/feature_store.py @@ -28,7 +28,7 @@ import typing as t import smartsim.error as sse -from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore +from smartsim._core.mli.infrastructure.storage.feature_store import FeatureStore from smartsim.log import get_logger logger = get_logger(__name__)