Skip to content

Commit 5680805

Browse files
Google APIscopybara-github
authored andcommitted
feat: add API for Managed OSS Fine Tuning
docs: A comment for field `model` in message `.google.cloud.aiplatform.v1beta1.TunedModel` is changed docs: A comment for field `learning_rate_multiplier` in message `.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters` is changed docs: A comment for field `training_dataset_uri` in message `.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec` is changed docs: A comment for field `validation_dataset_uri` in message `.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec` is changed PiperOrigin-RevId: 782121247
1 parent 4fc63ab commit 5680805

1 file changed

Lines changed: 53 additions & 5 deletions

File tree

google/cloud/aiplatform/v1beta1/tuning_job.proto

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ message TuningJob {
7575
// [TuningJob][google.cloud.aiplatform.v1.TuningJob].
7676
string description = 3 [(google.api.field_behavior) = OPTIONAL];
7777

78+
// Optional. The user-provided path to custom model weights. Set this field
79+
// to tune a custom model. The path must be a Cloud Storage directory that
80+
// contains the model weights in .safetensors format along with associated
81+
// model metadata files. If this field is set, the base_model field must still
82+
// be set to indicate which base model the custom model is derived from. This
83+
// feature is only available for open source models.
84+
string custom_base_model = 26 [(google.api.field_behavior) = OPTIONAL];
85+
7886
// Output only. The detailed state of the job.
7987
JobState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
8088

@@ -158,13 +166,26 @@ message TuningJob {
158166
// Users starting the pipeline must have the `iam.serviceAccounts.actAs`
159167
// permission on this service account.
160168
string service_account = 22;
169+
170+
// Optional. Cloud Storage path to the directory where tuning job outputs are
171+
// written to. This field is only available and required for open source
172+
// models.
173+
string output_uri = 25 [(google.api.field_behavior) = OPTIONAL];
161174
}
162175

163176
// The Model Registry Model and Online Prediction Endpoint associated with
164177
// this [TuningJob][google.cloud.aiplatform.v1.TuningJob].
165178
message TunedModel {
166179
// Output only. The resource name of the TunedModel. Format:
167-
// `projects/{project}/locations/{location}/models/{model}`.
180+
//
181+
// `projects/{project}/locations/{location}/models/{model}@{version_id}`
182+
//
183+
// When tuning from a base model, the version_id will be 1.
184+
//
185+
// For continuous tuning, the version id will be incremented by 1 from the
186+
// last version id in the parent model. E.g.,
187+
// `projects/{project}/locations/{location}/models/{model}@{last_version_id +
188+
// 1}`
168189
string model = 1 [
169190
(google.api.field_behavior) = OUTPUT_ONLY,
170191
(google.api.resource_reference) = {
@@ -412,20 +433,44 @@ message SupervisedHyperParameters {
412433
int64 epoch_count = 1 [(google.api.field_behavior) = OPTIONAL];
413434

414435
// Optional. Multiplier for adjusting the default learning rate.
436+
// Mutually exclusive with `learning_rate`.
415437
double learning_rate_multiplier = 2 [(google.api.field_behavior) = OPTIONAL];
416438

439+
// Optional. Learning rate for tuning.
440+
// Mutually exclusive with `learning_rate_multiplier`.
441+
// This feature is only available for open source models.
442+
double learning_rate = 6 [(google.api.field_behavior) = OPTIONAL];
443+
417444
// Optional. Adapter size for tuning.
418445
AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL];
446+
447+
// Optional. Batch size for tuning.
448+
// This feature is only available for open source models.
449+
int64 batch_size = 5 [(google.api.field_behavior) = OPTIONAL];
419450
}
420451

421452
// Tuning Spec for Supervised Tuning for first party models.
422453
message SupervisedTuningSpec {
423-
// Required. Cloud Storage path to file containing training dataset for
424-
// tuning. The dataset must be formatted as a JSONL file.
454+
// Supported tuning modes.
455+
enum TuningMode {
456+
// Tuning mode is unspecified.
457+
TUNING_MODE_UNSPECIFIED = 0;
458+
459+
// Full fine-tuning mode.
460+
TUNING_MODE_FULL = 1;
461+
462+
// PEFT adapter tuning mode.
463+
TUNING_MODE_PEFT_ADAPTER = 2;
464+
}
465+
466+
// Required. Training dataset used for tuning. The dataset can be specified as
467+
// either a Cloud Storage path to a JSONL file or as the resource name of a
468+
// Vertex Multimodal Dataset.
425469
string training_dataset_uri = 1 [(google.api.field_behavior) = REQUIRED];
426470

427-
// Optional. Cloud Storage path to file containing validation dataset for
428-
// tuning. The dataset must be formatted as a JSONL file.
471+
// Optional. Validation dataset used for tuning. The dataset can be specified
472+
// as either a Cloud Storage path to a JSONL file or as the resource name of a
473+
// Vertex Multimodal Dataset.
429474
string validation_dataset_uri = 2 [(google.api.field_behavior) = OPTIONAL];
430475

431476
// Optional. Hyperparameters for SFT.
@@ -436,6 +481,9 @@ message SupervisedTuningSpec {
436481
// the last checkpoint will be exported. Otherwise, enable intermediate
437482
// checkpoints for SFT. Default is false.
438483
bool export_last_checkpoint_only = 6 [(google.api.field_behavior) = OPTIONAL];
484+
485+
// Tuning mode.
486+
TuningMode tuning_mode = 7;
439487
}
440488

441489
// Tuning Spec for Distillation.

0 commit comments

Comments
 (0)