1/** 2 * Copyright 2020 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16syntax = "proto3"; 17package mindspore.ps; 18option optimize_for = LITE_RUNTIME; 19 20message Command { 21 CommandCode cmd = 1; 22} 23 24enum CommandCode { 25 PUSH = 0; 26 PULL = 1; 27 INIT_EMBEDDING_TABLE = 2; 28 INIT_WEIGHT = 3; 29 INIT_WEIGHT_TO_OPTIM_ID = 4; 30 INIT_INPUTS_SHAPE = 5; 31 CHECK_READY_FOR_PUSH = 6; 32 CHECK_READY_FOR_PULL = 7; 33 EMBEDDING_LOOKUP = 8; 34 UPDATE_EMBEDDING = 9; 35 FINALIZE = 10; 36} 37 38message ParamInitInfoMessage { 39 string param_name = 1; 40 int32 param_type = 2; 41 uint64 global_seed = 3; 42 uint64 op_seed = 4; 43 float init_val = 5; 44} 45 46message KVMessage { 47 repeated uint64 keys = 2; 48 repeated float values = 3; 49 repeated uint64 len = 4; 50} 51 52message EmbeddingTableMeta { 53 uint64 key = 1; 54 repeated uint64 input_shape = 2; 55 repeated uint64 indices_shape = 3; 56 repeated uint64 output_shape = 4; 57 ParamInitInfoMessage info = 5; 58} 59 60message EmbeddingTableLookup { 61 uint64 key = 2; 62 repeated int32 keys = 3; 63 repeated float values = 4; 64} 65