-
Notifications
You must be signed in to change notification settings - Fork 64
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
Rename APIs for model serving framework #159
Conversation
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
Since some function names were also changed in ML Commons, should I also change the method names? |
Codecov Report
@@ Coverage Diff @@
## main #159 +/- ##
==========================================
+ Coverage 90.67% 90.76% +0.08%
==========================================
Files 36 36
Lines 3989 4027 +38
==========================================
+ Hits 3617 3655 +38
Misses 372 372
|
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
Can you join to the meeting? |
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
codecov/patch is failing. Please check if you can address this or not. If you think some line's not possible to cover may be we can check how to skip those lines for testing may be? |
I don't quite understand the error. It says some lines were not covered in tests, but I'm not sure what it means. For example, it says line 130 in ml_commons_client.py was not covered in tests. But it's a part of a method that was used in tests. Can you clarify? |
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
@@ -0,0 +1,6 @@ | |||
Register Pretrained Model | |||
================== |
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 need to cover ====== all the way to Model.
Load Model | ||
~~~~~~~~~~ | ||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
api/ml_commons_load_api | ||
|
||
Deploy Model |
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.
Same here.
|
||
# loading the model chunks from model index | ||
if deploy_model: | ||
self.deploy_model(model_id, wait_until_deployed=wait_until_deployed) |
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.
For line 129, it is saying coverage is missing.
Can you please check if there's any test method for register_model
where we provide deploy_model
= True?
I found one test method where deploy_model
= False. May be we need to add another test method for deploy_model
= True ?
@@ -138,53 +236,94 @@ def _send_model_info(self, model_meta_json: dict): | |||
if status["state"] != "CREATED": | |||
task_flag = True | |||
if not task_flag: | |||
raise TimeoutError("Uploading model timed out") | |||
raise TimeoutError("Model registration timed out") |
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.
I think this is hard to achieve in test. May be we can create a task and then set the end = 0 or low number so that task_flag
remains false and then code coverage will be achieved.
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.
TIMEOUT is a constant. To do this, we would need to add a TIMEOUT argument to the function. Should I do it?
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.
oh I see. Hmm, let's add TODO
in the code saying "need to add the test case later" for all these. We will revisit later.
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.
Sure. Sorry for missing the meeting. I'l add the comment.
print("Model was loaded into memory only partially") | ||
if model_state == "DEPLOYED": | ||
print("Model deployed successfully") | ||
elif model_state == "PARTIALLY_DEPLOYED": |
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.
This is hard to achieve. May be we can skip this for now.
else: | ||
raise Exception("Model load failed") | ||
raise Exception("Model deployment failed") |
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.
I think this can be covered in test, right?
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.
I'm not sure how I can force the deployment to fail
if model_state == "DEPLOYED": | ||
print("Model deployed successfully") | ||
elif model_state == "PARTIALLY_DEPLOYED": | ||
print("Model deployed only partially") |
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.
skip this for now.
|
||
API_BODY = {} | ||
if len(node_ids) > 0: | ||
API_BODY["node_ids"] = node_ids |
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.
skip this for now also.
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
@@ -6,7 +6,7 @@ | |||
# GitHub history for details. | |||
|
|||
ML_BASE_URI = "/_plugins/_ml" | |||
MODEL_UPLOAD_CHUNK_SIZE = 10_000_000 | |||
MODEL_REGISTER_CHUNK_SIZE = 10_000_000 |
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.
How about change to MODEL_CHUNK_SIZE_LIMIT
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.
Or to match the MODEL_MAX_SIZE
, another option is MODEL_CHUNK_MAX_SIZE
?
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.
Done
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com>
* renaming APIs for OS 2.7 Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * updating tests Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * linting Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * adding new methods and marking old ones as deprecated Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * fixing tests Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * updating documentation Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * partially fixing tests for codecov/patch Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * adding comments Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * change constant name Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * linting Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * fixing tests Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> --------- Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> (cherry picked from commit 7d01104)
* renaming APIs for OS 2.7 Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * updating tests Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * linting Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * adding new methods and marking old ones as deprecated Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * fixing tests Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * updating documentation Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * partially fixing tests for codecov/patch Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * adding comments Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * change constant name Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * linting Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> * fixing tests Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> --------- Signed-off-by: Alibi Zhenis <alibizhenis4@gmail.com> (cherry picked from commit 7d01104) Co-authored-by: Alibi Zhenis <92104549+AlibiZhenis@users.noreply.github.com>
Issues Resolved
Closes #122
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.