-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/SK-1081 | Use stores in Combiner + ModelPredict #718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! But should we not call them "ModelPrediction" ?
hmm yes maybe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had some comments
fedn/network/clients/client.py
Outdated
def _process_inference_request(self, model_id: str, session_id: str, presigned_url: str): | ||
"""Process an inference request. | ||
def _process_prediction_request(self, model_id: str, session_id: str, presigned_url: str): | ||
"""Process an prediction request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a" predtiction
@@ -7,7 +7,7 @@ class ClientState(Enum): | |||
idle = 1 | |||
training = 2 | |||
validating = 3 | |||
inferencing = 4 | |||
predicting = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also add the ClientStateToString for "predicting"
fedn/network/clients/client.py
Outdated
|
||
try: | ||
_ = self.combinerStub.SendModelPrediction(prediction, metadata=self.metadata) | ||
status_type = fedn.StatusType.INFERENCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can change StatusType.INFERENCE to StatusType.MODEL_PREDICTION in fedn.proto
fedn/network/combiner/combiner.py
Outdated
:type model_id: str | ||
:param config: the model configuration to send to clients | ||
:type config: dict | ||
:param clients: the clients to send the request to | ||
:type clients: list | ||
|
||
""" | ||
clients = self._send_request_type(fedn.StatusType.INFERENCE, session_id, model_id, clients) | ||
clients = self._send_request_type(fedn.StatusType.INFERENCE, prediction_id, model_id, clients) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see other comment about StatusType
This pull request includes extensive changes to refactor the terminology from "inference" to "prediction" across the codebase, along starting using stores instead of mongostatestore.py in combiner. Adds ModelPredict message and SendModelPrediction method in proto to allow for Inference workflows. Also, keepalive arguments/options have been added for grpc channels and server. Below are the most important changes:
Breaking change:
endpoint /api/v1/infer -> /api/v1/predict
Terminology Refactor (Inference to Prediction)
.ci/tests/examples/prediction_test.py
: Updated log messages to reflect the change from "inference" to "prediction"..ci/tests/examples/run_prediction.sh
: Renamed script and updated curl commands and log messages to use "prediction" instead of "inference".examples/mnist-keras/client/predict.py
: Changed comments and method calls from "inference" to "prediction".fedn/network/api/v1/__init__.py
: Updated route imports to useprediction_routes
instead ofinference_routes
.fedn/network/api/v1/prediction_routes.py
: Added new prediction routes and removed the old inference routes.API Changes
fedn/network/clients/client.py
: Refactored methods to handle prediction requests instead of inference requests, including logging and status updates. [1] [2] [3] [4] [5] [6] [7]fedn/network/combiner/combiner.py
: Updated client handling and status management to reflect changes in prediction handling. [1] [2] [3]Minor Improvements and Bug Fixes
fedn/cli/status_cmd.py
: Cleaned up docstring formatting.fedn/network/api/v1/status_routes.py
: Added debug prints for typed headers and request arguments..github/workflows/integration-tests.yaml
: Updated commented-out lines to reflect the change from "inference" to "prediction".fedn/network/clients/state.py
: UpdatedClientState
enum to replace "inferencing" with "predicting".These changes ensure consistency in terminology and improve the clarity and functionality of the codebase.