Skip to content

Enable AQUA SDK & CLI to Deploy Fine-Tuned LLMs in Multi-Model Deployment #1175

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 5 commits into
base: main
Choose a base branch
from

Conversation

elizjo
Copy link
Member

@elizjo elizjo commented May 5, 2025

This PR aims to add support for using fine-tuned models in a Multi-Model deployment.

When deploying a model group w/ a fine tuned model

  • added FT_MODEL parameter (output path in oci bucket for fine tuned model)
  • we extract FT_MODEL from the fine tune single model deployment. The model_path is assumed to be the base model for the fine tuned model.
{ "models": [ { "params": "--served-model-name Llama-3.2-11B-Vision --enforce-eager --max-num-seqs 16 --tensor-parallel-size 2 --max-model-len 16000",  "FT_MODEL" : "oci://model-path", "model_path": "Llama-3.2-11B-Vision", "model_task": "image-text-to-text"}, ... 

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 5, 2025
Copy link

github-actions bot commented May 5, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.14%

Copy link

github-actions bot commented May 5, 2025

📌 Cov diff with main:

Coverage-84%

📌 Overall coverage:

Coverage-58.63%

@@ -311,6 +312,12 @@ def create_multi(
# "Currently only service models are supported for multi model deployment."
# )

is_fine_tuned_model = Tags.AQUA_FINE_TUNED_MODEL_TAG in source_model.freeform_tags
Copy link
Member

Choose a reason for hiding this comment

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

Could you add some comment what we are doing here?

@@ -179,3 +185,42 @@ class CreateFineTuningDetails(Serializable):

class Config:
extra = "ignore"


def extract_base_model_ocid(aqua_model: DataScienceModel) -> Tuple[str, str]:
Copy link
Member

Choose a reason for hiding this comment

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

The name of the function is a bit confusing, it says that it extracts the base model ocid, but returns name and ocid.
Also I think it would be better to create model/utils.py module and move this logic there. Same for the set_finetune_env_var.

Copy link
Member Author

Choose a reason for hiding this comment

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

moved logic as suggested


env_var.update({"FT_MODEL": f"{fine_tune_output_path}"})

return env_var
Copy link
Member

Choose a reason for hiding this comment

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

looks like we are already modifying the original env_var, probably we don't need to return anything form this function?

Copy link
Member Author

Choose a reason for hiding this comment

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

changed, see new commit

@mrDzurb
Copy link
Member

mrDzurb commented May 6, 2025

Could you add more description in the PR? It would be also helpful if you put in the details how the new config will look like.

Copy link

github-actions bot commented May 7, 2025

📌 Cov diff with main:

Coverage-84%

📌 Overall coverage:

Coverage-58.63%

Copy link

github-actions bot commented May 9, 2025

📌 Cov diff with main:

Coverage-81%

📌 Overall coverage:

Coverage-58.63%

Copy link

github-actions bot commented May 9, 2025

📌 Cov diff with main:

Coverage-83%

📌 Overall coverage:

Coverage-58.62%

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.

2 participants