Skip to content

Conversation

@kumar-shivam-ranjan
Copy link
Contributor

@kumar-shivam-ranjan kumar-shivam-ranjan commented Dec 19, 2024

This PR intends to update EDIT model handler for editing registered model config in AQUA.
The edit feature is available for registered unverified model.
This will allow user to edit the following config for models in AQUA after the model is registered:

  1. Deployment container
  2. Deployment container URI for TEI (Text Embedding inference container)
  3. Task information of the model
  4. Finetuning config
curl --location --request PUT 'http://localhost:8888/aqua/model/ocid1.datasciencemodel.oc1.iad.xxxxx' \
--header 'Content-Type: application/json' \
--data '{
    "inference_container": "odsc-tei-serving",
    "inference_container_uri": "iad.ocir.io/ociodscdev/text-embeddings-inference:cpu-1.5",
    "task": "feature-extraction"
}'

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 19, 2024
@github-actions
Copy link

📌 Cov diff with main:

Coverage-60%

📌 Overall coverage:

Coverage-58.48%

@github-actions
Copy link

📌 Cov diff with main:

Coverage-30%

📌 Overall coverage:

Coverage-58.48%

if (
inference_container is not None
and inference_container not in inference_containers
and inference_container
Copy link
Member

Choose a reason for hiding this comment

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

To avoid hardcoding, would it be better to move AQUA_TEI_CONTAINER_FAMILY from InferenceContainerTypeFamily to a new enum CustomInferenceContainerTypeFamily(str, metaclass=ExtendedEnumMeta)? That way the final inference_containers list can be inference_containers.append(CustomInferenceContainerTypeFamily.values()).

replace=True,
)
if (
inference_container
Copy link
Member

Choose a reason for hiding this comment

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

this can be replaced with inference_container in CustomInferenceContainerTypeFamily.values()

)
else:
raise AquaRuntimeError(
f"Failed to edit model:{id}. Inference container URI can be edited only with TEI container."
Copy link
Member

Choose a reason for hiding this comment

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

f"Inference container URI can be edited only with container values: {CustomInferenceContainerTypeFamily.values()}".

@github-actions
Copy link

📌 Cov diff with main:

Coverage-38%

📌 Overall coverage:

Coverage-57.24%


inference_container = input_data.get("inference_container")
inference_container_uri = input_data.get("inference_container_uri")
inference_containers = AquaModelApp.list_valid_inference_containers()
Copy link
Member

Choose a reason for hiding this comment

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

Will it always return a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes , either an empty list or list of valid containers from container_index.json stored in OSS bucket

f"Failed to delete model:{model_id}. Only registered models or finetuned model can be deleted."
)

@telemetry(entry_point="plugin=model&action=delete", name="aqua")
Copy link
Member

Choose a reason for hiding this comment

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

Why in telemetry we say delete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Thanks

inference_container: str.
The inference container family name
inference_container_uri: str
The inference container uri for embedding models
Copy link
Member

Choose a reason for hiding this comment

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

s it only for embedding models?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes as per now , we accept inference container URI for embedding models only

)
if (
inference_container
in CustomInferenceContainerTypeFamily.values()
Copy link
Member

Choose a reason for hiding this comment

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

ExtendedEnumMeta implement the __contains__ method, that means we can do something like this:

inference_container in CustomInferenceContainerTypeFamily

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

"Inference container URI must be provided."
)
else:
custom_metadata_list.add(
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need to store this info in metadata? Can't it be extracted from MD?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This metadata contains deployment container. Via edit feature , user can edit/change deployment container as well. Hence , adding updated container to metadata.

Copy link
Member

Choose a reason for hiding this comment

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

However user can update deployment from console, and in this case the container stored on the model level will not match a real one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes but source of truth here should be model right , not the model deployment.
User can create multiple model deployments from a single model. What we are trying to do here is changing/updating the model config.
What if user registered a model for a particular deployment container. Now , they due to some reason want to change the deployment container config of the model.

@github-actions
Copy link

📌 Cov diff with main:

Coverage-42%

📌 Overall coverage:

Coverage-57.24%

@kumar-shivam-ranjan kumar-shivam-ranjan merged commit 410dbe0 into main Jan 29, 2025
19 of 20 checks passed
@github-actions
Copy link

📌 Cov diff with main:

No lines with coverage information in this diff.

📌 Overall coverage:

Coverage-56.70%

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants