diff --git a/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json new file mode 100644 index 000000000000..a4fbece95592 --- /dev/null +++ b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json @@ -0,0 +1,175 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "test-rg", + "workspaceName": "my-aml-workspace", + "id": "string", + "api-version": "2024-07-01-preview", + "body": { + "properties": { + "jobType": "FineTuning", + "experimentName": "llm-finetuning", + "fineTuningDetails": { + "taskType": "TextCompletion", + "modelProvider": "Custom", + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Llama-2-7b/versions/11", + "mode": "ReadOnlyMount", + "description": null + }, + "trainingData": { + "jobInputType": "uri_file", + "uri": "azureml://registries/azureml-meta/models/Llama-2-7b/versions/11", + "mode": "ReadOnlyMount", + "description": null + } + }, + "outputs": { + "string": { + "description": "string", + "uri": "string", + "mode": "ReadWriteMount", + "jobOutputType": "mlflow_model" + } + } + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "description": "string", + "tags": { + "string": "string" + }, + "properties": { + "string": "string" + }, + "displayName": "string", + "status": "Created", + "experimentName": "string", + "computeId": "string", + "isArchived": false, + "identity": { + "identityType": "AMLToken" + }, + "fineTuningDetails": { + "taskType": "TextCompletion", + "modelProvider": "Custom", + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Llama-2-7b/versions/11", + "mode": "ReadOnlyMount", + "description": null + }, + "trainingData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/UI/2023-06-06_175927_UTC/small_train.jsonl", + "mode": "ReadOnlyMount", + "description": null + } + }, + "componentId": "string", + "notificationSetting": { + "emails": [ + "string" + ], + "emailOn": [ + "JobFailed" + ] + }, + "jobType": "FineTuning", + "outputs": { + "string": { + "description": "string", + "uri": "string", + "mode": "ReadWriteMount", + "jobOutputType": "mlflow_model" + } + } + }, + "systemData": { + "createdAt": "2020-01-01T12:34:56.999+00:22", + "createdBy": "string", + "createdByType": "Application", + "lastModifiedAt": "2020-01-01T12:34:56.999+00:22", + "lastModifiedBy": "string", + "lastModifiedByType": "ManagedIdentity" + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "description": "string", + "tags": { + "string": "string" + }, + "properties": { + "string": "string" + }, + "displayName": "string", + "status": "Created", + "experimentName": "string", + "computeId": "string", + "isArchived": false, + "identity": { + "identityType": "AMLToken" + }, + "fineTuningDetails": { + "taskType": "TextCompletion", + "modelProvider": "Custom", + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Llama-2-7b/versions/11", + "mode": "ReadOnlyMount", + "description": null + }, + "trainingData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/UI/2023-06-06_175927_UTC/small_train.jsonl", + "mode": "ReadOnlyMount", + "description": null + } + }, + "componentId": "string", + "notificationSetting": { + "emails": [ + "string" + ], + "emailOn": [ + "JobFailed" + ] + }, + "jobType": "FineTuning", + "outputs": { + "string": { + "description": "string", + "uri": "string", + "mode": "ReadWriteMount", + "jobOutputType": "mlflow_model" + } + } + }, + "systemData": { + "createdAt": "2020-01-01T12:34:56.999+00:22", + "createdBy": "string", + "createdByType": "Application", + "lastModifiedAt": "2020-01-01T12:34:56.999+00:22", + "lastModifiedBy": "string", + "lastModifiedByType": "ManagedIdentity" + } + } + } + } +} diff --git a/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json new file mode 100644 index 000000000000..b5674a767da8 --- /dev/null +++ b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "test-rg", + "workspaceName": "my-aml-workspace", + "id": "string", + "api-version": "2024-07-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "description": "string", + "tags": { + "string": "string" + }, + "properties": { + "string": "string" + }, + "displayName": "string", + "status": "Created", + "experimentName": "string", + "computeId": "string", + "isArchived": false, + "identity": { + "identityType": "AMLToken" + }, + "fineTuningDetails": { + "taskType": "TextCompletion", + "modelProvider": "Custom", + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Llama-2-7b/versions/11", + "mode": "ReadOnlyMount", + "description": null + }, + "trainingData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/UI/2023-06-06_175927_UTC/small_train.jsonl", + "mode": "ReadOnlyMount", + "description": null + } + }, + "componentId": "string", + "notificationSetting": { + "emails": [ + "string" + ], + "emailOn": [ + "JobFailed" + ] + }, + "jobType": "FineTuning", + "outputs": { + "string": { + "description": "string", + "uri": "string", + "mode": "ReadWriteMount", + "jobOutputType": "mlflow_model" + } + } + }, + "systemData": { + "createdAt": "2020-01-01T12:34:56.999+00:22", + "createdBy": "string", + "createdByType": "Application", + "lastModifiedAt": "2020-01-01T12:34:56.999+00:22", + "lastModifiedBy": "string", + "lastModifiedByType": "ManagedIdentity" + } + } + } + } +} diff --git a/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/list.json b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/list.json new file mode 100644 index 000000000000..aa5949d147f4 --- /dev/null +++ b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/list.json @@ -0,0 +1,86 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "test-rg", + "workspaceName": "my-aml-workspace", + "api-version": "2024-07-01-preview", + "$skipToken": "string", + "jobType": "string", + "tag": "string", + "listViewType": "All" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "description": "string", + "tags": { + "string": "string" + }, + "properties": { + "string": "string" + }, + "displayName": "string", + "status": "Created", + "experimentName": "string", + "computeId": "string", + "isArchived": false, + "identity": { + "identityType": "AMLToken" + }, + "fineTuningDetails": { + "taskType": "TextCompletion", + "modelProvider": "Custom", + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Llama-2-7b/versions/11", + "mode": "ReadOnlyMount", + "description": null + }, + "trainingData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/UI/2023-06-06_175927_UTC/small_train.jsonl", + "mode": "ReadOnlyMount", + "description": null + } + }, + "componentId": "string", + "notificationSetting": { + "emails": [ + "string" + ], + "emailOn": [ + "JobFailed" + ] + }, + "jobType": "FineTuning", + "outputs": { + "string": { + "description": "string", + "uri": "string", + "mode": "ReadWriteMount", + "jobOutputType": "mlflow_model" + } + } + }, + "systemData": { + "createdAt": "2020-01-01T12:34:56.999+00:22", + "createdBy": "string", + "createdByType": "Application", + "lastModifiedAt": "2020-01-01T12:34:56.999+00:22", + "lastModifiedBy": "string", + "lastModifiedByType": "ManagedIdentity" + } + } + ], + "nextLink": "string" + } + } + } +} diff --git a/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json index 82b8fb3180d5..c2a67b6a74d4 100644 --- a/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json +++ b/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json @@ -9018,6 +9018,9 @@ "List AutoML Job.": { "$ref": "./examples/Job/AutoMLJob/list.json" }, + "List FineTuning Job.": { + "$ref": "./examples/Job/FineTuningJob/list.json" + }, "List Sweep Job.": { "$ref": "./examples/Job/SweepJob/list.json" }, @@ -9157,6 +9160,9 @@ "Get AutoML Job.": { "$ref": "./examples/Job/AutoMLJob/get.json" }, + "Get FineTuning Job.": { + "$ref": "./examples/Job/FineTuningJob/get.json" + }, "Get Sweep Job.": { "$ref": "./examples/Job/SweepJob/get.json" }, @@ -9235,6 +9241,9 @@ "CreateOrUpdate AutoML Job.": { "$ref": "./examples/Job/AutoMLJob/createOrUpdate.json" }, + "CreateOrUpdate FineTuning Job.": { + "$ref": "./examples/Job/FineTuningJob/createOrUpdate.json" + }, "CreateOrUpdate Sweep Job.": { "$ref": "./examples/Job/SweepJob/createOrUpdate.json" }, @@ -12611,6 +12620,51 @@ "x-ms-discriminator-value": "AzureFile", "additionalProperties": false }, + "AzureOpenAiFineTuning": { + "required": [ + "modelProvider" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/FineTuningVertical" + } + ], + "properties": { + "hyperParameters": { + "description": "HyperParameters for fine tuning Azure Open AI model.", + "$ref": "#/definitions/AzureOpenAiHyperParameters", + "x-nullable": true + } + }, + "x-ms-discriminator-value": "AzureOpenAI", + "additionalProperties": false + }, + "AzureOpenAiHyperParameters": { + "description": "Azure Open AI hyperparameters for fine tuning.", + "type": "object", + "properties": { + "learningRateMultiplier": { + "format": "double", + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting.", + "type": "number", + "x-nullable": true + }, + "batchSize": { + "format": "int32", + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.", + "type": "integer", + "x-nullable": true + }, + "nEpochs": { + "format": "int32", + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.", + "type": "integer", + "x-nullable": true + } + }, + "additionalProperties": false + }, "BanditPolicy": { "description": "Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation", "type": "object", @@ -14261,6 +14315,30 @@ }, "additionalProperties": false }, + "CustomModelFineTuning": { + "required": [ + "modelProvider" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/FineTuningVertical" + } + ], + "properties": { + "hyperParameters": { + "description": "HyperParameters for fine tuning custom model.", + "type": "object", + "additionalProperties": { + "type": "string", + "x-nullable": true + }, + "x-nullable": true + } + }, + "x-ms-discriminator-value": "Custom", + "additionalProperties": false + }, "CustomModelJobInput": { "type": "object", "allOf": [ @@ -16538,6 +16616,156 @@ }, "additionalProperties": false }, + "FineTuningJob": { + "description": "FineTuning Job definition.", + "required": [ + "fineTuningDetails", + "jobType", + "outputs" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/JobBase" + } + ], + "properties": { + "fineTuningDetails": { + "description": "[Required] ", + "$ref": "#/definitions/FineTuningVertical" + }, + "resources": { + "description": "Instance types and other resources for the job", + "default": "{}", + "$ref": "#/definitions/JobResources", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "queueSettings": { + "description": "Queue settings for the job", + "$ref": "#/definitions/QueueSettings", + "x-ms-mutability": [ + "create", + "read" + ], + "x-nullable": true + }, + "outputs": { + "description": "[Required] ", + "type": "object", + "additionalProperties": { + "description": "Job output definition container information on where to find job output/logs.", + "$ref": "#/definitions/JobOutput", + "x-nullable": true + }, + "x-ms-mutability": [ + "create", + "read" + ] + } + }, + "x-ms-discriminator-value": "FineTuning", + "additionalProperties": false + }, + "FineTuningTaskType": { + "enum": [ + "ChatCompletion", + "TextCompletion", + "TextClassification", + "QuestionAnswering", + "TextSummarization", + "TokenClassification", + "TextTranslation", + "ImageClassification", + "ImageInstanceSegmentation", + "ImageObjectDetection", + "VideoMultiObjectTracking" + ], + "type": "string", + "x-ms-enum": { + "name": "FineTuningTaskType", + "modelAsString": true, + "values": [ + { + "value": "ChatCompletion" + }, + { + "value": "TextCompletion" + }, + { + "value": "TextClassification" + }, + { + "value": "QuestionAnswering" + }, + { + "value": "TextSummarization" + }, + { + "value": "TokenClassification" + }, + { + "value": "TextTranslation" + }, + { + "value": "ImageClassification" + }, + { + "value": "ImageInstanceSegmentation" + }, + { + "value": "ImageObjectDetection" + }, + { + "value": "VideoMultiObjectTracking" + } + ] + }, + "additionalProperties": false + }, + "FineTuningVertical": { + "required": [ + "model", + "modelProvider", + "taskType", + "trainingData" + ], + "type": "object", + "properties": { + "modelProvider": { + "description": "[Required] Enum to determine the type of fine tuning.", + "$ref": "#/definitions/ModelProvider", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "taskType": { + "description": "[Required] Fine tuning task type.", + "$ref": "#/definitions/FineTuningTaskType", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "trainingData": { + "description": "[Required] Training data for fine tuning.", + "$ref": "#/definitions/JobInput" + }, + "validationData": { + "description": "Validation data for fine tuning.", + "$ref": "#/definitions/JobInput", + "x-nullable": true + }, + "model": { + "description": "[Required] Input model for fine tuning.", + "$ref": "#/definitions/MLFlowModelJobInput" + } + }, + "discriminator": "modelProvider" + }, "FixedInputData": { "description": "Fixed input data definition.", "type": "object", @@ -18286,6 +18514,20 @@ }, "additionalProperties": false }, + "JobResources": { + "type": "object", + "properties": { + "instanceTypes": { + "description": "List of instance types to choose from.", + "type": "array", + "items": { + "type": "string" + }, + "x-nullable": true + } + }, + "additionalProperties": false + }, "JobScheduleAction": { "required": [ "actionType", @@ -18501,7 +18743,8 @@ "Command", "Sweep", "Pipeline", - "Spark" + "Spark", + "FineTuning" ], "type": "string", "x-ms-enum": { @@ -18522,6 +18765,9 @@ }, { "value": "Spark" + }, + { + "value": "FineTuning" } ] }, @@ -19203,6 +19449,29 @@ }, "additionalProperties": false }, + "ModelProvider": { + "description": "Enum to determine the type of fine tuning.", + "enum": [ + "AzureOpenAI", + "Custom" + ], + "type": "string", + "x-ms-enum": { + "name": "ModelProvider", + "modelAsString": true, + "values": [ + { + "value": "AzureOpenAI", + "description": "Fine tuning using Azure Open AI model." + }, + { + "value": "Custom", + "description": "Fine tuning using custom model." + } + ] + }, + "additionalProperties": false + }, "ModelSettings": { "additionalProperties": false, "properties": { diff --git a/specification/machinelearningservices/resource-manager/readme.md b/specification/machinelearningservices/resource-manager/readme.md index dd71752810e1..919f027c6cb8 100644 --- a/specification/machinelearningservices/resource-manager/readme.md +++ b/specification/machinelearningservices/resource-manager/readme.md @@ -75,6 +75,22 @@ suppressions: in their inferencing API request. For that reason, this needs to be represented as an additionalProperties. where: - $.definitions["ServerlessInferenceEndpoint"].properties["headers"] + - code: AvoidAdditionalProperties + reason: As discussed these are hyperparameters which can vary by model and fine tuning task types so cannot have strictly typed properties. + where: + - $.definitions["CustomModelFineTuning"].properties["hyperParameters"] + - code: AvoidAdditionalProperties + reason: This is coming for wrong reason, just inheriting from JobBase. + where: + - $.definitions["FineTuningJob"].allOf[0]["allOf"][0].properties["properties"] + - $.definitions["FineTuningJob"].allOf[0].properties["notificationSetting"].properties["webhooks"] + - $.definitions["FineTuningJob"].allOf[0].properties["secretsConfiguration"] + - $.definitions["FineTuningJob"].allOf[0].properties["services"] + - $.definitions["FineTuningJob"].allOf[0].properties["services"].additionalProperties["properties"].properties + - code: AvoidAdditionalProperties + reason: There is a similar usage in existing jobs. + where: + - $.definitions["FineTuningJob"].properties["outputs"] ``` ### Tag: package-2024-04