diff --git a/cli/foundation-models/system/evaluation/fill-mask/fill-mask-pipeline.yml b/cli/foundation-models/system/evaluation/fill-mask/fill-mask-pipeline.yml index e1aaa2c2f3f..38a3b2ff052 100644 --- a/cli/foundation-models/system/evaluation/fill-mask/fill-mask-pipeline.yml +++ b/cli/foundation-models/system/evaluation/fill-mask/fill-mask-pipeline.yml @@ -28,7 +28,8 @@ jobs: path: azureml://registries/azureml/models/bert-base-uncased/versions/4 input_column_names: input_string label_column_name: title - device: gpu + device: auto + compute_name: gpu-cluster-big evaluation_config: path: "../../../../../sdk/python/foundation-models/system/evaluation/fill-mask/eval-config.json" type: uri_file diff --git a/cli/foundation-models/system/evaluation/question-answering/extractive-qa-pipeline.yml b/cli/foundation-models/system/evaluation/question-answering/extractive-qa-pipeline.yml index 00a75dd49a1..6742a8e4735 100644 --- a/cli/foundation-models/system/evaluation/question-answering/extractive-qa-pipeline.yml +++ b/cli/foundation-models/system/evaluation/question-answering/extractive-qa-pipeline.yml @@ -27,7 +27,8 @@ jobs: path: azureml://registries/azureml/models/distilbert-base-uncased-distilled-squad/versions/4 input_column_names: context,question label_column_name: answer_text - device: gpu + device: auto + compute_name: gpu-cluster-big evaluation_config: path: "../../../../../sdk/python/foundation-models/system/evaluation/question-answering/eval-config.json" type: uri_file diff --git a/cli/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization-pipeline.yml b/cli/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization-pipeline.yml index f8aec361288..bbd318c4fcf 100644 --- a/cli/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization-pipeline.yml +++ b/cli/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization-pipeline.yml @@ -28,7 +28,8 @@ jobs: path: azureml://registries/azureml/models/sshleifer-distilbart-cnn-12-6/versions/4 input_column_names: input_string label_column_name: summary - device: gpu + device: auto + compute_name: gpu-cluster-big evaluation_config: path: "../../../../../sdk/python/foundation-models/system/evaluation/summarization/eval-config.json" type: uri_file diff --git a/cli/foundation-models/system/evaluation/text-classification/entailment-contradiction-pipeline.yml b/cli/foundation-models/system/evaluation/text-classification/entailment-contradiction-pipeline.yml index 3388f675803..a1c3be3bc11 100644 --- a/cli/foundation-models/system/evaluation/text-classification/entailment-contradiction-pipeline.yml +++ b/cli/foundation-models/system/evaluation/text-classification/entailment-contradiction-pipeline.yml @@ -28,7 +28,8 @@ jobs: path: azureml://registries/azureml/models/microsoft-deberta-base-mnli/versions/4 input_column_names: input_string label_column_name: label_string - device: gpu + device: auto + compute_name: gpu-cluster-big evaluation_config: path: "../../../../../sdk/python/foundation-models/system/evaluation/text-classification/eval-config.json" type: uri_file diff --git a/cli/foundation-models/system/evaluation/text-generation/text-generation-pipeline.yml b/cli/foundation-models/system/evaluation/text-generation/text-generation-pipeline.yml index 00fe62d16e0..9bf0c265ec5 100644 --- a/cli/foundation-models/system/evaluation/text-generation/text-generation-pipeline.yml +++ b/cli/foundation-models/system/evaluation/text-generation/text-generation-pipeline.yml @@ -28,7 +28,8 @@ jobs: path: azureml://registries/azureml/models/gpt2/versions/4 input_column_names: input_string label_column_name: ground_truth - device: gpu + device: auto + compute_name: gpu-cluster-big evaluation_config: path: "../../../../../sdk/python/foundation-models/system/evaluation/text-generation/eval-config.json" type: uri_file diff --git a/cli/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition-pipeline.yml b/cli/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition-pipeline.yml index bc131919cd6..9f1f781ee2b 100644 --- a/cli/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition-pipeline.yml +++ b/cli/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition-pipeline.yml @@ -28,7 +28,8 @@ jobs: path: azureml://registries/azureml/models/jean-baptiste-camembert-ner/versions/4 input_column_names: input_string label_column_name: ner_tags_str - device: gpu + device: auto + compute_name: gpu-cluster-big evaluation_config: path: "../../../../../sdk/python/foundation-models/system/evaluation/token-classification/eval-config.json" type: uri_file diff --git a/cli/foundation-models/system/evaluation/translation/translation-pipeline.yml b/cli/foundation-models/system/evaluation/translation/translation-pipeline.yml index 1ddca81d274..bc6b34435a1 100644 --- a/cli/foundation-models/system/evaluation/translation/translation-pipeline.yml +++ b/cli/foundation-models/system/evaluation/translation/translation-pipeline.yml @@ -28,7 +28,8 @@ jobs: path: azureml://registries/azureml/models/t5-base/versions/4 input_column_names: input_string label_column_name: ro - device: gpu + device: auto + compute_name: gpu-cluster-big evaluation_config: path: "../../../../../sdk/python/foundation-models/system/evaluation/translation/eval-config.json" type: uri_file diff --git a/sdk/python/foundation-models/system/evaluation/fill-mask/fill-mask.ipynb b/sdk/python/foundation-models/system/evaluation/fill-mask/fill-mask.ipynb index a8c87ccc8fc..9727f0f5861 100644 --- a/sdk/python/foundation-models/system/evaluation/fill-mask/fill-mask.ipynb +++ b/sdk/python/foundation-models/system/evaluation/fill-mask/fill-mask.ipynb @@ -117,6 +117,28 @@ "registry_ml_client" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creating Compute\n", + "\n", + "There are two ways to submit a job - through a compute or a serverless job.\n", + "\n", + "##### Serverless Job:\n", + "\n", + "In a serverless job, there is no need to create a compute explicitly.\n", + "Simply pass the desired instance type value to the `instance_type` parameter while creating a pipeline job.\n", + "This allows for quick and convenient job submission without the need for managing a compute cluster.\n", + "\n", + "##### Compute Job:\n", + "\n", + "To submit a job through a compute, you need to create a compute cluster beforehand.\n", + "The following code below demonstrates how to create a gpu compute cluster.\n", + "After creating the compute cluster, pass the name of the compute cluster to the `compute_name` parameter while submitting the pipeline job. This ensures that the job runs on the specified compute cluster, allowing for more control and customization." + ] + }, { "cell_type": "code", "execution_count": null, @@ -326,10 +348,7 @@ " print(\"{} - {}\".format(model[\"name\"], test_data_fil_df.shape))\n", " test_data_file_name = \"small-test-{}.jsonl\".format(model[\"name\"])\n", " test_data_fil_df.to_json(test_data_file_name, lines=True, orient=\"records\")" - ], - "metadata": { - "collapsed": false - } + ] }, { "attachments": {}, @@ -377,6 +396,10 @@ " # The following parameters map to the dataset fields\n", " input_column_names=\"input_string\",\n", " label_column_name=\"title\",\n", + " # compute settings\n", + " compute_name=compute_cluster,\n", + " # specify the instance type for serverless job\n", + " # instance_type= \"STANDARD_NC24\",\n", " # Evaluation settings\n", " task=\"fill-mask\",\n", " # config file containing the details of evaluation metrics to calculate\n", @@ -384,7 +407,7 @@ " # evaluation_config_params=evaluation_config_params,\n", " # config cluster/device job is running on\n", " # set device to GPU/CPU on basis if GPU count was found\n", - " device=\"gpu\" if gpu_count_found else \"cpu\",\n", + " device=\"auto\",\n", " )\n", " return {\"evaluation_result\": evaluation_job.outputs.evaluation_result}" ] diff --git a/sdk/python/foundation-models/system/evaluation/question-answering/question-answering.ipynb b/sdk/python/foundation-models/system/evaluation/question-answering/question-answering.ipynb index 73273de8f8c..a94176559f0 100644 --- a/sdk/python/foundation-models/system/evaluation/question-answering/question-answering.ipynb +++ b/sdk/python/foundation-models/system/evaluation/question-answering/question-answering.ipynb @@ -117,6 +117,28 @@ "registry_ml_client" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creating Compute\n", + "\n", + "There are two ways to submit a job - through a compute or a serverless job.\n", + "\n", + "##### Serverless Job:\n", + "\n", + "In a serverless job, there is no need to create a compute explicitly.\n", + "Simply pass the desired instance type value to the `instance_type` parameter while creating a pipeline job.\n", + "This allows for quick and convenient job submission without the need for managing a compute cluster.\n", + "\n", + "##### Compute Job:\n", + "\n", + "To submit a job through a compute, you need to create a compute cluster beforehand.\n", + "The following code below demonstrates how to create a gpu compute cluster.\n", + "After creating the compute cluster, pass the name of the compute cluster to the `compute_name` parameter while submitting the pipeline job. This ensures that the job runs on the specified compute cluster, allowing for more control and customization." + ] + }, { "cell_type": "code", "execution_count": null, @@ -363,13 +385,17 @@ " # The following parameters map to the dataset fields\n", " input_column_names=\"context,question\",\n", " label_column_name=\"answer_text\",\n", + " # compute settings\n", + " compute_name=compute_cluster,\n", + " # specify the instance type for serverless job\n", + " # instance_type= \"STANDARD_NC24\",\n", " # Evaluation settings\n", " task=\"question-answering\",\n", " # config file containing the details of evaluation metrics to calculate\n", " evaluation_config=Input(type=AssetTypes.URI_FILE, path=\"./eval-config.json\"),\n", " # config cluster/device job is running on\n", " # set device to GPU/CPU on basis if GPU count was found\n", - " device=\"gpu\" if gpu_count_found else \"cpu\",\n", + " device=\"auto\",\n", " )\n", " return {\"evaluation_result\": evaluation_job.outputs.evaluation_result}" ] diff --git a/sdk/python/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization.ipynb b/sdk/python/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization.ipynb index 040caf65fca..ec466d67585 100644 --- a/sdk/python/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization.ipynb +++ b/sdk/python/foundation-models/system/evaluation/summarization/abstractive-and-extractive-summarization.ipynb @@ -115,6 +115,28 @@ "registry_ml_client" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creating Compute\n", + "\n", + "There are two ways to submit a job - through a compute or a serverless job.\n", + "\n", + "##### Serverless Job:\n", + "\n", + "In a serverless job, there is no need to create a compute explicitly.\n", + "Simply pass the desired instance type value to the `instance_type` parameter while creating a pipeline job.\n", + "This allows for quick and convenient job submission without the need for managing a compute cluster.\n", + "\n", + "##### Compute Job:\n", + "\n", + "To submit a job through a compute, you need to create a compute cluster beforehand.\n", + "The following code below demonstrates how to create a gpu compute cluster.\n", + "After creating the compute cluster, pass the name of the compute cluster to the `compute_name` parameter while submitting the pipeline job. This ensures that the job runs on the specified compute cluster, allowing for more control and customization." + ] + }, { "cell_type": "code", "execution_count": null, @@ -271,6 +293,17 @@ "test_data_df[\"summary\"] = test_data_df[\"highlights\"]" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# trucating the data to pass the tokenizer limit of the model\n", + "test_data_df[\"article\"] = test_data_df[\"article\"].str.slice(0, 200)\n", + "test_data_df[\"input_string\"] = test_data_df[\"input_string\"].str.slice(0, 200)" + ] + }, { "cell_type": "code", "execution_count": null, @@ -359,6 +392,10 @@ " # The following parameters map to the dataset fields\n", " input_column_names=\"input_string\",\n", " label_column_name=\"summary\",\n", + " # compute settings\n", + " compute_name=compute_cluster,\n", + " # specify the instance type for serverless job\n", + " # instance_type= \"STANDARD_NC24\",\n", " # Evaluation settings\n", " task=\"text-summarization\",\n", " # config file containing the details of evaluation metrics to calculate\n", @@ -366,7 +403,7 @@ " # evaluation_config_params=evaluation_config_params,\n", " # config cluster/device job is running on\n", " # set device to GPU/CPU on basis if GPU count was found\n", - " device=\"gpu\" if gpu_count_found else \"cpu\",\n", + " device=\"auto\",\n", " )\n", " return {\"evaluation_result\": evaluation_job.outputs.evaluation_result}" ] diff --git a/sdk/python/foundation-models/system/evaluation/text-classification/entailment-contradiction.ipynb b/sdk/python/foundation-models/system/evaluation/text-classification/entailment-contradiction.ipynb index 6a6f4878a2b..20ead0ba6fa 100644 --- a/sdk/python/foundation-models/system/evaluation/text-classification/entailment-contradiction.ipynb +++ b/sdk/python/foundation-models/system/evaluation/text-classification/entailment-contradiction.ipynb @@ -122,6 +122,28 @@ "workspace_ml_client" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creating Compute\n", + "\n", + "There are two ways to submit a job - through a compute or a serverless job.\n", + "\n", + "##### Serverless Job:\n", + "\n", + "In a serverless job, there is no need to create a compute explicitly.\n", + "Simply pass the desired instance type value to the `instance_type` parameter while creating a pipeline job.\n", + "This allows for quick and convenient job submission without the need for managing a compute cluster.\n", + "\n", + "##### Compute Job:\n", + "\n", + "To submit a job through a compute, you need to create a compute cluster beforehand.\n", + "The following code below demonstrates how to create a gpu compute cluster.\n", + "After creating the compute cluster, pass the name of the compute cluster to the `compute_name` parameter while submitting the pipeline job. This ensures that the job runs on the specified compute cluster, allowing for more control and customization." + ] + }, { "cell_type": "code", "execution_count": null, @@ -356,13 +378,17 @@ " # The following parameters map to the dataset fields\n", " input_column_names=\"input_string\",\n", " label_column_name=\"label_string\",\n", + " # compute settings\n", + " compute_name=compute_cluster,\n", + " # specify the instance type for serverless job\n", + " # instance_type= \"STANDARD_NC24\",\n", " # Evaluation settings\n", " task=\"text-classification\",\n", " # config file containing the details of evaluation metrics to calculate\n", " evaluation_config=Input(type=AssetTypes.URI_FILE, path=\"./eval-config.json\"),\n", " # config cluster/device job is running on\n", " # set device to GPU/CPU on basis if GPU count was found\n", - " device=\"gpu\" if gpu_count_found else \"cpu\",\n", + " device=\"auto\",\n", " )\n", " return {\"evaluation_result\": evaluation_job.outputs.evaluation_result}" ] diff --git a/sdk/python/foundation-models/system/evaluation/text-generation/text-generation.ipynb b/sdk/python/foundation-models/system/evaluation/text-generation/text-generation.ipynb index 3fecb3f4533..f2f2fb48a61 100644 --- a/sdk/python/foundation-models/system/evaluation/text-generation/text-generation.ipynb +++ b/sdk/python/foundation-models/system/evaluation/text-generation/text-generation.ipynb @@ -117,6 +117,28 @@ "registry_ml_client" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creating Compute\n", + "\n", + "There are two ways to submit a job - through a compute or a serverless job.\n", + "\n", + "##### Serverless Job:\n", + "\n", + "In a serverless job, there is no need to create a compute explicitly.\n", + "Simply pass the desired instance type value to the `instance_type` parameter while creating a pipeline job.\n", + "This allows for quick and convenient job submission without the need for managing a compute cluster.\n", + "\n", + "##### Compute Job:\n", + "\n", + "To submit a job through a compute, you need to create a compute cluster beforehand.\n", + "The following code below demonstrates how to create a gpu compute cluster.\n", + "After creating the compute cluster, pass the name of the compute cluster to the `compute_name` parameter while submitting the pipeline job. This ensures that the job runs on the specified compute cluster, allowing for more control and customization." + ] + }, { "cell_type": "code", "execution_count": null, @@ -215,6 +237,9 @@ { "cell_type": "code", "execution_count": null, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "models = []\n", @@ -223,21 +248,18 @@ " reg_model = list(registry_ml_client.models.list(name=model[\"name\"]))[0]\n", " print(reg_model.id)\n", " models.append({**model, \"version\": reg_model.version})" - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", "execution_count": null, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "models" - ], - "metadata": { - "collapsed": false - } + ] }, { "attachments": {}, @@ -360,13 +382,17 @@ " # The following parameters map to the dataset fields\n", " input_column_names=\"input_string\",\n", " label_column_name=\"ground_truth\",\n", + " # compute settings\n", + " compute_name=compute_cluster,\n", + " # specify the instance type for serverless job\n", + " # instance_type= \"STANDARD_NC24\",\n", " # Evaluation settings\n", " task=\"text-generation\",\n", " # config file containing the details of evaluation metrics to calculate\n", " evaluation_config=Input(type=AssetTypes.URI_FILE, path=\"./eval-config.json\"),\n", " # config cluster/device job is running on\n", " # set device to GPU/CPU on basis if GPU count was found\n", - " device=\"gpu\" if gpu_count_found else \"cpu\",\n", + " device=\"auto\",\n", " )\n", " return {\"evaluation_result\": evaluation_job.outputs.evaluation_result}" ] diff --git a/sdk/python/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition.ipynb b/sdk/python/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition.ipynb index 655d3ccee47..e5c0ae84465 100644 --- a/sdk/python/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition.ipynb +++ b/sdk/python/foundation-models/system/evaluation/token-classification/news-articles-entity-recognition.ipynb @@ -115,6 +115,28 @@ "registry_ml_client" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creating Compute\n", + "\n", + "There are two ways to submit a job - through a compute or a serverless job.\n", + "\n", + "##### Serverless Job:\n", + "\n", + "In a serverless job, there is no need to create a compute explicitly.\n", + "Simply pass the desired instance type value to the `instance_type` parameter while creating a pipeline job.\n", + "This allows for quick and convenient job submission without the need for managing a compute cluster.\n", + "\n", + "##### Compute Job:\n", + "\n", + "To submit a job through a compute, you need to create a compute cluster beforehand.\n", + "The following code below demonstrates how to create a gpu compute cluster.\n", + "After creating the compute cluster, pass the name of the compute cluster to the `compute_name` parameter while submitting the pipeline job. This ensures that the job runs on the specified compute cluster, allowing for more control and customization." + ] + }, { "cell_type": "code", "execution_count": null, @@ -390,13 +412,17 @@ " # The following parameters map to the dataset fields\n", " input_column_names=\"input_string\",\n", " label_column_name=\"ner_tags_str\",\n", + " # compute settings\n", + " compute_name=compute_cluster,\n", + " # specify the instance type for serverless job\n", + " # instance_type= \"STANDARD_NC24\",\n", " # Evaluation settings\n", " task=\"text-named-entity-recognition\",\n", " # config file containing the details of evaluation metrics to calculate\n", " evaluation_config=Input(type=AssetTypes.URI_FILE, path=\"./eval-config.json\"),\n", " # config cluster/device job is running on\n", " # set device to GPU/CPU on basis if GPU count was found\n", - " device=\"gpu\" if gpu_count_found else \"cpu\",\n", + " device=\"auto\",\n", " )\n", " return {\"evaluation_result\": evaluation_job.outputs.evaluation_result}" ] diff --git a/sdk/python/foundation-models/system/evaluation/translation/translation-romanian-to-english.ipynb b/sdk/python/foundation-models/system/evaluation/translation/translation-romanian-to-english.ipynb index 1eefaa6e023..43ae2d23bef 100644 --- a/sdk/python/foundation-models/system/evaluation/translation/translation-romanian-to-english.ipynb +++ b/sdk/python/foundation-models/system/evaluation/translation/translation-romanian-to-english.ipynb @@ -115,6 +115,28 @@ "registry_ml_client" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creating Compute\n", + "\n", + "There are two ways to submit a job - through a compute or a serverless job.\n", + "\n", + "##### Serverless Job:\n", + "\n", + "In a serverless job, there is no need to create a compute explicitly.\n", + "Simply pass the desired instance type value to the `instance_type` parameter while creating a pipeline job.\n", + "This allows for quick and convenient job submission without the need for managing a compute cluster.\n", + "\n", + "##### Compute Job:\n", + "\n", + "To submit a job through a compute, you need to create a compute cluster beforehand.\n", + "The following code below demonstrates how to create a gpu compute cluster.\n", + "After creating the compute cluster, pass the name of the compute cluster to the `compute_name` parameter while submitting the pipeline job. This ensures that the job runs on the specified compute cluster, allowing for more control and customization." + ] + }, { "cell_type": "code", "execution_count": null, @@ -358,13 +380,17 @@ " # The following parameters map to the dataset fields\n", " input_column_names=\"input_string\",\n", " label_column_name=\"ro\",\n", + " # compute settings\n", + " compute_name=compute_cluster,\n", + " # specify the instance type for serverless job\n", + " # instance_type= \"STANDARD_NC24\",\n", " # Evaluation settings\n", " task=\"text-translation\",\n", " # config file containing the details of evaluation metrics to calculate\n", " evaluation_config=Input(type=AssetTypes.URI_FILE, path=\"./eval-config.json\"),\n", " # config cluster/device job is running on\n", " # set device to GPU/CPU on basis if GPU count was found\n", - " device=\"gpu\" if gpu_count_found else \"cpu\",\n", + " device=\"auto\",\n", " )\n", " return {\"evaluation_result\": evaluation_job.outputs.evaluation_result}" ]