-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from thodkatz/add-training-servicer
Add training service
- Loading branch information
Showing
33 changed files
with
2,169 additions
and
656 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
syntax = "proto3"; | ||
|
||
package training; | ||
|
||
import "utils.proto"; | ||
|
||
|
||
|
||
service Training { | ||
rpc ListDevices(Empty) returns (Devices) {} | ||
|
||
rpc Init(TrainingConfig) returns (TrainingSessionId) {} | ||
|
||
rpc Start(TrainingSessionId) returns (Empty) {} | ||
|
||
rpc Resume(TrainingSessionId) returns (Empty) {} | ||
|
||
rpc Pause(TrainingSessionId) returns (Empty) {} | ||
|
||
rpc StreamUpdates(TrainingSessionId) returns (stream StreamUpdateResponse) {} | ||
|
||
rpc GetLogs(TrainingSessionId) returns (GetLogsResponse) {} | ||
|
||
rpc Save(TrainingSessionId) returns (Empty) {} | ||
|
||
rpc Export(TrainingSessionId) returns (Empty) {} | ||
|
||
rpc Predict(PredictRequest) returns (PredictResponse) {} | ||
|
||
rpc GetStatus(TrainingSessionId) returns (GetStatusResponse) {} | ||
|
||
rpc CloseTrainerSession(TrainingSessionId) returns (Empty) {} | ||
} | ||
|
||
message TrainingSessionId { | ||
string id = 1; | ||
} | ||
|
||
message Logs { | ||
enum ModelPhase { | ||
Train = 0; | ||
Eval = 1; | ||
} | ||
ModelPhase mode = 1; | ||
double eval_score = 2; | ||
double loss = 3; | ||
uint32 iteration = 4; | ||
} | ||
|
||
|
||
message StreamUpdateResponse { | ||
uint32 best_model_idx = 1; | ||
Logs logs = 2; | ||
} | ||
|
||
|
||
message GetLogsResponse { | ||
repeated Logs logs = 1; | ||
} | ||
|
||
|
||
|
||
message PredictRequest { | ||
repeated Tensor tensors = 1; | ||
TrainingSessionId sessionId = 2; | ||
} | ||
|
||
|
||
message PredictResponse { | ||
repeated Tensor tensors = 1; | ||
} | ||
|
||
message ValidationResponse { | ||
double validation_score_average = 1; | ||
} | ||
|
||
message GetStatusResponse { | ||
enum State { | ||
Idle = 0; | ||
Running = 1; | ||
Paused = 2; | ||
Failed = 3; | ||
Finished = 4; | ||
} | ||
State state = 1; | ||
} | ||
|
||
|
||
message GetCurrentBestModelIdxResponse { | ||
uint32 id = 1; | ||
} | ||
|
||
message TrainingConfig { | ||
string yaml_content = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
syntax = "proto3"; | ||
|
||
message Empty {} | ||
|
||
message NamedInt { | ||
uint32 size = 1; | ||
string name = 2; | ||
} | ||
|
||
message NamedFloat { | ||
float size = 1; | ||
string name = 2; | ||
} | ||
|
||
message Tensor { | ||
bytes buffer = 1; | ||
string dtype = 2; | ||
string tensorId = 3; | ||
repeated NamedInt shape = 4; | ||
} | ||
|
||
message Device { | ||
enum Status { | ||
AVAILABLE = 0; | ||
IN_USE = 1; | ||
} | ||
|
||
string id = 1; | ||
Status status = 2; | ||
} | ||
|
||
message Devices { | ||
repeated Device devices = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[pytest] | ||
python_files = test_*.py | ||
addopts = | ||
--timeout 10 | ||
--timeout 60 | ||
-v | ||
-s | ||
--color=yes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.