Skip to content

[WIP][AQUA] Group Model Deployment #1217

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ads/aqua/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def create_model_catalog(
model_taxonomy_metadata: Union[ModelTaxonomyMetadata, Dict],
compartment_id: str,
project_id: str,
freeform_tags: Dict = None,
defined_tags: Dict = None,
**kwargs,
) -> DataScienceModel:
Expand All @@ -303,6 +304,7 @@ def create_model_catalog(
.with_custom_metadata_list(model_custom_metadata)
.with_defined_metadata_list(model_taxonomy_metadata)
.with_provenance_metadata(ModelProvenanceMetadata(training_id=UNKNOWN))
.with_freeform_tags(**(freeform_tags or {}))
.with_defined_tags(
**(defined_tags or {})
) # Create defined tags when a model is created.
Expand Down
1 change: 1 addition & 0 deletions ads/aqua/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Tags(ExtendedEnum):
MODEL_FORMAT = "model_format"
MODEL_ARTIFACT_FILE = "model_file"
MULTIMODEL_TYPE_TAG = "aqua_multimodel"
AQUA_FINE_TUNE_MODEL_VERSION = "fine_tune_model_version"


class InferenceContainerType(ExtendedEnum):
Expand Down
1 change: 1 addition & 0 deletions ads/aqua/finetuning/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class FineTuneCustomMetadata(ExtendedEnum):
SERVICE_MODEL_ARTIFACT_LOCATION = "artifact_location"
SERVICE_MODEL_DEPLOYMENT_CONTAINER = "deployment-container"
SERVICE_MODEL_FINE_TUNE_CONTAINER = "finetune-container"
FINE_TUNE_INCLUDE_BASE_MODEL_ARTIFACT = "include_base_model_artifact"


class FineTuningRestrictedParams(ExtendedEnum):
Expand Down
5 changes: 5 additions & 0 deletions ads/aqua/finetuning/finetuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ def create(
"val_set_size": create_fine_tuning_details.validation_set_size,
"training_data": ft_dataset_path,
}
# needs to add 'fine_tune_model_version' tag when creating the ft model for the
# ft container to block merging base model artifact with ft model artifact.
ft_model_freeform_tags = {Tags.AQUA_FINE_TUNE_MODEL_VERSION: "v2"}

ft_model = self.create_model_catalog(
display_name=create_fine_tuning_details.ft_name,
Expand All @@ -314,6 +317,7 @@ def create(
compartment_id=target_compartment,
project_id=target_project,
model_by_reference=True,
freeform_tags=ft_model_freeform_tags,
defined_tags=create_fine_tuning_details.defined_tags,
)
defined_metadata_dict = {}
Expand Down Expand Up @@ -446,6 +450,7 @@ def create(

model_freeform_tags = {
**model_freeform_tags,
**(ft_model.freeform_tags or {}),
Tags.READY_TO_FINE_TUNE: "false",
Tags.AQUA_TAG: UNKNOWN,
Tags.AQUA_FINE_TUNED_MODEL_TAG: f"{source.id}#{source.display_name}",
Expand Down
Loading
Loading