Skip to content

Conversation

@z7ye
Copy link

@z7ye z7ye commented Mar 29, 2023

Description

https://jira.oci.oraclecorp.com/browse/ODSC-39392

Testing Result

image

Int Test Result

You can check this pdf for testing results below.
inference-approach1.pdf

@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Mar 29, 2023
@z7ye z7ye marked this pull request as draft March 29, 2023 21:04
@z7ye z7ye changed the base branch from main to develop March 29, 2023 21:04
@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Mar 29, 2023
@z7ye z7ye marked this pull request as ready for review April 10, 2023 19:26
if model_name and model_version:
header['model-name'] = model_name
header['model-version'] = model_version
elif not model_version and not model_name:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are doing an XOR logic here, we can reduce this to -

elif bool(model_version) ^ bool(model_name): raise ValueError("`model_name` and `model_version` have to be provided together.") 
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! fixed.

infrastructure.web_concurrency
)
runtime.set_spec(runtime.CONST_ENV, environment_variables)
if hasattr(runtime, "inference_server") and runtime.inference_server and runtime.inference_server.lower() == "triton":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"triton" should be a constant

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use upper() instead then we can use the same constant (MODEL_DEPLOYMENT_INFERENCE_SERVER_TRITON) for the TRITON in the next line :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

... .with_model_uri(<model_id>)\
... .with_env({"key":"value", "key2":"value2"})\
... .with_inference_server("triton")
... deployment = ModelDeployment()\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be >>> remove the extra indentation here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good catch.

@z7ye z7ye requested a review from mayoor April 12, 2023 17:24
qiuosier
qiuosier previously approved these changes Apr 12, 2023
return req.body
else:
request_kwargs["auth"] = header.get("signer")
request_kwargs["auth"] = header.pop("signer")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we pop signer for dry_run as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

infrastructure.web_concurrency
)
runtime.set_spec(runtime.CONST_ENV, environment_variables)
if hasattr(runtime, "inference_server") and runtime.inference_server and runtime.inference_server.lower() == "triton":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use upper() instead then we can use the same constant (MODEL_DEPLOYMENT_INFERENCE_SERVER_TRITON) for the TRITON in the next line :)

)
runtime.set_spec(runtime.CONST_ENV, environment_variables)
if hasattr(runtime, "inference_server") and runtime.inference_server and runtime.inference_server.lower() == "triton":
environment_variables["CONTAINER_TYPE"] = "TRITON"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
environment_variables["CONTAINER_TYPE"] = "TRITON"
environment_variables["CONTAINER_TYPE"] = MODEL_DEPLOYMENT_INFERENCE_SERVER_TRITON
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@z7ye z7ye requested a review from qiuosier April 17, 2023 17:25
lu-ohai
lu-ohai previously approved these changes Apr 17, 2023
if model_name and model_version:
header['model-name'] = model_name
header['model-version'] = model_version
elif bool(model_version) ^ bool(model_name):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can rearrange this if/elif -

if bool(model_version) ^ bool(model_name): raise ValueError("`model_name` and `model_version` have to be provided together.") header['model-name'] = model_name header['model-version'] = model_version 
qiuosier
qiuosier previously approved these changes Apr 24, 2023
@z7ye z7ye dismissed stale reviews from qiuosier and lu-ohai via 9fdb1ff April 24, 2023 21:34
@github-actions
Copy link

📌 Cov diff with develop:

Coverage-54%

📌 Overall coverage:

Coverage-70.17%

@github-actions
Copy link

📌 Cov diff with develop:

Coverage-54%

📌 Overall coverage:

Coverage-70.19%

@z7ye z7ye requested review from mayoor and qiuosier April 24, 2023 23:41
@z7ye z7ye merged commit cd2c8f3 into develop Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

4 participants