xref: /aosp_15_r20/external/tensorflow/tensorflow/core/data/service/journal.proto (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1syntax = "proto3";
2
3package tensorflow.data;
4
5import "tensorflow/core/data/service/common.proto";
6import "tensorflow/core/protobuf/data_service.proto";
7
8// Message representing journaled dispatcher metadata updates. When we apply
9// one of these changes to the dispatcher's in-memory state, we also write an
10// Update message to the journal.
11// Next tag: 15
12message Update {
13  oneof update_type {
14    RegisterDatasetUpdate register_dataset = 1;
15    RegisterWorkerUpdate register_worker = 5;
16    CreateJobUpdate create_job = 14;
17    CreateIterationUpdate create_iteration = 2;
18    ProduceSplitUpdate produce_split = 8;
19    AcquireIterationClientUpdate acquire_iteration_client = 6;
20    ReleaseIterationClientUpdate release_iteration_client = 7;
21    GarbageCollectIterationUpdate garbage_collect_iteration = 12;
22    RemoveTaskUpdate remove_task = 11;
23    CreatePendingTaskUpdate create_pending_task = 9;
24    ClientHeartbeatUpdate client_heartbeat = 10;
25    CreateTaskUpdate create_task = 3;
26    FinishTaskUpdate finish_task = 4;
27  }
28  reserved 13;
29}
30
31// Next tag: 5
32message RegisterDatasetUpdate {
33  string dataset_id = 1;
34  uint64 fingerprint = 2;
35  DataServiceMetadata metadata = 3;
36  bool dedupe_by_dataset_id = 4;
37}
38
39// Next tag: 5
40message RegisterWorkerUpdate {
41  string worker_address = 1;
42  string transfer_address = 2;
43  repeated string worker_tags = 3;
44  int64 worker_uid = 4;
45}
46
47// Next tag: 9
48message CreateJobUpdate {
49  int64 job_id = 1;
50  string job_name = 2;
51  string dataset_id = 3;
52  ProcessingModeDef processing_mode_def = 4;
53  // Optional number of consumers. If set, the iteration's tasks will provide
54  // their elements to consumers round-robin.
55  oneof optional_num_consumers {
56    int64 num_consumers = 6;
57  }
58  // Specifies which workers the client of this iteration reads from.
59  TargetWorkers target_workers = 7;
60  // True if cross-trainer cache is enabled.
61  bool use_cross_trainer_cache = 8;
62}
63
64// Next tag: 5
65message CreateIterationUpdate {
66  int64 iteration_id = 1;
67  int64 job_id = 2;
68  int64 repetition = 3;
69  int64 num_split_providers = 4;
70}
71
72// Next tag: 5
73message ProduceSplitUpdate {
74  int64 iteration_id = 1;
75  int64 repetition = 2;
76  int64 split_provider_index = 4;
77  // Whether the split provider reached its end.
78  bool finished = 3;
79}
80
81// Next tag: 3
82message AcquireIterationClientUpdate {
83  int64 iteration_id = 1;
84  int64 iteration_client_id = 2;
85}
86
87// Next tag: 3
88message ReleaseIterationClientUpdate {
89  int64 iteration_client_id = 1;
90  // The time when the client was released, measured in microseconds since the
91  // epoch.
92  int64 time_micros = 2;
93}
94
95// Next tag: 2
96message GarbageCollectIterationUpdate {
97  int64 iteration_id = 1;
98}
99
100// Next tag: 2
101message RemoveTaskUpdate {
102  int64 task_id = 1;
103}
104
105// Indicates that a client failed to block before reaching the target round.
106// Next tag: 2
107message TaskRejected {
108  // A new target round to try adding the task in.
109  int64 new_target_round = 1;
110}
111
112// Updates dispatcher state based on a client heartbeat.
113// Next tag: 4
114message ClientHeartbeatUpdate {
115  int64 iteration_client_id = 1;
116  bool task_accepted = 2;
117  TaskRejected task_rejected = 3;
118}
119
120// Next tag: 8
121message CreatePendingTaskUpdate {
122  int64 task_id = 1;
123  int64 iteration_id = 2;
124  string worker_address = 3;
125  string transfer_address = 4;
126  repeated string worker_tags = 6;
127  int64 worker_uid = 7;
128  int64 starting_round = 5;
129}
130
131// Next tag: 9
132message CreateTaskUpdate {
133  reserved 3, 5;
134  int64 task_id = 1;
135  int64 iteration_id = 2;
136  string worker_address = 4;
137  string transfer_address = 6;
138  repeated string worker_tags = 7;
139  int64 worker_uid = 8;
140}
141
142// Next tag: 2
143message FinishTaskUpdate {
144  int64 task_id = 1;
145}
146