Skip to content

Commit

Permalink
fix: annotate PipelineJob and PipelineTaskRerunConfig fields as optio…
Browse files Browse the repository at this point in the history
…nal (#5698)

* feat: add TunedModelRef and RebaseTunedModel Api for Vertex GenAiTuningService
docs: limit comment `SupervisedTuningSpec` for 1p tuning

PiperOrigin-RevId: 676969679

Source-Link: googleapis/googleapis@2a98f79

Source-Link: googleapis/googleapis-gen@eb6e7f5
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImViNmU3ZjU5NWE4NmIzODVmMWY0NTkzZTQzY2JlMTAxNWMyOWVmNzkifQ==

* feat: add TunedModelRef and RebaseTunedModel Api for Vertex GenAiTuningService
docs: limit comment `SupervisedTuningSpec` for 1p tuning

PiperOrigin-RevId: 676970579

Source-Link: googleapis/googleapis@30009c9

Source-Link: googleapis/googleapis-gen@6d9cc8d
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjZkOWNjOGQ2MGFmZjY1MWE2YzQ4ZmIwYTk1MWRkOGE4M2UwNmEyNjcifQ==

* fix: annotate PipelineJob and PipelineTaskRerunConfig fields as optional

PiperOrigin-RevId: 679707420

Source-Link: googleapis/googleapis@d6f1848

Source-Link: googleapis/googleapis-gen@f6c16c2
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImY2YzE2YzIwMDBiMGRmMTU4MWRhZjIzZTY1NWYzZmE0ZTMzZGZmOTkifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Bankhead <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2024
1 parent fd737ec commit 183c038
Show file tree
Hide file tree
Showing 22 changed files with 8,186 additions and 39 deletions.
2 changes: 2 additions & 0 deletions packages/google-cloud-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Gen_ai_tuning_service.create_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.get_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.list_tuning_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.rebase_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.create_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.delete_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.deploy_index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js,packages/google-cloud-aiplatform/samples/README.md) |
Expand Down Expand Up @@ -499,6 +500,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Gen_ai_tuning_service.create_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.get_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.list_tuning_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.rebase_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.create_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.delete_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.deploy_index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js,packages/google-cloud-aiplatform/samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/aiplatform/v1/io.proto";
import "google/cloud/aiplatform/v1/operation.proto";
import "google/cloud/aiplatform/v1/tuning_job.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1";
Expand Down Expand Up @@ -82,6 +85,22 @@ service GenAiTuningService {
};
option (google.api.method_signature) = "name";
}

// Rebase a TunedModel.
// Creates a LongRunningOperation that takes a legacy Tuned GenAI model
// Reference and creates a TuningJob based on newly available model.
rpc RebaseTunedModel(RebaseTunedModelRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel"
body: "*"
};
option (google.api.method_signature) = "parent,tuned_model_ref";
option (google.longrunning.operation_info) = {
response_type: "TuningJob"
metadata_type: "RebaseTunedModelOperationMetadata"
};
}
}

// Request message for
Expand Down Expand Up @@ -162,3 +181,39 @@ message CancelTuningJobRequest {
}
];
}

// Request message for
// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModel].
message RebaseTunedModelRequest {
// Required. The resource name of the Location into which to rebase the Model.
// Format: `projects/{project}/locations/{location}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];

// Required. TunedModel reference to retrieve the legacy model information.
TunedModelRef tuned_model_ref = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. The TuningJob to be updated. Users can use this TuningJob field
// to overwrite tuning configs.
TuningJob tuning_job = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. The Google Cloud Storage location to write the artifacts.
GcsDestination artifact_destination = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. By default, bison to gemini migration will always create new
// model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default
// deploy to the same endpoint. See details in this Section.
bool deploy_to_same_endpoint = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Runtime operation information for
// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModel].
message RebaseTunedModelOperationMetadata {
// The common part of the operation generic information.
GenericOperationMetadata generic_metadata = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ message SupervisedHyperParameters {
AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Tuning Spec for Supervised Tuning.
// Tuning Spec for Supervised Tuning for first party models.
message SupervisedTuningSpec {
// Required. Cloud Storage path to file containing training dataset for
// tuning. The dataset must be formatted as a JSONL file.
Expand All @@ -299,3 +299,26 @@ message SupervisedTuningSpec {
SupervisedHyperParameters hyper_parameters = 3
[(google.api.field_behavior) = OPTIONAL];
}

// TunedModel Reference for legacy model migration.
message TunedModelRef {
// The Tuned Model Reference for the model.
oneof tuned_model_ref {
// Support migration from model registry.
string tuned_model = 1 [(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/Model"
}];

// Support migration from tuning job list page, from gemini-1.0-pro-002
// to 1.5 and above.
string tuning_job = 2 [(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/TuningJob"
}];

// Support migration from tuning job list page, from bison model to gemini
// model.
string pipeline_job = 3 [(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/PipelineJob"
}];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/aiplatform/v1beta1/io.proto";
import "google/cloud/aiplatform/v1beta1/operation.proto";
import "google/cloud/aiplatform/v1beta1/tuning_job.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
Expand Down Expand Up @@ -82,6 +85,22 @@ service GenAiTuningService {
};
option (google.api.method_signature) = "name";
}

// Rebase a TunedModel.
// Creates a LongRunningOperation that takes a legacy Tuned GenAI model
// Reference and creates a TuningJob based on newly available model.
rpc RebaseTunedModel(RebaseTunedModelRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel"
body: "*"
};
option (google.api.method_signature) = "parent,tuned_model_ref";
option (google.longrunning.operation_info) = {
response_type: "TuningJob"
metadata_type: "RebaseTunedModelOperationMetadata"
};
}
}

// Request message for
Expand Down Expand Up @@ -162,3 +181,39 @@ message CancelTuningJobRequest {
}
];
}

// Request message for
// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel].
message RebaseTunedModelRequest {
// Required. The resource name of the Location into which to rebase the Model.
// Format: `projects/{project}/locations/{location}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];

// Required. TunedModel reference to retrieve the legacy model information.
TunedModelRef tuned_model_ref = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. The TuningJob to be updated. Users can use this TuningJob field
// to overwrite tuning configs.
TuningJob tuning_job = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. The Google Cloud Storage location to write the artifacts.
GcsDestination artifact_destination = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. By default, bison to gemini migration will always create new
// model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default
// deploy to the same endpoint. See details in this Section.
bool deploy_to_same_endpoint = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Runtime operation information for
// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel].
message RebaseTunedModelOperationMetadata {
// The common part of the operation generic information.
GenericOperationMetadata generic_metadata = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,11 @@ message PipelineJob {
// Output only. Reserved for future use.
bool satisfies_pzi = 28 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The original pipeline job id if this pipeline job is a rerun
// of a previous pipeline job.
int64 original_pipeline_job_id = 29
[(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. The original pipeline job id if this pipeline job is a rerun of a
// previous pipeline job.
int64 original_pipeline_job_id = 29 [(google.api.field_behavior) = OPTIONAL];

// Output only. The rerun configs for each task in the pipeline job.
// Optional. The rerun configs for each task in the pipeline job.
// By default, the rerun will:
// 1. Use the same input artifacts as the original run.
// 2. Use the same input parameters as the original run.
Expand All @@ -238,7 +237,7 @@ message PipelineJob {
// By providing this field, users can override the default behavior and
// specify the rerun config for each task.
repeated PipelineTaskRerunConfig pipeline_task_rerun_configs = 30
[(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OPTIONAL];
}

// Pipeline template metadata if
Expand Down Expand Up @@ -459,35 +458,34 @@ message PipelineTaskExecutorDetail {
message PipelineTaskRerunConfig {
// A list of artifact metadata.
message ArtifactList {
// Output only. A list of artifact metadata.
// Optional. A list of artifact metadata.
repeated RuntimeArtifact artifacts = 1
[(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OPTIONAL];
}

// Runtime inputs data of the task.
message Inputs {
// Output only. Input artifacts.
// Optional. Input artifacts.
map<string, ArtifactList> artifacts = 1
[(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OPTIONAL];

// Output only. Input parameters.
// Optional. Input parameters.
map<string, google.protobuf.Value> parameter_values = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OPTIONAL];
}

// Output only. The system generated ID of the task. Retrieved from original
// run.
int64 task_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. The system generated ID of the task. Retrieved from original run.
int64 task_id = 1 [(google.api.field_behavior) = OPTIONAL];

// Output only. The name of the task.
string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. The name of the task.
string task_name = 2 [(google.api.field_behavior) = OPTIONAL];

// Output only. The runtime input of the task overridden by the user.
Inputs inputs = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. The runtime input of the task overridden by the user.
Inputs inputs = 3 [(google.api.field_behavior) = OPTIONAL];

// Output only. Whether to skip this task. Default value is False.
bool skip_task = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Whether to skip this task. Default value is False.
bool skip_task = 4 [(google.api.field_behavior) = OPTIONAL];

// Output only. Whether to skip downstream tasks. Default value is False.
bool skip_downstream_tasks = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Whether to skip downstream tasks. Default value is False.
bool skip_downstream_tasks = 5 [(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ message SupervisedHyperParameters {
AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Tuning Spec for Supervised Tuning.
// Tuning Spec for Supervised Tuning for first party models.
message SupervisedTuningSpec {
// Required. Cloud Storage path to file containing training dataset for
// tuning. The dataset must be formatted as a JSONL file.
Expand Down Expand Up @@ -450,3 +450,26 @@ message DistillationHyperParameters {
SupervisedHyperParameters.AdapterSize adapter_size = 3
[(google.api.field_behavior) = OPTIONAL];
}

// TunedModel Reference for legacy model migration.
message TunedModelRef {
// The Tuned Model Reference for the model.
oneof tuned_model_ref {
// Support migration from model registry.
string tuned_model = 1 [(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/Model"
}];

// Support migration from tuning job list page, from gemini-1.0-pro-002
// to 1.5 and above.
string tuning_job = 2 [(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/TuningJob"
}];

// Support migration from tuning job list page, from bison model to gemini
// model.
string pipeline_job = 3 [(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/PipelineJob"
}];
}
}
Loading

0 comments on commit 183c038

Please sign in to comment.