parent
2ed6c25598
commit
b264e53300
@ -1,163 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INC_EXTERNAL_REGISTER_REGISTER_H_
|
|
||||||
#define INC_EXTERNAL_REGISTER_REGISTER_H_
|
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
#include <initializer_list>
|
|
||||||
#include <map>
|
|
||||||
#include <memory>
|
|
||||||
#include <set>
|
|
||||||
#include <string>
|
|
||||||
#include <utility>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "graph/operator.h"
|
|
||||||
#include "register/register_error_codes.h"
|
|
||||||
#include "register/register_fmk_types.h"
|
|
||||||
#include "register/register_types.h"
|
|
||||||
|
|
||||||
using std::make_shared;
|
|
||||||
using std::map;
|
|
||||||
using std::pair;
|
|
||||||
using std::string;
|
|
||||||
using std::to_string;
|
|
||||||
using std::unique_ptr;
|
|
||||||
using std::vector;
|
|
||||||
|
|
||||||
/*lint -e148*/
|
|
||||||
namespace ge {
|
|
||||||
class Operator;
|
|
||||||
class TensorDesc;
|
|
||||||
class Tensor;
|
|
||||||
class TBEPluginManager;
|
|
||||||
} // namespace ge
|
|
||||||
|
|
||||||
namespace google {
|
|
||||||
namespace protobuf {
|
|
||||||
class Message;
|
|
||||||
}
|
|
||||||
} // namespace google
|
|
||||||
|
|
||||||
namespace domi {
|
|
||||||
const int64_t kMaxNameLength = 1048576; // 1M
|
|
||||||
|
|
||||||
enum DynamicType { kInvalid = 0, kInput = 1, kOutput = 2 };
|
|
||||||
struct DynamicInputOutputInfo {
|
|
||||||
DynamicType type; // input/output
|
|
||||||
const char *port_name;
|
|
||||||
int64_t port_name_len;
|
|
||||||
const char *attr_name;
|
|
||||||
int64_t attr_name_len;
|
|
||||||
DynamicInputOutputInfo()
|
|
||||||
: type(kInvalid), port_name(nullptr), port_name_len(0), attr_name(nullptr), attr_name_len(0) {}
|
|
||||||
DynamicInputOutputInfo(DynamicType type, const char *port_name, int64_t port_name_len, const char *attr_name,
|
|
||||||
int64_t attr_name_len)
|
|
||||||
: type(type),
|
|
||||||
port_name(port_name),
|
|
||||||
port_name_len(port_name_len),
|
|
||||||
attr_name(attr_name),
|
|
||||||
attr_name_len(attr_name_len) {}
|
|
||||||
};
|
|
||||||
Status AutoMappingByOpFn(const ge::Operator &op_src, ge::Operator &op);
|
|
||||||
Status AutoMappingByOpFnDynamic(const ge::Operator &op_src, ge::Operator &op,
|
|
||||||
const vector<DynamicInputOutputInfo> &dynamic_name_attr_value);
|
|
||||||
Status AutoMappingFn(const google::protobuf::Message *op_src, ge::Operator &op);
|
|
||||||
Status AutoMappingFnDynamic(const google::protobuf::Message *op_src, ge::Operator &op,
|
|
||||||
std::map<std::string, std::pair<std::string, std::string>> dynamic_name_attr_value,
|
|
||||||
int in_pos = -1, int out_pos = -1);
|
|
||||||
Status AutoMappingSubgraphIndex(const ge::Graph &graph, const std::function<int(int data_index)> &input,
|
|
||||||
const std::function<int(int netoutput_index)> &output);
|
|
||||||
Status AutoMappingSubgraphIndex(const ge::Graph &graph,
|
|
||||||
const std::function<Status(int data_index, int &parent_input_index)> &input,
|
|
||||||
const std::function<Status(int netoutput_index, int &parent_output_index)> &output);
|
|
||||||
using google::protobuf::Message;
|
|
||||||
class OpRegistrationDataImpl;
|
|
||||||
|
|
||||||
using ParseParamFunc = std::function<domi::Status(const google::protobuf::Message *, ge::Operator &)>;
|
|
||||||
using ParseParamByOpFunc = std::function<domi::Status(const ge::Operator &, ge::Operator &)>;
|
|
||||||
using FusionParseParamFunc =
|
|
||||||
std::function<domi::Status(const std::vector<const google::protobuf::Message *>, ge::Operator &)>;
|
|
||||||
using FusionParseParamByOpFunc = std::function<domi::Status(const std::vector<ge::Operator> &, ge::Operator &)>;
|
|
||||||
using ParseSubgraphFunc = std::function<Status(const std::string &subgraph_name, const ge::Graph &graph)>;
|
|
||||||
|
|
||||||
class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpRegistrationData {
|
|
||||||
public:
|
|
||||||
OpRegistrationData(const std::string &om_optype);
|
|
||||||
|
|
||||||
~OpRegistrationData();
|
|
||||||
|
|
||||||
OpRegistrationData &FrameworkType(const domi::FrameworkType &fmk_type);
|
|
||||||
|
|
||||||
OpRegistrationData &OriginOpType(const std::initializer_list<std::string> &ori_optype_list);
|
|
||||||
|
|
||||||
OpRegistrationData &OriginOpType(const std::string &ori_optype);
|
|
||||||
|
|
||||||
OpRegistrationData &ParseParamsFn(const ParseParamFunc &parseParamFn);
|
|
||||||
|
|
||||||
OpRegistrationData &ParseParamsByOperatorFn(const ParseParamByOpFunc &parse_param_by_op_fn);
|
|
||||||
|
|
||||||
OpRegistrationData &FusionParseParamsFn(const FusionParseParamFunc &fusionParseParamFn);
|
|
||||||
|
|
||||||
OpRegistrationData &FusionParseParamsFn(const FusionParseParamByOpFunc &fusion_parse_param_fn);
|
|
||||||
|
|
||||||
OpRegistrationData &ParseSubgraphPostFn(const ParseSubgraphFunc &subgraph_post_fn);
|
|
||||||
|
|
||||||
OpRegistrationData &ImplyType(const domi::ImplyType &imply_type);
|
|
||||||
|
|
||||||
OpRegistrationData &DelInputWithCond(int inputIdx, const std::string &attrName, bool attrValue);
|
|
||||||
|
|
||||||
OpRegistrationData &DelInputWithOriginalType(int input_idx, const std::string &ori_type);
|
|
||||||
|
|
||||||
OpRegistrationData &InputReorderVector(const vector<int> &input_order);
|
|
||||||
|
|
||||||
domi::ImplyType GetImplyType() const;
|
|
||||||
std::string GetOmOptype() const;
|
|
||||||
std::set<std::string> GetOriginOpTypeSet() const;
|
|
||||||
domi::FrameworkType GetFrameworkType() const;
|
|
||||||
ParseParamFunc GetParseParamFn() const;
|
|
||||||
ParseParamByOpFunc GetParseParamByOperatorFn() const;
|
|
||||||
FusionParseParamFunc GetFusionParseParamFn() const;
|
|
||||||
FusionParseParamByOpFunc GetFusionParseParamByOpFn() const;
|
|
||||||
ParseSubgraphFunc GetParseSubgraphPostFn() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::shared_ptr<OpRegistrationDataImpl> impl_;
|
|
||||||
friend class OpRegistry;
|
|
||||||
friend class OpRegistrationTbe;
|
|
||||||
friend class ge::TBEPluginManager;
|
|
||||||
};
|
|
||||||
|
|
||||||
class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpReceiver {
|
|
||||||
public:
|
|
||||||
OpReceiver(OpRegistrationData ®_data);
|
|
||||||
~OpReceiver() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
#define REGISTER_CUSTOM_OP(name) REGISTER_CUSTOM_OP_UNIQ_HELPER(__COUNTER__, name)
|
|
||||||
#define REGISTER_CUSTOM_OP_UNIQ_HELPER(ctr, name) REGISTER_CUSTOM_OP_UNIQ(ctr, name)
|
|
||||||
#define REGISTER_CUSTOM_OP_UNIQ(ctr, name) \
|
|
||||||
static OpReceiver register_op##ctr __attribute__((unused)) = OpRegistrationData(name)
|
|
||||||
} // namespace domi
|
|
||||||
|
|
||||||
namespace ge {
|
|
||||||
using OpRegistrationData = domi::OpRegistrationData;
|
|
||||||
using OpReceiver = domi::OpReceiver;
|
|
||||||
} // namespace ge
|
|
||||||
/*lint +e148*/
|
|
||||||
#endif // INC_EXTERNAL_REGISTER_REGISTER_H_
|
|
@ -1,39 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INC_EXTERNAL_REGISTER_REGISTER_ERROR_CODES_H_
|
|
||||||
#define INC_EXTERNAL_REGISTER_REGISTER_ERROR_CODES_H_
|
|
||||||
|
|
||||||
#define SYSID_FWK 3 // Subsystem ID
|
|
||||||
#define MODID_COMMON 0 // Common module ID
|
|
||||||
|
|
||||||
#define DECLARE_ERRORNO(sysid, modid, name, value) \
|
|
||||||
const domi::Status name = \
|
|
||||||
((0xFF & ((uint8_t)sysid)) << 24) | ((0xFF & ((uint8_t)modid)) << 16) | (0xFFFF & ((uint16_t)value));
|
|
||||||
|
|
||||||
#define DECLARE_ERRORNO_COMMON(name, value) DECLARE_ERRORNO(SYSID_FWK, MODID_COMMON, name, value)
|
|
||||||
|
|
||||||
namespace domi {
|
|
||||||
using Status = uint32_t;
|
|
||||||
|
|
||||||
// General error code
|
|
||||||
DECLARE_ERRORNO(0, 0, SUCCESS, 0);
|
|
||||||
DECLARE_ERRORNO(0xFF, 0xFF, FAILED, 0xFFFFFFFF);
|
|
||||||
DECLARE_ERRORNO_COMMON(PARAM_INVALID, 1); // 50331649
|
|
||||||
DECLARE_ERRORNO(SYSID_FWK, 1, SCOPE_NOT_CHANGED, 201);
|
|
||||||
} // namespace domi
|
|
||||||
|
|
||||||
#endif // INC_EXTERNAL_REGISTER_REGISTER_ERROR_CODES_H_
|
|
@ -1,37 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INC_EXTERNAL_REGISTER_REGISTER_FMK_TYPES_H_
|
|
||||||
#define INC_EXTERNAL_REGISTER_REGISTER_FMK_TYPES_H_
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace domi {
|
|
||||||
///
|
|
||||||
/// @ingroup domi_omg
|
|
||||||
/// @brief AI framework types
|
|
||||||
///
|
|
||||||
enum FrameworkType {
|
|
||||||
CAFFE = 0,
|
|
||||||
MINDSPORE = 1,
|
|
||||||
TENSORFLOW = 3,
|
|
||||||
ANDROID_NN,
|
|
||||||
ONNX,
|
|
||||||
FRAMEWORK_RESERVED,
|
|
||||||
};
|
|
||||||
} // namespace domi
|
|
||||||
|
|
||||||
#endif // INC_EXTERNAL_REGISTER_REGISTER_FMK_TYPES_H_
|
|
@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INC_EXTERNAL_REGISTER_REGISTER_TYPES_H_
|
|
||||||
#define INC_EXTERNAL_REGISTER_REGISTER_TYPES_H_
|
|
||||||
|
|
||||||
namespace domi {
|
|
||||||
#ifdef HOST_VISIBILITY
|
|
||||||
#define FMK_FUNC_HOST_VISIBILITY __attribute__((visibility("default")))
|
|
||||||
#else
|
|
||||||
#define FMK_FUNC_HOST_VISIBILITY
|
|
||||||
#endif
|
|
||||||
#ifdef DEV_VISIBILITY
|
|
||||||
#define FMK_FUNC_DEV_VISIBILITY __attribute__((visibility("default")))
|
|
||||||
#else
|
|
||||||
#define FMK_FUNC_DEV_VISIBILITY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// CCE defined constant
|
|
||||||
|
|
||||||
///
|
|
||||||
/// @ingroup domi
|
|
||||||
/// @brief original tensor type
|
|
||||||
///
|
|
||||||
typedef enum tagDomiTensorFormat {
|
|
||||||
DOMI_TENSOR_NCHW = 0, // < NCHW
|
|
||||||
DOMI_TENSOR_NHWC, // < NHWC
|
|
||||||
DOMI_TENSOR_ND, // < Nd Tensor
|
|
||||||
DOMI_TENSOR_NC1HWC0, // < NC1HWC0
|
|
||||||
DOMI_TENSOR_FRACTAL_Z, // < FRACTAL_Z
|
|
||||||
DOMI_TENSOR_NC1C0HWPAD,
|
|
||||||
DOMI_TENSOR_NHWC1C0,
|
|
||||||
DOMI_TENSOR_FSR_NCHW,
|
|
||||||
DOMI_TENSOR_FRACTAL_DECONV,
|
|
||||||
DOMI_TENSOR_BN_WEIGHT,
|
|
||||||
DOMI_TENSOR_CHWN, // Android NN Depth CONV
|
|
||||||
DOMI_TENSOR_FILTER_HWCK, // filter input tensor format
|
|
||||||
DOMI_TENSOR_NDHWC,
|
|
||||||
DOMI_TENSOR_NCDHW,
|
|
||||||
DOMI_TENSOR_DHWCN, // 3D filter input tensor format
|
|
||||||
DOMI_TENSOR_DHWNC,
|
|
||||||
DOMI_TENSOR_RESERVED
|
|
||||||
} domiTensorFormat_t;
|
|
||||||
} // namespace domi
|
|
||||||
|
|
||||||
#endif // INC_EXTERNAL_REGISTER_REGISTER_TYPES_H_
|
|
File diff suppressed because it is too large
Load Diff
@ -1,127 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
package toolkit.dumpdata;
|
|
||||||
|
|
||||||
enum OutputDataType {
|
|
||||||
DT_UNDEFINED = 0;
|
|
||||||
DT_FLOAT = 1;
|
|
||||||
DT_FLOAT16 = 2;
|
|
||||||
DT_INT8 = 3;
|
|
||||||
DT_UINT8 = 4;
|
|
||||||
DT_INT16 = 5;
|
|
||||||
DT_UINT16 = 6;
|
|
||||||
DT_INT32 = 7;
|
|
||||||
DT_INT64 = 8;
|
|
||||||
DT_UINT32 = 9;
|
|
||||||
DT_UINT64 = 10;
|
|
||||||
DT_BOOL = 11;
|
|
||||||
DT_DOUBLE = 12;
|
|
||||||
DT_STRING = 13;
|
|
||||||
DT_DUAL_SUB_INT8 = 14;
|
|
||||||
DT_DUAL_SUB_UINT8 = 15;
|
|
||||||
DT_COMPLEX64 = 16;
|
|
||||||
DT_COMPLEX128 = 17;
|
|
||||||
DT_QINT8 = 18;
|
|
||||||
DT_QINT16 = 19;
|
|
||||||
DT_QINT32 = 20;
|
|
||||||
DT_QUINT8 = 21;
|
|
||||||
DT_QUINT16 = 22;
|
|
||||||
DT_RESOURCE = 23;
|
|
||||||
DT_STRING_REF = 24;
|
|
||||||
DT_DUAL = 25;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum OutputFormat {
|
|
||||||
FORMAT_NCHW = 0;
|
|
||||||
FORMAT_NHWC = 1;
|
|
||||||
FORMAT_ND = 2;
|
|
||||||
FORMAT_NC1HWC0 = 3;
|
|
||||||
FORMAT_FRACTAL_Z = 4;
|
|
||||||
FORMAT_NC1C0HWPAD = 5;
|
|
||||||
FORMAT_NHWC1C0 = 6;
|
|
||||||
FORMAT_FSR_NCHW = 7;
|
|
||||||
FORMAT_FRACTAL_DECONV = 8;
|
|
||||||
FORMAT_C1HWNC0 = 9;
|
|
||||||
FORMAT_FRACTAL_DECONV_TRANSPOSE = 10;
|
|
||||||
FORMAT_FRACTAL_DECONV_SP_STRIDE_TRANS = 11;
|
|
||||||
FORMAT_NC1HWC0_C04 = 12;
|
|
||||||
FORMAT_FRACTAL_Z_C04 = 13;
|
|
||||||
FORMAT_CHWN = 14;
|
|
||||||
FORMAT_FRACTAL_DECONV_SP_STRIDE8_TRANS = 15;
|
|
||||||
FORMAT_HWCN = 16;
|
|
||||||
FORMAT_NC1KHKWHWC0 = 17;
|
|
||||||
FORMAT_BN_WEIGHT = 18;
|
|
||||||
FORMAT_FILTER_HWCK = 19;
|
|
||||||
FORMAT_HASHTABLE_LOOKUP_LOOKUPS=20;
|
|
||||||
FORMAT_HASHTABLE_LOOKUP_KEYS = 21;
|
|
||||||
FORMAT_HASHTABLE_LOOKUP_VALUE = 22;
|
|
||||||
FORMAT_HASHTABLE_LOOKUP_OUTPUT = 23;
|
|
||||||
FORMAT_HASHTABLE_LOOKUP_HITS=24;
|
|
||||||
FORMAT_C1HWNCoC0 = 25;
|
|
||||||
FORMAT_MD = 26;
|
|
||||||
FORMAT_NDHWC = 27;
|
|
||||||
FORMAT_FRACTAL_ZZ = 28;
|
|
||||||
FORMAT_FRACTAL_NZ = 29;
|
|
||||||
FORMAT_RESERVED = 30;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OriginalOp {
|
|
||||||
string name = 1;
|
|
||||||
uint32 output_index = 2;
|
|
||||||
OutputDataType data_type = 3;
|
|
||||||
OutputFormat format = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Shape {
|
|
||||||
repeated uint64 dim = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OpOutput {
|
|
||||||
OutputDataType data_type = 1;
|
|
||||||
OutputFormat format = 2;
|
|
||||||
Shape shape = 3;
|
|
||||||
OriginalOp original_op = 4; // the original op corresponding to the output
|
|
||||||
bytes data = 5;
|
|
||||||
uint64 size = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OpInput {
|
|
||||||
OutputDataType data_type = 1;
|
|
||||||
OutputFormat format = 2;
|
|
||||||
Shape shape = 3;
|
|
||||||
bytes data = 4;
|
|
||||||
uint64 size = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum BufferType {
|
|
||||||
L1 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OpBuffer {
|
|
||||||
BufferType buffer_type = 1;
|
|
||||||
bytes data = 2;
|
|
||||||
uint64 size = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DumpData{
|
|
||||||
string version = 1;
|
|
||||||
uint64 dump_time = 2;
|
|
||||||
repeated OpOutput output = 3;
|
|
||||||
repeated OpInput input = 4;
|
|
||||||
repeated OpBuffer buffer = 5;
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
import "om.proto";
|
|
||||||
|
|
||||||
package domi;
|
|
||||||
|
|
||||||
message FusionModelDef {
|
|
||||||
string version = 1;
|
|
||||||
repeated OpDef fusion_op = 2;
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package aicpu.FWKAdapter;
|
|
||||||
option cc_enable_arenas = true;
|
|
||||||
|
|
||||||
|
|
||||||
// Defines an struct for input and output.
|
|
||||||
message TensorDataInfo {
|
|
||||||
|
|
||||||
// value DataType
|
|
||||||
uint32 dtype = 1;
|
|
||||||
|
|
||||||
// shape dim
|
|
||||||
repeated int64 dim = 2;
|
|
||||||
|
|
||||||
// data point addr
|
|
||||||
int64 data_addr = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message KernelRunParam {
|
|
||||||
// input
|
|
||||||
repeated TensorDataInfo input = 1;
|
|
||||||
// output
|
|
||||||
repeated TensorDataInfo output = 2;
|
|
||||||
}
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
package ge.api_pb;
|
|
||||||
|
|
||||||
import "ge_ir.proto";
|
|
||||||
|
|
||||||
// GE initialize
|
|
||||||
message GEInitialize {
|
|
||||||
map<string, string> options = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
// initialize response
|
|
||||||
message GEInitializeResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
uint32 clientId = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
// GE finalize
|
|
||||||
message GEFinalize {
|
|
||||||
bool final = 1;
|
|
||||||
uint32 clientId = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
message GEFinalizeResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
// GE Session
|
|
||||||
message CreateSession{
|
|
||||||
map<string, string> options = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
message CreateSessionResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
uint64 sessionId = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
//GE AddGraph
|
|
||||||
//model serialize :: serializegraph
|
|
||||||
message SessionAddGraph{
|
|
||||||
uint32 graphId = 1;
|
|
||||||
uint64 sessionId = 2;
|
|
||||||
ge.proto.GraphDef graph = 3;
|
|
||||||
};
|
|
||||||
|
|
||||||
message SessionAddGraphResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
//GE SessionRemoveGraph
|
|
||||||
message SessionRemoveGraph{
|
|
||||||
uint32 graphId = 1;
|
|
||||||
uint64 sessionId = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
message SessionRemoveGraphResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
message SessionRunGraph{
|
|
||||||
uint32 graphId = 1;
|
|
||||||
uint64 sessionId = 2;
|
|
||||||
repeated ge.proto.TensorDef tensor = 3;
|
|
||||||
};
|
|
||||||
|
|
||||||
message SessionBuildGraph{
|
|
||||||
uint32 graphId = 1;
|
|
||||||
uint64 sessionId = 2;
|
|
||||||
repeated ge.proto.TensorDef tensor = 3;
|
|
||||||
string savePath = 4;
|
|
||||||
};
|
|
||||||
|
|
||||||
message SessionRunGraphResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
repeated ge.proto.TensorDef tensor = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
message SessionBuildGraphResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
message DestroySession{
|
|
||||||
bool final = 1;
|
|
||||||
uint64 sessionId = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
message DestroySessionResponse {
|
|
||||||
uint32 status = 1;
|
|
||||||
};
|
|
File diff suppressed because it is too large
Load Diff
@ -1,89 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
package aicpu.dump;
|
|
||||||
|
|
||||||
message Shape {
|
|
||||||
repeated uint64 dim = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Output {
|
|
||||||
int32 data_type = 1;
|
|
||||||
int32 format = 2;
|
|
||||||
Shape shape = 3;
|
|
||||||
uint64 address = 4;
|
|
||||||
string original_name = 5;
|
|
||||||
int32 original_output_index = 6;
|
|
||||||
int32 original_output_data_type = 7;
|
|
||||||
int32 original_output_format = 8;
|
|
||||||
uint64 size = 9;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Input {
|
|
||||||
int32 data_type =1;
|
|
||||||
int32 format = 2;
|
|
||||||
Shape shape = 3;
|
|
||||||
uint64 address = 4;
|
|
||||||
uint64 size = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum BufferType {
|
|
||||||
L1 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OpBuffer {
|
|
||||||
BufferType buffer_type = 1;
|
|
||||||
uint64 address = 2;
|
|
||||||
uint64 size = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Op {
|
|
||||||
string op_name = 1;
|
|
||||||
string op_type = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Task {
|
|
||||||
uint32 task_id = 1;
|
|
||||||
uint32 stream_id = 2;
|
|
||||||
Op op = 3;
|
|
||||||
repeated Output output = 4;
|
|
||||||
bool end_graph = 5;
|
|
||||||
repeated Input input = 6;
|
|
||||||
repeated OpBuffer buffer = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OpMappingInfo {
|
|
||||||
string dump_path = 1;
|
|
||||||
oneof model_name_param {
|
|
||||||
string model_name = 2;
|
|
||||||
}
|
|
||||||
oneof model_id_param {
|
|
||||||
uint32 model_id = 3;
|
|
||||||
}
|
|
||||||
oneof step_id {
|
|
||||||
uint64 step_id_addr = 4;
|
|
||||||
}
|
|
||||||
oneof iterations_per_loop {
|
|
||||||
uint64 iterations_per_loop_addr = 5;
|
|
||||||
}
|
|
||||||
oneof loop_cond {
|
|
||||||
uint64 loop_cond_addr = 6;
|
|
||||||
}
|
|
||||||
uint32 flag = 7; // 0x01 load, 0x00 unload
|
|
||||||
repeated Task task = 8;
|
|
||||||
string dump_step = 9;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
package ge.optimizers;
|
|
||||||
|
|
||||||
// Default: GE>FE>AICPU
|
|
||||||
message Priority{
|
|
||||||
repeated string optimizer = 1;
|
|
||||||
}
|
|
@ -1,170 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package domi;
|
|
||||||
|
|
||||||
message ModelTaskDef {
|
|
||||||
string version = 1;
|
|
||||||
|
|
||||||
map<string, string> attr = 9; // Extended field
|
|
||||||
repeated TaskDef task = 10;
|
|
||||||
|
|
||||||
uint64 memory_size = 11;
|
|
||||||
uint32 stream_num = 12;
|
|
||||||
uint32 event_num = 13;
|
|
||||||
uint64 weight_size = 14;
|
|
||||||
|
|
||||||
repeated bytes op = 15; // input/output opdef in bytes
|
|
||||||
|
|
||||||
uint64 base_addr = 16; // base addr
|
|
||||||
uint64 weight_addr = 17; // weight addr
|
|
||||||
uint32 batch_num = 18;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message TaskDef {
|
|
||||||
uint32 id = 1;
|
|
||||||
uint32 type = 2;
|
|
||||||
|
|
||||||
uint32 stream_id = 10;
|
|
||||||
uint32 event_id = 11;
|
|
||||||
|
|
||||||
KernelDef kernel = 20;
|
|
||||||
KernelExDef kernel_ex = 21;
|
|
||||||
KernelHcclDef kernel_hccl = 25;
|
|
||||||
EventExDef event_ex = 26;
|
|
||||||
LogTimeStampDef log_timestamp = 28;
|
|
||||||
|
|
||||||
uint32 label_id = 30;
|
|
||||||
|
|
||||||
MemcpyAsyncDef memcpy_async = 31;
|
|
||||||
StreamSwitchDef stream_switch = 32;
|
|
||||||
StreamActiveDef stream_active = 33;
|
|
||||||
bytes private_def = 34;
|
|
||||||
uint64 ops_kernel_store_ptr = 35; // adjustments to other fields in the future
|
|
||||||
StreamSwitchNDef stream_switch_n = 36;
|
|
||||||
|
|
||||||
LabelSetDef label_set = 37;
|
|
||||||
LabelGotoExDef label_goto_ex = 38;
|
|
||||||
LabelSwitchByIndexDef label_switch_by_index = 39;
|
|
||||||
}
|
|
||||||
|
|
||||||
message KernelDef {
|
|
||||||
KernelContext context = 1;
|
|
||||||
|
|
||||||
string stub_func = 10;
|
|
||||||
uint32 block_dim = 11;
|
|
||||||
uint32 args_size = 12;
|
|
||||||
bytes args = 13;
|
|
||||||
bytes sm_desc = 14;
|
|
||||||
bytes flowtable = 15;
|
|
||||||
string so_name = 16;
|
|
||||||
string kernel_name = 17;
|
|
||||||
bytes kernel_ext_info = 18;
|
|
||||||
uint32 kernel_ext_info_size = 19;
|
|
||||||
}
|
|
||||||
|
|
||||||
message KernelContext {
|
|
||||||
uint32 kernel_type = 1;
|
|
||||||
uint32 op_id = 2; // OP type in CCE
|
|
||||||
uint32 kernel_func_id = 3;
|
|
||||||
uint32 op_index = 4; // TE/Custom operator
|
|
||||||
bool is_flowtable = 5; // Identify whether args is a flowtable structure
|
|
||||||
bytes args_offset = 6; // args offset information
|
|
||||||
uint32 args_count = 7; // args count
|
|
||||||
repeated uint32 origin_op_index = 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message KernelExDef {
|
|
||||||
uint32 flags = 1;
|
|
||||||
|
|
||||||
uint32 op_index = 4;
|
|
||||||
uint32 args_size = 12;
|
|
||||||
bytes args = 13;
|
|
||||||
bytes task_info = 14; // serialized nodeDef, funcDef, inputoutput
|
|
||||||
uint32 task_info_size = 15;
|
|
||||||
bytes kernel_ext_info = 16;
|
|
||||||
uint32 kernel_ext_info_size = 17;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message KernelHcclDef {
|
|
||||||
uint32 op_index = 8;
|
|
||||||
string hccl_type = 9;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message EventExDef {
|
|
||||||
uint32 op_index = 1;
|
|
||||||
uint32 event_type = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message LogTimeStampDef {
|
|
||||||
uint64 logid = 1;
|
|
||||||
bool notify = 2;
|
|
||||||
uint32 flat = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message MemcpyAsyncDef {
|
|
||||||
uint64 dst = 1;
|
|
||||||
uint64 dst_max = 2;
|
|
||||||
uint64 src = 3;
|
|
||||||
uint64 count = 4;
|
|
||||||
uint32 kind = 5;
|
|
||||||
uint32 op_index = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message StreamSwitchDef {
|
|
||||||
uint32 op_index = 1;
|
|
||||||
uint32 true_stream_id = 2;
|
|
||||||
int64 value = 3;
|
|
||||||
uint64 value_ptr = 4;
|
|
||||||
uint32 data_type = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message StreamActiveDef {
|
|
||||||
uint32 op_index = 1;
|
|
||||||
uint32 active_stream_id = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message StreamSwitchNDef {
|
|
||||||
uint32 op_index = 1;
|
|
||||||
uint32 size = 2;
|
|
||||||
repeated int64 target_value = 3;
|
|
||||||
repeated uint32 true_stream_id = 4;
|
|
||||||
uint32 element_size = 5;
|
|
||||||
uint32 data_type = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message LabelSetDef {
|
|
||||||
uint32 op_index = 1;
|
|
||||||
uint32 label_id = 2;
|
|
||||||
uint32 model_id = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message LabelGotoExDef {
|
|
||||||
uint32 op_index = 1;
|
|
||||||
uint32 label_id = 2;
|
|
||||||
uint32 model_id = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message LabelSwitchByIndexDef {
|
|
||||||
uint32 op_index = 1;
|
|
||||||
uint32 label_max = 2;
|
|
||||||
}
|
|
Loading…
Reference in new issue