vizier_service.proto 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.aiplatform.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/aiplatform/v1/operation.proto";
  21. import "google/cloud/aiplatform/v1/study.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/empty.proto";
  24. import "google/protobuf/timestamp.proto";
  25. option csharp_namespace = "Google.Cloud.AIPlatform.V1";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "VizierServiceProto";
  29. option java_package = "com.google.cloud.aiplatform.v1";
  30. option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
  31. option ruby_package = "Google::Cloud::AIPlatform::V1";
  32. // Vertex AI Vizier API.
  33. //
  34. // Vertex AI Vizier is a service to solve blackbox optimization problems,
  35. // such as tuning machine learning hyperparameters and searching over deep
  36. // learning architectures.
  37. service VizierService {
  38. option (google.api.default_host) = "aiplatform.googleapis.com";
  39. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  40. // Creates a Study. A resource name will be generated after creation of the
  41. // Study.
  42. rpc CreateStudy(CreateStudyRequest) returns (Study) {
  43. option (google.api.http) = {
  44. post: "/v1/{parent=projects/*/locations/*}/studies"
  45. body: "study"
  46. };
  47. option (google.api.method_signature) = "parent,study";
  48. }
  49. // Gets a Study by name.
  50. rpc GetStudy(GetStudyRequest) returns (Study) {
  51. option (google.api.http) = {
  52. get: "/v1/{name=projects/*/locations/*/studies/*}"
  53. };
  54. option (google.api.method_signature) = "name";
  55. }
  56. // Lists all the studies in a region for an associated project.
  57. rpc ListStudies(ListStudiesRequest) returns (ListStudiesResponse) {
  58. option (google.api.http) = {
  59. get: "/v1/{parent=projects/*/locations/*}/studies"
  60. };
  61. option (google.api.method_signature) = "parent";
  62. }
  63. // Deletes a Study.
  64. rpc DeleteStudy(DeleteStudyRequest) returns (google.protobuf.Empty) {
  65. option (google.api.http) = {
  66. delete: "/v1/{name=projects/*/locations/*/studies/*}"
  67. };
  68. option (google.api.method_signature) = "name";
  69. }
  70. // Looks a study up using the user-defined display_name field instead of the
  71. // fully qualified resource name.
  72. rpc LookupStudy(LookupStudyRequest) returns (Study) {
  73. option (google.api.http) = {
  74. post: "/v1/{parent=projects/*/locations/*}/studies:lookup"
  75. body: "*"
  76. };
  77. option (google.api.method_signature) = "parent";
  78. }
  79. // Adds one or more Trials to a Study, with parameter values
  80. // suggested by Vertex AI Vizier. Returns a long-running
  81. // operation associated with the generation of Trial suggestions.
  82. // When this long-running operation succeeds, it will contain
  83. // a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].
  84. rpc SuggestTrials(SuggestTrialsRequest) returns (google.longrunning.Operation) {
  85. option (google.api.http) = {
  86. post: "/v1/{parent=projects/*/locations/*/studies/*}/trials:suggest"
  87. body: "*"
  88. };
  89. option (google.longrunning.operation_info) = {
  90. response_type: "SuggestTrialsResponse"
  91. metadata_type: "SuggestTrialsMetadata"
  92. };
  93. }
  94. // Adds a user provided Trial to a Study.
  95. rpc CreateTrial(CreateTrialRequest) returns (Trial) {
  96. option (google.api.http) = {
  97. post: "/v1/{parent=projects/*/locations/*/studies/*}/trials"
  98. body: "trial"
  99. };
  100. option (google.api.method_signature) = "parent,trial";
  101. }
  102. // Gets a Trial.
  103. rpc GetTrial(GetTrialRequest) returns (Trial) {
  104. option (google.api.http) = {
  105. get: "/v1/{name=projects/*/locations/*/studies/*/trials/*}"
  106. };
  107. option (google.api.method_signature) = "name";
  108. }
  109. // Lists the Trials associated with a Study.
  110. rpc ListTrials(ListTrialsRequest) returns (ListTrialsResponse) {
  111. option (google.api.http) = {
  112. get: "/v1/{parent=projects/*/locations/*/studies/*}/trials"
  113. };
  114. option (google.api.method_signature) = "parent";
  115. }
  116. // Adds a measurement of the objective metrics to a Trial. This measurement
  117. // is assumed to have been taken before the Trial is complete.
  118. rpc AddTrialMeasurement(AddTrialMeasurementRequest) returns (Trial) {
  119. option (google.api.http) = {
  120. post: "/v1/{trial_name=projects/*/locations/*/studies/*/trials/*}:addTrialMeasurement"
  121. body: "*"
  122. };
  123. }
  124. // Marks a Trial as complete.
  125. rpc CompleteTrial(CompleteTrialRequest) returns (Trial) {
  126. option (google.api.http) = {
  127. post: "/v1/{name=projects/*/locations/*/studies/*/trials/*}:complete"
  128. body: "*"
  129. };
  130. }
  131. // Deletes a Trial.
  132. rpc DeleteTrial(DeleteTrialRequest) returns (google.protobuf.Empty) {
  133. option (google.api.http) = {
  134. delete: "/v1/{name=projects/*/locations/*/studies/*/trials/*}"
  135. };
  136. option (google.api.method_signature) = "name";
  137. }
  138. // Checks whether a Trial should stop or not. Returns a
  139. // long-running operation. When the operation is successful,
  140. // it will contain a
  141. // [CheckTrialEarlyStoppingStateResponse][google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse].
  142. rpc CheckTrialEarlyStoppingState(CheckTrialEarlyStoppingStateRequest) returns (google.longrunning.Operation) {
  143. option (google.api.http) = {
  144. post: "/v1/{trial_name=projects/*/locations/*/studies/*/trials/*}:checkTrialEarlyStoppingState"
  145. body: "*"
  146. };
  147. option (google.longrunning.operation_info) = {
  148. response_type: "CheckTrialEarlyStoppingStateResponse"
  149. metadata_type: "CheckTrialEarlyStoppingStateMetatdata"
  150. };
  151. }
  152. // Stops a Trial.
  153. rpc StopTrial(StopTrialRequest) returns (Trial) {
  154. option (google.api.http) = {
  155. post: "/v1/{name=projects/*/locations/*/studies/*/trials/*}:stop"
  156. body: "*"
  157. };
  158. }
  159. // Lists the pareto-optimal Trials for multi-objective Study or the
  160. // optimal Trials for single-objective Study. The definition of
  161. // pareto-optimal can be checked in wiki page.
  162. // https://en.wikipedia.org/wiki/Pareto_efficiency
  163. rpc ListOptimalTrials(ListOptimalTrialsRequest) returns (ListOptimalTrialsResponse) {
  164. option (google.api.http) = {
  165. post: "/v1/{parent=projects/*/locations/*/studies/*}/trials:listOptimalTrials"
  166. body: "*"
  167. };
  168. option (google.api.method_signature) = "parent";
  169. }
  170. }
  171. // Request message for [VizierService.GetStudy][google.cloud.aiplatform.v1.VizierService.GetStudy].
  172. message GetStudyRequest {
  173. // Required. The name of the Study resource.
  174. // Format: `projects/{project}/locations/{location}/studies/{study}`
  175. string name = 1 [
  176. (google.api.field_behavior) = REQUIRED,
  177. (google.api.resource_reference) = {
  178. type: "aiplatform.googleapis.com/Study"
  179. }
  180. ];
  181. }
  182. // Request message for [VizierService.CreateStudy][google.cloud.aiplatform.v1.VizierService.CreateStudy].
  183. message CreateStudyRequest {
  184. // Required. The resource name of the Location to create the CustomJob in.
  185. // Format: `projects/{project}/locations/{location}`
  186. string parent = 1 [
  187. (google.api.field_behavior) = REQUIRED,
  188. (google.api.resource_reference) = {
  189. type: "locations.googleapis.com/Location"
  190. }
  191. ];
  192. // Required. The Study configuration used to create the Study.
  193. Study study = 2 [(google.api.field_behavior) = REQUIRED];
  194. }
  195. // Request message for [VizierService.ListStudies][google.cloud.aiplatform.v1.VizierService.ListStudies].
  196. message ListStudiesRequest {
  197. // Required. The resource name of the Location to list the Study from.
  198. // Format: `projects/{project}/locations/{location}`
  199. string parent = 1 [
  200. (google.api.field_behavior) = REQUIRED,
  201. (google.api.resource_reference) = {
  202. type: "locations.googleapis.com/Location"
  203. }
  204. ];
  205. // Optional. A page token to request the next page of results.
  206. // If unspecified, there are no subsequent pages.
  207. string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
  208. // Optional. The maximum number of studies to return per "page" of results.
  209. // If unspecified, service will pick an appropriate default.
  210. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  211. }
  212. // Response message for [VizierService.ListStudies][google.cloud.aiplatform.v1.VizierService.ListStudies].
  213. message ListStudiesResponse {
  214. // The studies associated with the project.
  215. repeated Study studies = 1;
  216. // Passes this token as the `page_token` field of the request for a
  217. // subsequent call.
  218. // If this field is omitted, there are no subsequent pages.
  219. string next_page_token = 2;
  220. }
  221. // Request message for [VizierService.DeleteStudy][google.cloud.aiplatform.v1.VizierService.DeleteStudy].
  222. message DeleteStudyRequest {
  223. // Required. The name of the Study resource to be deleted.
  224. // Format: `projects/{project}/locations/{location}/studies/{study}`
  225. string name = 1 [
  226. (google.api.field_behavior) = REQUIRED,
  227. (google.api.resource_reference) = {
  228. type: "aiplatform.googleapis.com/Study"
  229. }
  230. ];
  231. }
  232. // Request message for [VizierService.LookupStudy][google.cloud.aiplatform.v1.VizierService.LookupStudy].
  233. message LookupStudyRequest {
  234. // Required. The resource name of the Location to get the Study from.
  235. // Format: `projects/{project}/locations/{location}`
  236. string parent = 1 [
  237. (google.api.field_behavior) = REQUIRED,
  238. (google.api.resource_reference) = {
  239. type: "locations.googleapis.com/Location"
  240. }
  241. ];
  242. // Required. The user-defined display name of the Study
  243. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  244. }
  245. // Request message for [VizierService.SuggestTrials][google.cloud.aiplatform.v1.VizierService.SuggestTrials].
  246. message SuggestTrialsRequest {
  247. // Required. The project and location that the Study belongs to.
  248. // Format: `projects/{project}/locations/{location}/studies/{study}`
  249. string parent = 1 [
  250. (google.api.field_behavior) = REQUIRED,
  251. (google.api.resource_reference) = {
  252. type: "aiplatform.googleapis.com/Study"
  253. }
  254. ];
  255. // Required. The number of suggestions requested. It must be positive.
  256. int32 suggestion_count = 2 [(google.api.field_behavior) = REQUIRED];
  257. // Required. The identifier of the client that is requesting the suggestion.
  258. //
  259. // If multiple SuggestTrialsRequests have the same `client_id`,
  260. // the service will return the identical suggested Trial if the Trial is
  261. // pending, and provide a new Trial if the last suggested Trial was completed.
  262. string client_id = 3 [(google.api.field_behavior) = REQUIRED];
  263. }
  264. // Response message for [VizierService.SuggestTrials][google.cloud.aiplatform.v1.VizierService.SuggestTrials].
  265. message SuggestTrialsResponse {
  266. // A list of Trials.
  267. repeated Trial trials = 1;
  268. // The state of the Study.
  269. Study.State study_state = 2;
  270. // The time at which the operation was started.
  271. google.protobuf.Timestamp start_time = 3;
  272. // The time at which operation processing completed.
  273. google.protobuf.Timestamp end_time = 4;
  274. }
  275. // Details of operations that perform Trials suggestion.
  276. message SuggestTrialsMetadata {
  277. // Operation metadata for suggesting Trials.
  278. GenericOperationMetadata generic_metadata = 1;
  279. // The identifier of the client that is requesting the suggestion.
  280. //
  281. // If multiple SuggestTrialsRequests have the same `client_id`,
  282. // the service will return the identical suggested Trial if the Trial is
  283. // pending, and provide a new Trial if the last suggested Trial was completed.
  284. string client_id = 2;
  285. }
  286. // Request message for [VizierService.CreateTrial][google.cloud.aiplatform.v1.VizierService.CreateTrial].
  287. message CreateTrialRequest {
  288. // Required. The resource name of the Study to create the Trial in.
  289. // Format: `projects/{project}/locations/{location}/studies/{study}`
  290. string parent = 1 [
  291. (google.api.field_behavior) = REQUIRED,
  292. (google.api.resource_reference) = {
  293. type: "aiplatform.googleapis.com/Study"
  294. }
  295. ];
  296. // Required. The Trial to create.
  297. Trial trial = 2 [(google.api.field_behavior) = REQUIRED];
  298. }
  299. // Request message for [VizierService.GetTrial][google.cloud.aiplatform.v1.VizierService.GetTrial].
  300. message GetTrialRequest {
  301. // Required. The name of the Trial resource.
  302. // Format:
  303. // `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
  304. string name = 1 [
  305. (google.api.field_behavior) = REQUIRED,
  306. (google.api.resource_reference) = {
  307. type: "aiplatform.googleapis.com/Trial"
  308. }
  309. ];
  310. }
  311. // Request message for [VizierService.ListTrials][google.cloud.aiplatform.v1.VizierService.ListTrials].
  312. message ListTrialsRequest {
  313. // Required. The resource name of the Study to list the Trial from.
  314. // Format: `projects/{project}/locations/{location}/studies/{study}`
  315. string parent = 1 [
  316. (google.api.field_behavior) = REQUIRED,
  317. (google.api.resource_reference) = {
  318. type: "aiplatform.googleapis.com/Study"
  319. }
  320. ];
  321. // Optional. A page token to request the next page of results.
  322. // If unspecified, there are no subsequent pages.
  323. string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
  324. // Optional. The number of Trials to retrieve per "page" of results.
  325. // If unspecified, the service will pick an appropriate default.
  326. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  327. }
  328. // Response message for [VizierService.ListTrials][google.cloud.aiplatform.v1.VizierService.ListTrials].
  329. message ListTrialsResponse {
  330. // The Trials associated with the Study.
  331. repeated Trial trials = 1;
  332. // Pass this token as the `page_token` field of the request for a
  333. // subsequent call.
  334. // If this field is omitted, there are no subsequent pages.
  335. string next_page_token = 2;
  336. }
  337. // Request message for [VizierService.AddTrialMeasurement][google.cloud.aiplatform.v1.VizierService.AddTrialMeasurement].
  338. message AddTrialMeasurementRequest {
  339. // Required. The name of the trial to add measurement.
  340. // Format:
  341. // `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
  342. string trial_name = 1 [
  343. (google.api.field_behavior) = REQUIRED,
  344. (google.api.resource_reference) = {
  345. type: "aiplatform.googleapis.com/Trial"
  346. }
  347. ];
  348. // Required. The measurement to be added to a Trial.
  349. Measurement measurement = 3 [(google.api.field_behavior) = REQUIRED];
  350. }
  351. // Request message for [VizierService.CompleteTrial][google.cloud.aiplatform.v1.VizierService.CompleteTrial].
  352. message CompleteTrialRequest {
  353. // Required. The Trial's name.
  354. // Format:
  355. // `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
  356. string name = 1 [
  357. (google.api.field_behavior) = REQUIRED,
  358. (google.api.resource_reference) = {
  359. type: "aiplatform.googleapis.com/Trial"
  360. }
  361. ];
  362. // Optional. If provided, it will be used as the completed Trial's
  363. // final_measurement; Otherwise, the service will auto-select a
  364. // previously reported measurement as the final-measurement
  365. Measurement final_measurement = 2 [(google.api.field_behavior) = OPTIONAL];
  366. // Optional. True if the Trial cannot be run with the given Parameter, and
  367. // final_measurement will be ignored.
  368. bool trial_infeasible = 3 [(google.api.field_behavior) = OPTIONAL];
  369. // Optional. A human readable reason why the trial was infeasible. This should
  370. // only be provided if `trial_infeasible` is true.
  371. string infeasible_reason = 4 [(google.api.field_behavior) = OPTIONAL];
  372. }
  373. // Request message for [VizierService.DeleteTrial][google.cloud.aiplatform.v1.VizierService.DeleteTrial].
  374. message DeleteTrialRequest {
  375. // Required. The Trial's name.
  376. // Format:
  377. // `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
  378. string name = 1 [
  379. (google.api.field_behavior) = REQUIRED,
  380. (google.api.resource_reference) = {
  381. type: "aiplatform.googleapis.com/Trial"
  382. }
  383. ];
  384. }
  385. // Request message for [VizierService.CheckTrialEarlyStoppingState][google.cloud.aiplatform.v1.VizierService.CheckTrialEarlyStoppingState].
  386. message CheckTrialEarlyStoppingStateRequest {
  387. // Required. The Trial's name.
  388. // Format:
  389. // `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
  390. string trial_name = 1 [
  391. (google.api.field_behavior) = REQUIRED,
  392. (google.api.resource_reference) = {
  393. type: "aiplatform.googleapis.com/Trial"
  394. }
  395. ];
  396. }
  397. // Response message for [VizierService.CheckTrialEarlyStoppingState][google.cloud.aiplatform.v1.VizierService.CheckTrialEarlyStoppingState].
  398. message CheckTrialEarlyStoppingStateResponse {
  399. // True if the Trial should stop.
  400. bool should_stop = 1;
  401. }
  402. // This message will be placed in the metadata field of a
  403. // google.longrunning.Operation associated with a CheckTrialEarlyStoppingState
  404. // request.
  405. message CheckTrialEarlyStoppingStateMetatdata {
  406. // Operation metadata for suggesting Trials.
  407. GenericOperationMetadata generic_metadata = 1;
  408. // The name of the Study that the Trial belongs to.
  409. string study = 2;
  410. // The Trial name.
  411. string trial = 3;
  412. }
  413. // Request message for [VizierService.StopTrial][google.cloud.aiplatform.v1.VizierService.StopTrial].
  414. message StopTrialRequest {
  415. // Required. The Trial's name.
  416. // Format:
  417. // `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
  418. string name = 1 [
  419. (google.api.field_behavior) = REQUIRED,
  420. (google.api.resource_reference) = {
  421. type: "aiplatform.googleapis.com/Trial"
  422. }
  423. ];
  424. }
  425. // Request message for [VizierService.ListOptimalTrials][google.cloud.aiplatform.v1.VizierService.ListOptimalTrials].
  426. message ListOptimalTrialsRequest {
  427. // Required. The name of the Study that the optimal Trial belongs to.
  428. string parent = 1 [
  429. (google.api.field_behavior) = REQUIRED,
  430. (google.api.resource_reference) = {
  431. type: "aiplatform.googleapis.com/Study"
  432. }
  433. ];
  434. }
  435. // Response message for [VizierService.ListOptimalTrials][google.cloud.aiplatform.v1.VizierService.ListOptimalTrials].
  436. message ListOptimalTrialsResponse {
  437. // The pareto-optimal Trials for multiple objective Study or the
  438. // optimal trial for single objective Study. The definition of
  439. // pareto-optimal can be checked in wiki page.
  440. // https://en.wikipedia.org/wiki/Pareto_efficiency
  441. repeated Trial optimal_trials = 1;
  442. }