-
Notifications
You must be signed in to change notification settings - Fork 44
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
[ODSC-63984] BYOC TEI deployment for embedding models #975
Conversation
docs/source/release_notes.rst
Outdated
------- | ||
Release date: October 18, 2024 | ||
|
||
* Introduced enhancements for AI Quick Actions. |
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 it would be nice to mention which enhancement.
1 similar comment
logging.info(f"CMD used for deploying {aqua_model.id} :{cmd_var}") | ||
else: | ||
# fetch image name from config | ||
container_image_uri = get_container_image(container_type=container_type_key) |
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.
Can we drop this if statement and instead follow this logic -
- get_container_image returns empty when the image is not found
- If it is empty, we check if
aqua_model.custom_metadata_list.get(AQUA_DEPLOYMENT_CONTAINER_URI_METADATA_NAME).value
has value. - If both are empty we return value error
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.
yes, dropped the TEI specific check and updated to the above logic.
ads/aqua/common/utils.py
Outdated
"""Helper functions that parses a list into a key-value dictionary. The list contains keys separated by the prefix | ||
'--' and the value of the key is the subsequent element. | ||
""" | ||
it = iter(cmd_list) |
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.
Nice
cmd_var_string = aqua_model.custom_metadata_list.get( | ||
AQUA_DEPLOYMENT_CONTAINER_CMD_VAR_METADATA_NAME | ||
).value | ||
default_cmd_var = cmd_var_string.split(",") |
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 use shlex.split for safety since this is a cmd string
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.
using shlex.split now instead of string split.
ads/aqua/common/utils.py
Outdated
""" | ||
it = iter(cmd_list) | ||
return { | ||
key: next(it, None) if not key.startswith("--") else next(it, None) |
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.
since the filter on the for loop already takes in key that starts --
, do we need to check it again. Also, both if and else, we return the same, so we dont need the if statement 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 reverted to the iterative method, this one made me think twice as well. Easier for readability for the future.
description=f"Inference container mapping for {model_name}", | ||
category="Other", | ||
) | ||
if ( |
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.
What will happen once we have SMC support? The user will see this warning unless they upgrade the sdk right? Let us get rid of this check. There is already check in the upstream code 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.
removed this check
ads/aqua/model/model.py
Outdated
f"Proceeding with model registration without the inference container URI for " | ||
f"{inference_container}. You can still add this configuration during model deployment." | ||
) | ||
else: |
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 add
if inference_container_uri:
metadata.add(
key=AQUA_DEPLOYMENT_CONTAINER_URI_METADATA_NAME,
value=inference_container_uri,
description=f"Inference container URI for {model_name}",
category="Other",
)
for the following part, can we have a generate only when the config.json does not any information about the TEI? When we support SMC, we might have backward compatible issue -
cmd_vars = generate_tei_cmd_var(os_path)
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.
now we add this to metadata only if the container image family is not in the SMC list.
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.
LGTM
Description
This update adds the ability to use BYOC for deploying an embedding model using custom TEI container. The changes include:
inference_container_uri
parameter.Registering a model
Deploying a model
With GPU shape
With GPU shape and CMD override
Validation for restricted keys for CMD
With CPU shape
Here, registered model already had the default container URI set to GPU container, but user can override using
container_image_uri
params.Unit Tests