Skip to content

Commit

Permalink
Merge branch 'main' of github.com:oracle/accelerated-data-science int…
Browse files Browse the repository at this point in the history
…o feature/ms_backup_retention
  • Loading branch information
iamishaan committed Oct 25, 2024
2 parents 3d092ee + 611b9d4 commit b5b5ecf
Show file tree
Hide file tree
Showing 63 changed files with 17,550 additions and 895 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-forecast-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-operators-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ rrcf
* Source code: https://github.com/kLabUM/rrcf
* Project home: https://github.com/kLabUM/rrcf

Merlion
* Copyright 2021 Salesforce.com Inc
* License: BSD-3 Clause License
* Source code: https://github.com/salesforce/Merlion
* Project Home: https://github.com/salesforce/Merlion

=============================== Licenses ===============================
------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion ads/aqua/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,6 @@ def list_hf_models(query: str) -> List[str]:
try:
models = HfApi().list_models(
model_name=query,
task="text-generation",
sort="downloads",
direction=-1,
limit=20,
Expand Down
1 change: 1 addition & 0 deletions ads/aqua/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def get_finetuning_config_defaults():
"VM.GPU.A10.2": {"batch_size": 1, "replica": "1-10"},
"BM.GPU.A10.4": {"batch_size": 1, "replica": 1},
"BM.GPU4.8": {"batch_size": 4, "replica": 1},
"BM.GPU.L40S-NC.4": {"batch_size": 4, "replica": 1},
"BM.GPU.A100-v2.8": {"batch_size": 6, "replica": 1},
"BM.GPU.H100.8": {"batch_size": 6, "replica": 1},
}
Expand Down
1 change: 1 addition & 0 deletions ads/aqua/config/deployment_config_defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"VM.GPU.A10.2",
"BM.GPU.A10.4",
"BM.GPU4.8",
"BM.GPU.L40S-NC.4",
"BM.GPU.A100-v2.8",
"BM.GPU.H100.8",
"VM.Standard.A1.Flex"
Expand Down
1 change: 1 addition & 0 deletions ads/aqua/config/evaluation/evaluation_service_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def search_shapes(

class Config:
extra = "ignore"
protected_namespaces = ()


class EvaluationServiceConfig(Serializable):
Expand Down
1 change: 1 addition & 0 deletions ads/aqua/config/resource_limit_names.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"BM.GPU.A10.4": "ds-gpu-a10-count",
"BM.GPU.A100-v2.8": "ds-gpu-a100-v2-count",
"BM.GPU.H100.8": "ds-gpu-h100-count",
"BM.GPU.L40S-NC.4": "ds-gpu-l40s-nc-count",
"BM.GPU4.8": "ds-gpu4-count",
"VM.GPU.A10.1": "ds-gpu-a10-count",
"VM.GPU.A10.2": "ds-gpu-a10-count"
Expand Down
2 changes: 2 additions & 0 deletions ads/aqua/extension/deployment_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def post(self, *args, **kwargs):
ocpus = input_data.get("ocpus")
memory_in_gbs = input_data.get("memory_in_gbs")
model_file = input_data.get("model_file")
private_endpoint_id = input_data.get("private_endpoint_id")

self.finish(
AquaDeploymentApp().create(
Expand All @@ -124,6 +125,7 @@ def post(self, *args, **kwargs):
ocpus=ocpus,
memory_in_gbs=memory_in_gbs,
model_file=model_file,
private_endpoint_id=private_endpoint_id,
)
)

Expand Down
38 changes: 17 additions & 21 deletions ads/aqua/extension/model_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from ads.aqua.extension.base_handler import AquaAPIhandler
from ads.aqua.extension.errors import Errors
from ads.aqua.model import AquaModelApp
from ads.aqua.model.constants import ModelTask
from ads.aqua.model.entities import AquaModelSummary, HFModelSummary
from ads.aqua.ui import ModelFormat

Expand Down Expand Up @@ -68,7 +67,7 @@ def read(self, model_id):
return self.finish(AquaModelApp().get(model_id))

@handle_exceptions
def delete(self):
def delete(self, id=""):
"""Handles DELETE request for clearing cache"""
url_parse = urlparse(self.request.path)
paths = url_parse.path.strip("/")
Expand Down Expand Up @@ -177,10 +176,8 @@ def _find_matching_aqua_model(model_id: str) -> Optional[AquaModelSummary]:

return None



@handle_exceptions
def get(self,*args, **kwargs):
def get(self, *args, **kwargs):
"""
Finds a list of matching models from hugging face based on query string provided from users.
Expand All @@ -194,13 +191,11 @@ def get(self,*args, **kwargs):
Returns the matching model ids string
"""

query=self.get_argument("query",default=None)
query = self.get_argument("query", default=None)
if not query:
raise HTTPError(400,Errors.MISSING_REQUIRED_PARAMETER.format("query"))
models=list_hf_models(query)
return self.finish({"models":models})


raise HTTPError(400, Errors.MISSING_REQUIRED_PARAMETER.format("query"))
models = list_hf_models(query)
return self.finish({"models": models})

@handle_exceptions
def post(self, *args, **kwargs):
Expand Down Expand Up @@ -234,16 +229,17 @@ def post(self, *args, **kwargs):
"Please verify the model's status on the Hugging Face Model Hub or select a different model."
)

# Check pipeline_tag, it should be `text-generation`
if (
not hf_model_info.pipeline_tag
or hf_model_info.pipeline_tag.lower() != ModelTask.TEXT_GENERATION
):
raise AquaRuntimeError(
f"Unsupported pipeline tag for the chosen model: '{hf_model_info.pipeline_tag}'. "
f"AQUA currently supports the following tasks only: {', '.join(ModelTask.values())}. "
"Please select a model with a compatible pipeline tag."
)
# Commented the validation below to let users to register any model type.
# # Check pipeline_tag, it should be `text-generation`
# if not (
# hf_model_info.pipeline_tag
# and hf_model_info.pipeline_tag.lower() in ModelTask
# ):
# raise AquaRuntimeError(
# f"Unsupported pipeline tag for the chosen model: '{hf_model_info.pipeline_tag}'. "
# f"AQUA currently supports the following tasks only: {', '.join(ModelTask.values())}. "
# "Please select a model with a compatible pipeline tag."
# )

# Check if it is a service/verified model
aqua_model_info: AquaModelSummary = self._find_matching_aqua_model(
Expand Down
4 changes: 3 additions & 1 deletion ads/aqua/model/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2024 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/

Expand All @@ -9,6 +8,7 @@
This module contains constants/enums used in Aqua Model.
"""

from ads.common.extended_enum import ExtendedEnumMeta


Expand All @@ -21,6 +21,8 @@ class ModelCustomMetadataFields(str, metaclass=ExtendedEnumMeta):

class ModelTask(str, metaclass=ExtendedEnumMeta):
TEXT_GENERATION = "text-generation"
IMAGE_TEXT_TO_TEXT = "image-text-to-text"
IMAGE_TO_TEXT = "image-to-text"


class FineTuningMetricCategories(str, metaclass=ExtendedEnumMeta):
Expand Down
Loading

0 comments on commit b5b5ecf

Please sign in to comment.