Compare commits
38 Commits
Author | SHA1 | Date |
---|---|---|
|
ce23341ee2 | 4 years ago |
|
dabd399a6a | 4 years ago |
|
dd5ac69a1f | 4 years ago |
|
975e65054a | 4 years ago |
|
38a40dd232 | 4 years ago |
|
21a7c98295 | 4 years ago |
|
191dc74799 | 4 years ago |
|
d5d708764b | 4 years ago |
|
35a120dccd | 4 years ago |
|
e95bc1b18f | 4 years ago |
|
383f7f751d | 4 years ago |
|
ad4523637d | 4 years ago |
|
412ebe82c9 | 4 years ago |
|
3f9627f0de | 4 years ago |
|
9153665631 | 4 years ago |
|
94facf5ebe | 4 years ago |
|
9d5177a954 | 4 years ago |
|
7ae9c448f9 | 4 years ago |
|
93719ebecd | 4 years ago |
|
704a9eb441 | 4 years ago |
|
42d217fb8c | 4 years ago |
|
20929c8bd3 | 4 years ago |
|
423c0228e8 | 4 years ago |
|
24b8bc1cba | 4 years ago |
|
cd365aa247 | 4 years ago |
|
b25b70c9c2 | 4 years ago |
|
575b546b55 | 4 years ago |
|
1f4f0a47b1 | 4 years ago |
|
866c61a4e6 | 4 years ago |
|
0667dcfa3f | 4 years ago |
|
7a75f024d5 | 4 years ago |
|
250465a71f | 4 years ago |
|
80dfd25e01 | 4 years ago |
|
fe038d0ae5 | 4 years ago |
|
88049a688b | 4 years ago |
|
dcc1768c68 | 4 years ago |
|
14db109491 | 4 years ago |
|
bf316a3eeb | 4 years ago |
@ -1,9 +1,20 @@
|
|||||||
set(nlohmann_json_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
|
set(nlohmann_json_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
|
||||||
set(nlohmann_json_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
|
set(nlohmann_json_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
|
||||||
|
|
||||||
|
if (ENABLE_GITEE)
|
||||||
|
set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip")
|
||||||
|
set(MD5 "5bda78ce308e6cfcf614dcf1d5ff27a7")
|
||||||
|
set(INCLUDE "./include")
|
||||||
|
else()
|
||||||
|
set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip")
|
||||||
|
set(MD5 "0dc903888211db3a0f170304cd9f3a89")
|
||||||
|
set(INCLUDE "./")
|
||||||
|
endif ()
|
||||||
|
|
||||||
graphengine_add_pkg(ge_nlohmann_json
|
graphengine_add_pkg(ge_nlohmann_json
|
||||||
VER 3.6.1
|
VER 3.6.1
|
||||||
HEAD_ONLY ./
|
HEAD_ONLY ${INCLUDE}
|
||||||
URL https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip
|
URL ${REQ_URL}
|
||||||
MD5 0dc903888211db3a0f170304cd9f3a89)
|
MD5 ${MD5})
|
||||||
include_directories(${ge_nlohmann_json_INC})
|
include_directories(${ge_nlohmann_json_INC})
|
||||||
add_library(graphengine::json ALIAS ge_nlohmann_json)
|
add_library(graphengine::json ALIAS ge_nlohmann_json)
|
@ -1,5 +1,13 @@
|
|||||||
|
if (ENABLE_GITEE)
|
||||||
|
set(REQ_URL "https://gitee.com/mirrors/ONNX/repository/archive/v1.6.0.tar.gz")
|
||||||
|
set(MD5 "1bdbcecdd68ea8392630467646776e02")
|
||||||
|
else()
|
||||||
|
set(REQ_URL "https://github.com/onnx/onnx/releases/download/v1.6.0/onnx-1.6.0.tar.gz")
|
||||||
|
set(MD5 "512f2779d6215d4a36f366b6b9acdf1e")
|
||||||
|
endif ()
|
||||||
|
|
||||||
graphengine_add_pkg(onnx
|
graphengine_add_pkg(onnx
|
||||||
VER 1.6.0
|
VER 1.6.0
|
||||||
HEAD_ONLY ./
|
HEAD_ONLY ./
|
||||||
URL https://github.com/onnx/onnx/releases/download/v1.6.0/onnx-1.6.0.tar.gz
|
URL ${REQ_URL}
|
||||||
MD5 512f2779d6215d4a36f366b6b9acdf1e)
|
MD5 ${MD5})
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
/**
|
||||||
|
* 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_COMMON_OPSKERNELUTILS_OPS_KERNEL_INFO_UTILS_H_
|
||||||
|
#define INC_COMMON_OPSKERNELUTILS_OPS_KERNEL_INFO_UTILS_H_
|
||||||
|
|
||||||
|
#include "external/ge/ge_api_error_codes.h"
|
||||||
|
#include "cce/aicpu_engine_struct.h"
|
||||||
|
#include "common/opskernel/ops_kernel_info_types.h"
|
||||||
|
#include "graph/node.h"
|
||||||
|
#include "proto/task.pb.h"
|
||||||
|
|
||||||
|
namespace ge {
|
||||||
|
class OpsKernelBuilder {
|
||||||
|
public:
|
||||||
|
OpsKernelBuilder() = default;
|
||||||
|
virtual ~OpsKernelBuilder() = default;
|
||||||
|
|
||||||
|
// initialize OpsKernelBuilder
|
||||||
|
virtual Status Initialize(const std::map<std::string, std::string> &options) = 0;
|
||||||
|
|
||||||
|
// finalize OpsKernelBuilder
|
||||||
|
virtual Status Finalize() = 0;
|
||||||
|
|
||||||
|
// memory allocation requirement
|
||||||
|
virtual Status CalcOpRunningParam(Node &node) = 0;
|
||||||
|
|
||||||
|
// generate task for op
|
||||||
|
virtual Status GenerateTask(const Node &node, RunContext &context, std::vector<domi::TaskDef> &tasks) = 0;
|
||||||
|
|
||||||
|
// only call aicpu interface to generate task struct
|
||||||
|
virtual Status GenSingleOpRunTask(const NodePtr &node, STR_FWK_OP_KERNEL &task, string &task_info) { return FAILED; }
|
||||||
|
|
||||||
|
// only call aicpu interface to generate task struct
|
||||||
|
virtual Status GenMemCopyTask(uint64_t count, STR_FWK_OP_KERNEL &task, string &task_info) { return FAILED; }
|
||||||
|
};
|
||||||
|
} // namespace ge
|
||||||
|
#endif // INC_COMMON_OPSKERNELUTILS_OPS_KERNEL_INFO_UTILS_H_
|
@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* 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 AICORE_UTIL_MANAGER_H_
|
||||||
|
#define AICORE_UTIL_MANAGER_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include "register/graph_optimizer/graph_optimize_register_error_codes.h"
|
||||||
|
|
||||||
|
namespace fe {
|
||||||
|
class AICoreUtilManager {
|
||||||
|
public:
|
||||||
|
static AICoreUtilManager &Instance();
|
||||||
|
/*
|
||||||
|
* to initialize the aicore configuration
|
||||||
|
* param[in] the options of init
|
||||||
|
* param[in] engine Name
|
||||||
|
* param[in] socVersion soc version from ge
|
||||||
|
* return Status(SUCCESS/FAILED)
|
||||||
|
*/
|
||||||
|
Status Initialize(const std::map<std::string, std::string> &options, std::string &soc_version);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* to release the source of fusion manager
|
||||||
|
* return Status(SUCCESS/FAILED)
|
||||||
|
*/
|
||||||
|
Status Finalize();
|
||||||
|
|
||||||
|
private:
|
||||||
|
AICoreUtilManager();
|
||||||
|
~AICoreUtilManager();
|
||||||
|
bool is_init_;
|
||||||
|
};
|
||||||
|
} // namespace fe
|
||||||
|
#endif // AICORE_UTIL_MANAGER_H
|
@ -0,0 +1,54 @@
|
|||||||
|
/**
|
||||||
|
* 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_COMMON_UTILS_AI_CORE_COMMON_CONSTANTS_H_
|
||||||
|
#define INC_COMMON_UTILS_AI_CORE_COMMON_CONSTANTS_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace fe {
|
||||||
|
static const std::string CORE_TYPE = "_coretype";
|
||||||
|
/* engine name of AI core and vector core */
|
||||||
|
static const std::string AI_CORE_NAME = "AIcoreEngine";
|
||||||
|
static const std::string VECTOR_CORE_NAME = "VectorEngine";
|
||||||
|
|
||||||
|
static const int64_t IS_UNKNOWN_SHAPE_VALUE = 1;
|
||||||
|
|
||||||
|
static const int64_t SHAPE_UNKNOWN_DIM = -1;
|
||||||
|
|
||||||
|
static const int64_t SHAPE_UNKNOWN_DIM_NUM = -2;
|
||||||
|
|
||||||
|
static const std::string SOC_VERSION_ASCEND310 = "Ascend310";
|
||||||
|
static const std::string SOC_VERSION_ASCEND610 = "Ascend610";
|
||||||
|
static const std::string SOC_VERSION_ASCEND615 = "Ascend615";
|
||||||
|
static const std::string SOC_VERSION_ASCEND710 = "Ascend710";
|
||||||
|
static const std::string SOC_VERSION_ASCEND710P = "Ascend710Pro";
|
||||||
|
static const std::string SOC_VERSION_ASCEND910A = "Ascend910A";
|
||||||
|
static const std::string SOC_VERSION_ASCEND910B = "Ascend910B";
|
||||||
|
static const std::string SOC_VERSION_ASCEND910PROA = "Ascend910ProA";
|
||||||
|
static const std::string SOC_VERSION_ASCEND910PROB = "Ascend910ProB";
|
||||||
|
static const std::string SOC_VERSION_ASCEND910PREMIUMA = "Ascend910PremiumA";
|
||||||
|
static const std::string SOC_VERSION_HI3796CV300ES = "Hi3796CV300ES";
|
||||||
|
static const std::string SOC_VERSION_HI3796CV300CS = "Hi3796CV300CS";
|
||||||
|
|
||||||
|
static const std::vector<std::string> SOC_VERSION_CLOUD_LIST = {SOC_VERSION_ASCEND910A, SOC_VERSION_ASCEND910B,
|
||||||
|
SOC_VERSION_ASCEND910PROA, SOC_VERSION_ASCEND910PROB,
|
||||||
|
SOC_VERSION_ASCEND910PREMIUMA};
|
||||||
|
|
||||||
|
static const std::vector<std::string> SOC_VERSION_DC_LIST = {SOC_VERSION_ASCEND610, SOC_VERSION_ASCEND615,
|
||||||
|
SOC_VERSION_ASCEND710, SOC_VERSION_ASCEND710P};
|
||||||
|
} // namespace fe
|
||||||
|
#endif
|
@ -0,0 +1,54 @@
|
|||||||
|
/**
|
||||||
|
* 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 PROJECT_JSON_UTIL_H
|
||||||
|
#define PROJECT_JSON_UTIL_H
|
||||||
|
|
||||||
|
#include "graph/compute_graph.h"
|
||||||
|
|
||||||
|
#include "common/aicore_util_types.h"
|
||||||
|
#include "fusion_engine/graph_tuner/graph_tuner_errorcode.h"
|
||||||
|
|
||||||
|
const std::string L1_FUSION_EXTEND_CONTENT = "_l1_fusion_extend_content";
|
||||||
|
const std::string L2_FUSION_EXTEND_CONTENT = "l2_fusion_extend_content";
|
||||||
|
const std::string TASK_L2_FUSION_INFO_EXTEND_CONTENT = "task_l2_fusion_info_extend_content";
|
||||||
|
const std::string L1_FUSION_TO_OP_STRUCT = "_l1fusion_ToOpStruct";
|
||||||
|
const std::string L2_FUSION_TO_OP_STRUCT = "_l2fusion_ToOpStruct";
|
||||||
|
const std::string TASK_L2_FUSION_INFO = "_task_L2FusionInfo";
|
||||||
|
|
||||||
|
namespace tune {
|
||||||
|
using ToOpStructPtr = std::shared_ptr<fe::ToOpStruct_t>;
|
||||||
|
using L2FusionInfoPtr = std::shared_ptr<fe::TaskL2FusionInfo_t>;
|
||||||
|
|
||||||
|
Status GetL1InfoFromJson(ge::OpDescPtr opDescPtr);
|
||||||
|
|
||||||
|
Status GetL2InfoFromJson(ge::OpDescPtr opDescPtr);
|
||||||
|
|
||||||
|
Status GetTaskL2FusionInfoFromJson(ge::OpDescPtr opDescPtr);
|
||||||
|
|
||||||
|
Status ReadGraphInfoFromJson(ge::ComputeGraph &graph);
|
||||||
|
|
||||||
|
Status WriteGraphInfoToJson(ge::ComputeGraph &graph);
|
||||||
|
|
||||||
|
void GetL2ToOpStructFromJson(ge::OpDescPtr &opDescPtr, ToOpStructPtr &l2InfoPtr);
|
||||||
|
|
||||||
|
void GetL1ToOpStructFromJson(ge::OpDescPtr &opDescPtr, ToOpStructPtr &l1InfoPtr);
|
||||||
|
|
||||||
|
L2FusionInfoPtr GetL2FusionInfoFromJson(ge::OpDescPtr &opDescPtr);
|
||||||
|
|
||||||
|
void SetL2FusionInfoToNode(ge::OpDescPtr &opDescPtr, L2FusionInfoPtr &l2FusionInfoPtr);
|
||||||
|
} // namespace tune
|
||||||
|
#endif // PROJECT_JSON_UTIL_H
|
@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* 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 L2_STREAM_INFO_H_
|
||||||
|
#define L2_STREAM_INFO_H_
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include <mutex>
|
||||||
|
#include "register/graph_optimizer/graph_optimize_register_error_codes.h"
|
||||||
|
#include "runtime/base.h"
|
||||||
|
#include "cce/l2fusion_struct.hpp"
|
||||||
|
|
||||||
|
namespace fe {
|
||||||
|
class StreamL2Info {
|
||||||
|
public:
|
||||||
|
StreamL2Info(const StreamL2Info &) = delete;
|
||||||
|
StreamL2Info &operator=(const StreamL2Info &) = delete;
|
||||||
|
static StreamL2Info &Instance();
|
||||||
|
Status GetStreamL2Info(rtStream_t stream_id, string node_name, fusion::TaskL2Info_t *&l2_data);
|
||||||
|
Status SetStreamL2Info(const rtStream_t &stream_id, fusion::TaskL2InfoFEMap_t &l2_alloc_res);
|
||||||
|
|
||||||
|
private:
|
||||||
|
StreamL2Info();
|
||||||
|
~StreamL2Info();
|
||||||
|
mutable std::mutex stream_l2_mutex_;
|
||||||
|
std::map<rtStream_t, fusion::TaskL2InfoFEMap_t> stream_l2_map_;
|
||||||
|
};
|
||||||
|
} // namespace fe
|
||||||
|
|
||||||
|
#endif // L2_STREAM_INFO_H_
|
@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* 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_ACL_ACL_H_
|
||||||
|
#define INC_EXTERNAL_ACL_ACL_H_
|
||||||
|
|
||||||
|
#include "acl_rt.h"
|
||||||
|
#include "acl_op.h"
|
||||||
|
#include "acl_mdl.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Current version is 1.0.0
|
||||||
|
#define ACL_MAJOR_VERSION 1
|
||||||
|
#define ACL_MINOR_VERSION 0
|
||||||
|
#define ACL_PATCH_VERSION 0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup AscendCL
|
||||||
|
* @brief acl initialize
|
||||||
|
*
|
||||||
|
* @par Restriction
|
||||||
|
* The aclInit interface can be called only once in a process
|
||||||
|
* @param configPath [IN] the config path,it can be NULL
|
||||||
|
* @retval ACL_SUCCESS The function is successfully executed.
|
||||||
|
* @retval OtherValues Failure
|
||||||
|
*/
|
||||||
|
ACL_FUNC_VISIBILITY aclError aclInit(const char *configPath);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup AscendCL
|
||||||
|
* @brief acl finalize
|
||||||
|
*
|
||||||
|
* @par Restriction
|
||||||
|
* Need to call aclFinalize before the process exits.
|
||||||
|
* After calling aclFinalize,the services cannot continue to be used normally.
|
||||||
|
* @retval ACL_SUCCESS The function is successfully executed.
|
||||||
|
* @retval OtherValues Failure
|
||||||
|
*/
|
||||||
|
ACL_FUNC_VISIBILITY aclError aclFinalize();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup AscendCL
|
||||||
|
* @brief query ACL interface version
|
||||||
|
*
|
||||||
|
* @param majorVersion[OUT] ACL interface major version
|
||||||
|
* @param minorVersion[OUT] ACL interface minor version
|
||||||
|
* @param patchVersion[OUT] ACL interface patch version
|
||||||
|
* @retval ACL_SUCCESS The function is successfully executed.
|
||||||
|
* @retval OtherValues Failure
|
||||||
|
*/
|
||||||
|
ACL_FUNC_VISIBILITY aclError aclrtGetVersion(int32_t *majorVersion, int32_t *minorVersion, int32_t *patchVersion);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INC_EXTERNAL_ACL_ACL_H_
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue