|
|
|
@ -31,24 +31,24 @@ option java_package = "com.google.cloud.ml.api.v1beta1"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Allows creating and managing training and prediction jobs. |
|
|
|
|
// Service to create and manage training and batch prediction jobs. |
|
|
|
|
service JobService { |
|
|
|
|
// Create a training or a prediction job. |
|
|
|
|
// Creates a training or a batch prediction job. |
|
|
|
|
rpc CreateJob(CreateJobRequest) returns (Job) { |
|
|
|
|
option (google.api.http) = { post: "/v1beta1/{parent=projects/*}/jobs" body: "job" }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// List jobs in the project. |
|
|
|
|
// Lists the jobs in the project. |
|
|
|
|
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { |
|
|
|
|
option (google.api.http) = { get: "/v1beta1/{parent=projects/*}/jobs" }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Describe a job. |
|
|
|
|
// Describes a job. |
|
|
|
|
rpc GetJob(GetJobRequest) returns (Job) { |
|
|
|
|
option (google.api.http) = { get: "/v1beta1/{name=projects/*/jobs/*}" }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Cancel a running job. |
|
|
|
|
// Cancels a running job. |
|
|
|
|
rpc CancelJob(CancelJobRequest) returns (google.protobuf.Empty) { |
|
|
|
|
option (google.api.http) = { post: "/v1beta1/{name=projects/*/jobs/*}:cancel" body: "*" }; |
|
|
|
|
} |
|
|
|
@ -56,75 +56,110 @@ service JobService { |
|
|
|
|
|
|
|
|
|
// Represents input parameters for a training job. |
|
|
|
|
message TrainingInput { |
|
|
|
|
// Scale tiers. |
|
|
|
|
// A scale tier is an abstract representation of the resources Cloud ML |
|
|
|
|
// will allocate to a training job. When selecting a scale tier for your |
|
|
|
|
// training job, you should consider the size of your training dataset and |
|
|
|
|
// the complexity of your model. As the tiers increase, virtual machines are |
|
|
|
|
// added to handle your job, and the individual machines in the cluster |
|
|
|
|
// generally have more memory and greater processing power than they do at |
|
|
|
|
// lower tiers. The number of training units charged per hour of processing |
|
|
|
|
// increases as tiers get more advanced. Refer to the |
|
|
|
|
// [pricing guide](/ml/pricing) for more details. |
|
|
|
|
enum ScaleTier { |
|
|
|
|
// A single worker instance and no parameter servers. |
|
|
|
|
// A single worker instance. This tier is suitable for learning how to use |
|
|
|
|
// Cloud ML, and for experimenting with new models using small datasets. |
|
|
|
|
BASIC = 0; |
|
|
|
|
|
|
|
|
|
// A few workers and one parameter server. |
|
|
|
|
// Many workers and a few parameter servers. |
|
|
|
|
STANDARD_1 = 1; |
|
|
|
|
|
|
|
|
|
// A medium amount of workers and a few parameter servers. |
|
|
|
|
STANDARD_2 = 2; |
|
|
|
|
|
|
|
|
|
// A large amount of worker with more parameter servers. |
|
|
|
|
// A large number of workers with many parameter servers. |
|
|
|
|
PREMIUM_1 = 3; |
|
|
|
|
|
|
|
|
|
// A very large amount of workers with even more parameter servers. |
|
|
|
|
PREMIUM_2 = 4; |
|
|
|
|
|
|
|
|
|
// Specify your own amounts of replicas in the `worker_count` and |
|
|
|
|
// `parameter_server_count` fields, as well as machine types for the master, |
|
|
|
|
// the workers and the parameter servers. |
|
|
|
|
// The CUSTOM tier is not a set tier, but rather enables you to use your |
|
|
|
|
// own cluster specification. When you use this tier, you must also set |
|
|
|
|
// valid values for `worker_count` and `parameter_server_count`, and you can |
|
|
|
|
// specify the type of virtual machines to use for the different types of |
|
|
|
|
// workers by setting `master_type`, `worker_type`, and |
|
|
|
|
// `parameter_server_type`. |
|
|
|
|
CUSTOM = 5; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Required. Specifies the machine types, the amounts of replicas for workers |
|
|
|
|
// Required. Specifies the machine types, the number of replicas for workers |
|
|
|
|
// and parameter servers. |
|
|
|
|
ScaleTier scale_tier = 1; |
|
|
|
|
|
|
|
|
|
// Optional. Specifies the master machine type. |
|
|
|
|
// Optional. Specifies the type of virtual machine to use for your training |
|
|
|
|
// job's master worker. |
|
|
|
|
// |
|
|
|
|
// The following types are supported: |
|
|
|
|
// |
|
|
|
|
// - `standard` |
|
|
|
|
// - `large_model` |
|
|
|
|
// - `complex_model_s` |
|
|
|
|
// - `complex_model_m` |
|
|
|
|
// - `complex_model_l` |
|
|
|
|
// <dl> |
|
|
|
|
// <dt>standard</dt> |
|
|
|
|
// <dd> |
|
|
|
|
// A basic machine configuration suitable for training simple models with |
|
|
|
|
// small to moderate datasets. |
|
|
|
|
// </dd> |
|
|
|
|
// <dt>large_model</dt> |
|
|
|
|
// <dd> |
|
|
|
|
// A machine with a lot of memory, specially suited for parameter servers |
|
|
|
|
// when your model is large (having many hidden layers or layers with very |
|
|
|
|
// large numbers of nodes). |
|
|
|
|
// </dd> |
|
|
|
|
// <dt>complex_model_s</dt> |
|
|
|
|
// <dd> |
|
|
|
|
// A machine suitable for the master and workers of the cluster when your |
|
|
|
|
// model requires more computation than the standard machine can handle |
|
|
|
|
// satisfactorily. |
|
|
|
|
// </dd> |
|
|
|
|
// <dt>complex_model_m</dt> |
|
|
|
|
// <dd> |
|
|
|
|
// A machine with roughly twice the number of cores and roughly double the |
|
|
|
|
// memory of `complex_model_s`. |
|
|
|
|
// </dd> |
|
|
|
|
// <dt>complex_model_l</dt> |
|
|
|
|
// <dd> |
|
|
|
|
// A machine with roughly twice the number of cores and roughly double the |
|
|
|
|
// memory of `complex_model_m`. |
|
|
|
|
// </dd> |
|
|
|
|
// </dl> |
|
|
|
|
// |
|
|
|
|
// Cannot be used in combination with a standard scale tier. |
|
|
|
|
// This value can only be used when `ScaleTier` is set to `CUSTOM`. |
|
|
|
|
string master_type = 2; |
|
|
|
|
|
|
|
|
|
// Optional. Specifies the worker machine type. |
|
|
|
|
// The following types are supported: |
|
|
|
|
// Optional. Specifies the type of virtual machine to use for your training |
|
|
|
|
// job's worker nodes. |
|
|
|
|
// |
|
|
|
|
// - `standard` |
|
|
|
|
// - `large_model` |
|
|
|
|
// - `complex_model_s` |
|
|
|
|
// - `complex_model_m` |
|
|
|
|
// - `complex_model_l` |
|
|
|
|
// The supported values are the same as those described in the entry for |
|
|
|
|
// `master_type`. |
|
|
|
|
// |
|
|
|
|
// Cannot be used in combination with a standard scale tier. |
|
|
|
|
// This value must be present when `scale_tier` is set to `CUSTOM` and |
|
|
|
|
// `worker_count` is greater than zero. |
|
|
|
|
string worker_type = 3; |
|
|
|
|
|
|
|
|
|
// Optional. Specifies the parameter server machine type. |
|
|
|
|
// The following types are supported: |
|
|
|
|
// Optional. Specifies the type of virtual machine to use for your training |
|
|
|
|
// job's parameter server. |
|
|
|
|
// |
|
|
|
|
// - `standard` |
|
|
|
|
// - `large_model` |
|
|
|
|
// - `complex_model_s` |
|
|
|
|
// - `complex_model_m` |
|
|
|
|
// - `complex_model_l` |
|
|
|
|
// The supported values are the same as those described in the entry for |
|
|
|
|
// `master_type`. |
|
|
|
|
// |
|
|
|
|
// Cannot be used in combination with a standard scale tier. |
|
|
|
|
// This value must be present when `scale_tier` is set to `CUSTOM` and |
|
|
|
|
// `parameter_server_count` is greater than zero. |
|
|
|
|
string parameter_server_type = 4; |
|
|
|
|
|
|
|
|
|
// Optional. Specifies the required amount of worker replicas. |
|
|
|
|
// Cannot be used in combination with a standard scale tier. |
|
|
|
|
// Optional. The number of worker replicas to use for the training job. Each |
|
|
|
|
// replica in the cluster will be of the type specified in `worker_type`. |
|
|
|
|
// |
|
|
|
|
// This value can only be used when `scale_tier` is set to `CUSTOM`. If you |
|
|
|
|
// set this value, you must also set `worker_type`. |
|
|
|
|
int64 worker_count = 5; |
|
|
|
|
|
|
|
|
|
// Optional. Specifies the required amount of parameter server replicas. |
|
|
|
|
// Cannot be used in combination with a standard scale tier. |
|
|
|
|
// Optional. The number of parameter server replicas to use for the training |
|
|
|
|
// job. Each replica in the cluster will be of the type specified in |
|
|
|
|
// `parameter_server_type`. |
|
|
|
|
// |
|
|
|
|
// This value can only be used when `scale_tier` is set to `CUSTOM`.If you |
|
|
|
|
// set this value, you must also set `parameter_server_type`. |
|
|
|
|
int64 parameter_server_count = 6; |
|
|
|
|
|
|
|
|
|
// Required. The Google Cloud Storage location of the packages with |
|
|
|
@ -146,7 +181,7 @@ message TrainingInput { |
|
|
|
|
|
|
|
|
|
// Represents a set of hyperparameters to optimize. |
|
|
|
|
message HyperparameterSpec { |
|
|
|
|
// The optimization goal of the objective value. |
|
|
|
|
// The available types of optimization goals. |
|
|
|
|
enum GoalType { |
|
|
|
|
// Goal Type will default to maximize. |
|
|
|
|
GOAL_TYPE_UNSPECIFIED = 0; |
|
|
|
@ -158,20 +193,30 @@ message HyperparameterSpec { |
|
|
|
|
MINIMIZE = 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Required. Should the evaluation metric be maximized or minimized? |
|
|
|
|
// Required. The type of goal to use for tuning. Available types are |
|
|
|
|
// `MAXIMIZE` and `MINIMIZE`. |
|
|
|
|
// |
|
|
|
|
// Defaults to `MAXIMIZE`. |
|
|
|
|
GoalType goal = 1; |
|
|
|
|
|
|
|
|
|
// Required. The set of parameters to tune. |
|
|
|
|
repeated ParameterSpec params = 2; |
|
|
|
|
|
|
|
|
|
// Optional. How many training trials should be attempted to optimize. |
|
|
|
|
// Optional. How many training trials should be attempted to optimize |
|
|
|
|
// the specified hyperparameters. |
|
|
|
|
// |
|
|
|
|
// Defaults to one. |
|
|
|
|
int32 max_trials = 3; |
|
|
|
|
|
|
|
|
|
// Optional. How many training trials should be run in parallel. |
|
|
|
|
// More parallelization will be faster, but parallel trials only benefit |
|
|
|
|
// from the information gained by previous trials. |
|
|
|
|
// Optional. The number of training trials to run concurrently. |
|
|
|
|
// You can reduce the time it takes to perform hyperparameter tuning by adding |
|
|
|
|
// trials in parallel. However, each trail only benefits from the information |
|
|
|
|
// gained in completed trials. That means that a trial does not get access to |
|
|
|
|
// the results of trials running at the same time, which could reduce the |
|
|
|
|
// quality of the overall optimization. |
|
|
|
|
// |
|
|
|
|
// Each trial will use the same scale tier and machine types. |
|
|
|
|
// |
|
|
|
|
// Defaults to one. |
|
|
|
|
int32 max_parallel_trials = 4; |
|
|
|
|
} |
|
|
|
@ -180,8 +225,8 @@ message HyperparameterSpec { |
|
|
|
|
message ParameterSpec { |
|
|
|
|
// The type of the parameter. |
|
|
|
|
enum ParameterType { |
|
|
|
|
// Parameter type must be specified. Unspecified values will be treated |
|
|
|
|
// as an error. |
|
|
|
|
// You must specify a valid type. Using this unspecified type will result in |
|
|
|
|
// an error. |
|
|
|
|
PARAMETER_TYPE_UNSPECIFIED = 0; |
|
|
|
|
|
|
|
|
|
// Type for real-valued parameters. |
|
|
|
@ -243,7 +288,7 @@ message ParameterSpec { |
|
|
|
|
// A list of feasible points. |
|
|
|
|
// The list should be in strictly increasing order. For instance, this |
|
|
|
|
// parameter might have possible settings of 1.5, 2.5, and 4.0. This list |
|
|
|
|
// shouldn't be too large - probably not more than 1,000 points. |
|
|
|
|
// should not contain more than 1,000 values. |
|
|
|
|
repeated double discrete_values = 6; |
|
|
|
|
|
|
|
|
|
// Optional. How the parameter should be scaled to the hypercube. |
|
|
|
@ -253,7 +298,10 @@ message ParameterSpec { |
|
|
|
|
ScaleType scale_type = 7; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Represents the result of a hyperparameter tuning trial from a training job. |
|
|
|
|
// Represents the result of a single hyperparameter tuning trial from a |
|
|
|
|
// training job. The TrainingOutput object that is returned on successful |
|
|
|
|
// completion of a training job with hyperparameter tuning includes a list |
|
|
|
|
// of HyperparameterOutput objects, one for each successful trial. |
|
|
|
|
message HyperparameterOutput { |
|
|
|
|
// An observed value of a metric. |
|
|
|
|
message HyperparameterMetric { |
|
|
|
@ -279,7 +327,7 @@ message HyperparameterOutput { |
|
|
|
|
|
|
|
|
|
// Represents results of a training job. |
|
|
|
|
message TrainingOutput { |
|
|
|
|
// The number of tuning trials completed successfully. |
|
|
|
|
// The number of hyperparameter tuning trials that completed successfully. |
|
|
|
|
int64 completed_trial_count = 1; |
|
|
|
|
|
|
|
|
|
// Results for individual Hyperparameter trials. |
|
|
|
@ -299,16 +347,24 @@ message PredictionInput { |
|
|
|
|
|
|
|
|
|
// The source file is a TFRecord file. |
|
|
|
|
TF_RECORD = 2; |
|
|
|
|
|
|
|
|
|
// The source file is a GZIP-compressed TFRecord file. |
|
|
|
|
TF_RECORD_GZIP = 3; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Required. The model or the version to use for prediction. |
|
|
|
|
oneof model_version { |
|
|
|
|
// The name of the model. The default version will be used. |
|
|
|
|
// E.g "project/your_project/models/your_model" |
|
|
|
|
// Use this field if you want to use the default version for the specified |
|
|
|
|
// model. The string must use the following format: |
|
|
|
|
// |
|
|
|
|
// `"project/<var>[YOUR_PROJECT]</var>/models/<var>[YOUR_MODEL]</var>"` |
|
|
|
|
string model_name = 1; |
|
|
|
|
|
|
|
|
|
// The version to be used. |
|
|
|
|
// E.g "project/your_project/models/your_model/versions/your_version" |
|
|
|
|
// Use this field if you want to specify a version of the model to use. The |
|
|
|
|
// string is formatted the same way as `model_version`, with the addition |
|
|
|
|
// of the version information: |
|
|
|
|
// |
|
|
|
|
// `"project/<var>[YOUR_PROJECT]</var>/models/<var>YOUR_MODEL/versions/<var>[YOUR_VERSION]</var>"` |
|
|
|
|
string version_name = 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -349,13 +405,13 @@ message Job { |
|
|
|
|
// The job state is unspecified. |
|
|
|
|
STATE_UNSPECIFIED = 0; |
|
|
|
|
|
|
|
|
|
// The job has been just created and is awaiting to be processed. |
|
|
|
|
// The job has been just created and processing has not yet begun. |
|
|
|
|
QUEUED = 1; |
|
|
|
|
|
|
|
|
|
// The job is being prepared to run. |
|
|
|
|
// The service is preparing to run the job. |
|
|
|
|
PREPARING = 2; |
|
|
|
|
|
|
|
|
|
// Training or prediction is in progress. |
|
|
|
|
// The job is in progress. |
|
|
|
|
RUNNING = 3; |
|
|
|
|
|
|
|
|
|
// The job completed successfully. |
|
|
|
@ -414,6 +470,7 @@ message Job { |
|
|
|
|
// Request message for the CreateJob method. |
|
|
|
|
message CreateJobRequest { |
|
|
|
|
// Required. The project name. |
|
|
|
|
// |
|
|
|
|
// Authorization: requires `Editor` role on the specified project. |
|
|
|
|
string parent = 1; |
|
|
|
|
|
|
|
|
@ -423,20 +480,25 @@ message CreateJobRequest { |
|
|
|
|
|
|
|
|
|
// Request message for the ListJobs method. |
|
|
|
|
message ListJobsRequest { |
|
|
|
|
// Required. The name of the project whose jobs are to be listed. |
|
|
|
|
// Required. The name of the project for which to list jobs. |
|
|
|
|
// |
|
|
|
|
// Authorization: requires `Viewer` role on the specified project. |
|
|
|
|
string parent = 1; |
|
|
|
|
|
|
|
|
|
// Optional. Specifies the subset of jobs to retrieve. |
|
|
|
|
string filter = 2; |
|
|
|
|
|
|
|
|
|
// Optional. Specifies the ordering of the jobs. |
|
|
|
|
string order_by = 3; |
|
|
|
|
|
|
|
|
|
// Optional. A token for continuing the enumeration. |
|
|
|
|
// Optional. A page token to request the next page of results. |
|
|
|
|
// |
|
|
|
|
// You get the token from the `next_page_token` field of the response from |
|
|
|
|
// the previous call. |
|
|
|
|
string page_token = 4; |
|
|
|
|
|
|
|
|
|
// Optional. The page size. |
|
|
|
|
// Optional. The number of jobs to retrieve per "page" of results. If there |
|
|
|
|
// are more remaining results than this number, the response message will |
|
|
|
|
// contain a valid value in the `next_page_token` field. |
|
|
|
|
// |
|
|
|
|
// The default value is 20, and the maximum page size is 100. |
|
|
|
|
int32 page_size = 5; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -445,20 +507,23 @@ message ListJobsResponse { |
|
|
|
|
// The list of jobs. |
|
|
|
|
repeated Job jobs = 1; |
|
|
|
|
|
|
|
|
|
// Optional pagination token to use for retrieving the next page of results. |
|
|
|
|
// Optional. Pass this token as the `page_token` field of the request for a |
|
|
|
|
// subsequent call. |
|
|
|
|
string next_page_token = 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Request message for the GetJob method. |
|
|
|
|
message GetJobRequest { |
|
|
|
|
// Required. The name of the job. |
|
|
|
|
// Required. The name of the job to get the description of. |
|
|
|
|
// |
|
|
|
|
// Authorization: requires `Viewer` role on the parent project. |
|
|
|
|
string name = 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Request message for the CancelJob method. |
|
|
|
|
message CancelJobRequest { |
|
|
|
|
// Required. The name of the job. |
|
|
|
|
// Required. The name of the job to cancel. |
|
|
|
|
// |
|
|
|
|
// Authorization: requires `Editor` role on the parent project. |
|
|
|
|
string name = 1; |
|
|
|
|
} |
|
|
|
|