-
Notifications
You must be signed in to change notification settings - Fork 77
模型相关接口详解
forgivedengkai edited this page Feb 11, 2020
·
2 revisions
目前模型相关接口为grpc协议,调用方为fate-flow 。以下是接口的proto文件
syntax = "proto3";
package com.webank.ai.fate.api.mlmodel.manager;
option java_outer_classname = "ModelServiceProto";
message Party{
repeated string partyId = 1;
}
message LocalInfo{
string role = 1;
string partyId = 2;
}
message ModelInfo{
string tableName = 1;
string namespace = 2;
}
message RoleModelInfo{
map<string, ModelInfo> roleModelInfo = 1;
}
message PublishRequest{
LocalInfo local = 1;
map<string, Party> role = 2;
map<string, RoleModelInfo> model = 3;
string serviceId = 4;
}
message PublishResponse{
int32 statusCode = 1;
string message = 2;
string error = 3;
bytes data = 4;
}
service ModelService{
rpc publishLoad(PublishRequest) returns (PublishResponse);
rpc publishBind(PublishRequest) returns (PublishResponse);
rpc publishOnline(PublishRequest) returns (PublishResponse);
}
由上可以看出ModeService 总共三个接口
- publishLoad 在推送模型的时候,该接口会被首先调用,主要用于拉取模型的二进制数据,serving-server 收到请求之后,会根据接口中传入的模型相关的信息,如tableName,namespace拼接成能唯一代表模型的id,然后使用该id去FATE-FLOW中拉取模型的二进制数据。该接口在guest与host双方都会被调用。
- publishBind 该接口的作用是加载完模型的二进制数据之后,将该模型绑定至serviceId(该id在fate-flow推模型时填入或者由fate-flow自动生成)。该接口只会在guest方被调用
- publishOnline 该接口已废弃