Skip to content

Commit

Permalink
Updating model versions (#2244)
Browse files Browse the repository at this point in the history
* Updating model versions

* Rename ft pipeline names in notebooks

* updating the model version and the registry

* changing the job name

---------

Co-authored-by: Pavan Manoj Jonnalagadda <pavanmanojj@microsoft.com>
  • Loading branch information
skanakamedal and jpmann committed May 4, 2023
1 parent 6df9623 commit a039fd2
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:

# specify the foundation model available in the azureml system registry
mlflow_model_path:
path: azureml://registries/azureml-preview/models/bert-based-uncased/versions/3
path: azureml://registries/azureml/models/bert-based-uncased/versions/3
# huggingface_id: 'bert-base-uncased' # if you want to use a huggingface model, uncomment this line and comment the above line

# map the dataset files to parameters
Expand Down Expand Up @@ -60,10 +60,9 @@ settings:
force_rerun: true

jobs:
extractive_qna_finetune_job:
question_answering_pipeline:
type: pipeline
# component: azureml://registries/azureml-preview/components/question_answering_pipeline/versions/0.0.3
component: azureml://registries/azureml-preview/components/question_answering_pipeline/labels/latest
component: azureml://registries/azureml/components/question_answering_pipeline/labels/latest
inputs:
mlflow_model_path: ${{parent.inputs.mlflow_model_path}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gpus_per_node=2
# This is the foundation model for finetuning
model_name="bert-base-uncased"
# using the latest version of the model - not working yet
model_version=1
model_version=3

version=$(date +%s)
finetuned_model_name=$model_name"-extractive-qna"
Expand Down Expand Up @@ -118,7 +118,7 @@ fi
# need to switch to using latest version for model, currently blocked with a bug.
# submit finetuning job
parent_job_name=$( az ml job create --file ./extractive-qa-pipeline.yml $workspace_info --query name -o tsv --set \
jobs.extractive_qna_finetune_job.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
jobs.question_answering_pipeline.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
inputs.compute_model_import=$compute_cluster \
inputs.compute_preprocess=$compute_cluster \
inputs.compute_finetune=$compute_cluster \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:

# specify the foundation model available in the azureml system registry
mlflow_model_path:
path: azureml://registries/azureml-preview/models/t5-small/versions/4
path: azureml://registries/azureml/models/t5-small/versions/3
# huggingface_id: 't5-small' # if you want to use a huggingface model, uncomment this line and comment the above line

# map the dataset files to parameters
Expand Down Expand Up @@ -50,10 +50,9 @@ settings:
force_rerun: true

jobs:
news_summary_finetune_job:
summarization_pipeline:
type: pipeline
# component: azureml://registries/azureml-preview/components/summarization_pipeline/versions/0.0.3
component: azureml://registries/azureml-preview/components/summarization_pipeline/labels/latest
component: azureml://registries/azureml/components/summarization_pipeline/labels/latest
inputs:
mlflow_model_path: ${{parent.inputs.mlflow_model_path}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gpus_per_node=2
# This is the foundation model for finetuning
model_name="t5-small"
# using the latest version of the model - not working yet
model_version=1
model_version=3

version=$(date +%s)
finetuned_model_name=$model_name"-news-summary"
Expand Down Expand Up @@ -107,7 +107,7 @@ fi
# need to switch to using latest version for model, currently blocked with a bug.
# submit finetuning job
parent_job_name=$( az ml job create --file ./news-summary-pipeline.yml $workspace_info --query name -o tsv --set \
jobs.news_summary_finetune_job.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
jobs.summarization_pipeline.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
inputs.compute_model_import=$compute_cluster \
inputs.compute_preprocess=$compute_cluster \
inputs.compute_finetune=$compute_cluster \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:

# specify the foundation model available in the azureml system registry
mlflow_model_path:
path: azureml://registries/azureml-preview/models/bert-based-uncased/versions/3
path: azureml://registries/azureml/models/bert-based-uncased/versions/3
# huggingface_id: 'bert-base-uncased' # if you want to use a huggingface model, uncomment this line and comment the above line

# map the dataset files to parameters
Expand Down Expand Up @@ -48,10 +48,9 @@ settings:
force_rerun: true

jobs:
emotion_detection_finetune_job:
text_classification_pipeline:
type: pipeline
# component: azureml://registries/azureml-preview/components/text_classification_pipeline/versions/0.0.3
component: azureml://registries/azureml-preview/components/text_classification_pipeline/labels/latest
component: azureml://registries/azureml/components/text_classification_pipeline/labels/latest
inputs:
mlflow_model_path: ${{parent.inputs.mlflow_model_path}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gpus_per_node=2
# This is the foundation model for finetuning
model_name="bert-base-uncased"
# using the latest version of the model - not working yet
model_version=1
model_version=3

version=$(date +%s)
finetuned_model_name=$model_name"-emotion-detection"
Expand Down Expand Up @@ -105,7 +105,7 @@ fi
# need to switch to using latest version for model, currently blocked with a bug.
# submit finetuning job
parent_job_name=$( az ml job create --file ./emotion-detection-pipeline.yml $workspace_info --query name -o tsv --set \
jobs.emotion_detection_finetune_job.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
jobs.text_classification_pipeline.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
inputs.compute_model_import=$compute_cluster \
inputs.compute_preprocess=$compute_cluster \
inputs.compute_finetune=$compute_cluster \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:

# specify the foundation model available in the azureml system registry
mlflow_model_path:
path: azureml://registries/azureml-preview/models/bert-based-uncased/versions/3
path: azureml://registries/azureml/models/bert-based-uncased/versions/3
# huggingface_id: 'bert-base-uncased' # if you want to use a huggingface model, uncomment this line and comment the above line

# map the dataset files to parameters
Expand Down Expand Up @@ -48,10 +48,9 @@ settings:
force_rerun: true

jobs:
ner_finetune_job:
token_classification_pipeline:
type: pipeline
# component: azureml://registries/azureml-preview/components/token_classification_pipeline/versions/0.0.3
component: azureml://registries/azureml-preview/components/token_classification_pipeline/labels/latest
component: azureml://registries/azureml/components/token_classification_pipeline/labels/latest
inputs:
mlflow_model_path: ${{parent.inputs.mlflow_model_path}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gpus_per_node=2
# This is the foundation model for finetuning
model_name="bert-base-uncased"
# using the latest version of the model - not working yet
model_version=1
model_version=3

version=$(date +%s)
finetuned_model_name=$model_name"-ner"
Expand Down Expand Up @@ -105,7 +105,7 @@ fi
# need to switch to using latest version for model, currently blocked with a bug.
# submit finetuning job
parent_job_name=$( az ml job create --file ./token-classification-pipeline.yml $workspace_info --query name -o tsv --set \
jobs.ner_finetune_job.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
jobs.token_classification_pipeline.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
inputs.compute_model_import=$compute_cluster \
inputs.compute_preprocess=$compute_cluster \
inputs.compute_finetune=$compute_cluster \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:

# specify the foundation model available in the azureml system registry
mlflow_model_path:
path: azureml://registries/azureml-preview/models/t5-small/versions/4
path: azureml://registries/azureml/models/t5-small/versions/3
# huggingface_id: 't5-small' # if you want to use a huggingface model, uncomment this line and comment the above line

# map the dataset files to parameters
Expand Down Expand Up @@ -50,10 +50,9 @@ settings:
force_rerun: true

jobs:
translation_en_ro_finetune_job:
translation_pipeline:
type: pipeline
# component: azureml://registries/azureml-preview/components/translation_pipeline/versions/0.0.3
component: azureml://registries/azureml-preview/components/translation_pipeline/labels/latest
component: azureml://registries/azureml/components/translation_pipeline/labels/latest
inputs:
mlflow_model_path: ${{parent.inputs.mlflow_model_path}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gpus_per_node=2
# This is the foundation model for finetuning
model_name="t5-small"
# using the latest version of the model - not working yet
model_version=1
model_version=3

version=$(date +%s)
finetuned_model_name=$model_name"-wmt16-en-ro"
Expand Down Expand Up @@ -106,7 +106,7 @@ fi
# need to switch to using latest version for model, currently blocked with a bug.
# submit finetuning job
parent_job_name=$( az ml job create --file ./translation-pipeline.yml $workspace_info --query name -o tsv --set \
jobs.translation_en_ro_finetune_job.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
jobs.translation_pipeline.component="azureml://registries/$registry_name/components/$finetuning_pipeline_component/labels/latest" \
inputs.compute_model_import=$compute_cluster \
inputs.compute_preprocess=$compute_cluster \
inputs.compute_finetune=$compute_cluster \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"outputs": [],
"source": [
"model_name = \"bert-base-uncased\"\n",
"model_version = \"1\"\n",
"model_version = \"3\"\n",
"foundation_model = registry_ml_client.models.get(model_name, model_version)\n",
"print(\n",
" \"\\n\\nUsing model name: {0}, version: {1}, id: {2} for fine tuning\".format(\n",
Expand Down Expand Up @@ -250,7 +250,7 @@
"# define the pipeline job\n",
"@pipeline()\n",
"def create_pipeline():\n",
" finetuning_job = pipeline_component_func(\n",
" question_answering_pipeline = pipeline_component_func(\n",
" # specify the foundation model available in the azureml system registry id identified in step #3\n",
" mlflow_model_path=foundation_model.id,\n",
" # huggingface_id = 'bert-base-uncased', # if you want to use a huggingface model, uncomment this line and comment the above line\n",
Expand Down Expand Up @@ -293,7 +293,7 @@
" return {\n",
" # map the output of the fine tuning job to the output of the pipeline job so that we can easily register the fine tuned model\n",
" # registering the model is required to deploy the model to an online or batch endpoint\n",
" \"trained_model\": finetuning_job.outputs.mlflow_model_folder\n",
" \"trained_model\": question_answering_pipeline.outputs.mlflow_model_folder\n",
" }\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"outputs": [],
"source": [
"model_name = \"t5-small\"\n",
"model_version = \"1\"\n",
"model_version = \"3\"\n",
"foundation_model = registry_ml_client.models.get(model_name, model_version)\n",
"print(\n",
" \"\\n\\nUsing model name: {0}, version: {1}, id: {2} for fine tuning\".format(\n",
Expand Down Expand Up @@ -248,7 +248,7 @@
"# define the pipeline job\n",
"@pipeline()\n",
"def create_pipeline():\n",
" finetuning_job = pipeline_component_func(\n",
" summarization_pipeline = pipeline_component_func(\n",
" # specify the foundation model available in the azureml system registry id identified in step #3\n",
" mlflow_model_path=foundation_model.id,\n",
" # huggingface_id = 'bert-base-uncased', # if you want to use a huggingface model, uncomment this line and comment the above line\n",
Expand Down Expand Up @@ -280,7 +280,7 @@
" return {\n",
" # map the output of the fine tuning job to the output of the pipeline job so that we can easily register the fine tuned model\n",
" # registering the model is required to deploy the model to an online or batch endpoint\n",
" \"trained_model\": finetuning_job.outputs.mlflow_model_folder\n",
" \"trained_model\": summarization_pipeline.outputs.mlflow_model_folder\n",
" }\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"outputs": [],
"source": [
"model_name = \"bert-base-uncased\"\n",
"model_version = \"1\"\n",
"model_version = \"3\"\n",
"foundation_model = registry_ml_client.models.get(model_name, model_version)\n",
"print(\n",
" \"\\n\\nUsing model name: {0}, version: {1}, id: {2} for fine tuning\".format(\n",
Expand Down Expand Up @@ -280,7 +280,7 @@
"# define the pipeline job\n",
"@pipeline()\n",
"def create_pipeline():\n",
" finetuning_job = pipeline_component_func(\n",
" text_classification_pipeline = pipeline_component_func(\n",
" # specify the foundation model available in the azureml system registry id identified in step #3\n",
" mlflow_model_path=foundation_model.id,\n",
" # huggingface_id = 'bert-base-uncased', # if you want to use a huggingface model, uncomment this line and comment the above line\n",
Expand All @@ -298,9 +298,9 @@
" test_file_path=Input(\n",
" type=\"uri_file\", path=\"./emotion-dataset/small_test.jsonl\"\n",
" ),\n",
" # evaluation_config=Input(\n",
" # type=\"uri_file\", path=\"./text-classification-config.json\"\n",
" # ),\n",
" evaluation_config=Input(\n",
" type=\"uri_file\", path=\"./text-classification-config.json\"\n",
" ),\n",
" # The following parameters map to the dataset fields\n",
" sentence1_key=\"text\",\n",
" label_key=\"label_string\",\n",
Expand All @@ -312,7 +312,7 @@
" return {\n",
" # map the output of the fine tuning job to the output of pipeline job so that we can easily register the fine tuned model\n",
" # registering the model is required to deploy the model to an online or batch endpoint\n",
" \"trained_model\": finetuning_job.outputs.mlflow_model_folder\n",
" \"trained_model\": text_classification_pipeline.outputs.mlflow_model_folder\n",
" }\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"outputs": [],
"source": [
"model_name = \"bert-base-uncased\"\n",
"model_version = \"1\"\n",
"model_version = \"3\"\n",
"foundation_model = registry_ml_client.models.get(model_name, model_version)\n",
"print(\n",
" \"\\n\\nUsing model name: {0}, version: {1}, id: {2} for fine tuning\".format(\n",
Expand Down Expand Up @@ -255,7 +255,7 @@
"# define the pipeline job\n",
"@pipeline()\n",
"def create_pipeline():\n",
" finetuning_job = pipeline_component_func(\n",
" token_classification_pipeline = pipeline_component_func(\n",
" # specify the foundation model available in the azureml system registry id identified in step #3\n",
" mlflow_model_path=foundation_model.id,\n",
" # huggingface_id = 'bert-base-uncased', # if you want to use a huggingface model, uncomment this line and comment the above line\n",
Expand Down Expand Up @@ -287,7 +287,7 @@
" return {\n",
" # map the output of the fine tuning job to the output of pipeline job so that we can easily register the fine tuned model\n",
" # registering the model is required to deploy the model to an online or batch endpoint\n",
" \"trained_model\": finetuning_job.outputs.mlflow_model_folder\n",
" \"trained_model\": token_classification_pipeline.outputs.mlflow_model_folder\n",
" }\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"outputs": [],
"source": [
"model_name = \"t5-small\"\n",
"model_version = \"1\"\n",
"model_version = \"3\"\n",
"foundation_model = registry_ml_client.models.get(model_name, model_version)\n",
"print(\n",
" \"\\n\\nUsing model name: {0}, version: {1}, id: {2} for fine tuning\".format(\n",
Expand Down Expand Up @@ -245,7 +245,7 @@
"# define the pipeline job\n",
"@pipeline()\n",
"def create_pipeline():\n",
" finetuning_job = pipeline_component_func(\n",
" translation_pipeline = pipeline_component_func(\n",
" # specify the foundation model available in the azureml system registry id identified in step #3\n",
" mlflow_model_path=foundation_model.id,\n",
" # huggingface_id = 't5-small', # if you want to use a huggingface model, uncomment this line and comment the above line\n",
Expand Down Expand Up @@ -277,7 +277,7 @@
" return {\n",
" # map the output of the fine tuning job to the output of the pipeline job so that we can easily register the fine tuned model\n",
" # registering the model is required to deploy the model to an online or batch endpoint\n",
" \"trained_model\": finetuning_job.outputs.mlflow_model_folder\n",
" \"trained_model\": translation_pipeline.outputs.mlflow_model_folder\n",
" }\n",
"\n",
"\n",
Expand Down

0 comments on commit a039fd2

Please sign in to comment.