Browse Source

!8563 clean codex

From: @jojobugfree
Reviewed-by: @chujinjin,@jjfeing
Signed-off-by: @jjfeing
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
e094b63f87
8 changed files with 13 additions and 19 deletions
  1. +7
    -7
      mindspore/ccsrc/backend/kernel_compiler/aicpu/aicpu_kernel_build.cc
  2. +0
    -2
      mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_dynaminc_shape_util.cc
  3. +0
    -2
      mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_dynaminc_shape_util.h
  4. +0
    -1
      mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_parallel_build.cc
  5. +2
    -2
      mindspore/ccsrc/debug/data_dump/dump_json_parser.cc
  6. +1
    -1
      mindspore/ccsrc/debug/data_dump/e2e_dump_util.cc
  7. +3
    -3
      mindspore/ccsrc/runtime/device/ascend/executor/ai_core_dynamic_kernel.cc
  8. +0
    -1
      mindspore/ccsrc/runtime/device/executor/dynamic_kernel.h

+ 7
- 7
mindspore/ccsrc/backend/kernel_compiler/aicpu/aicpu_kernel_build.cc View File

@@ -133,7 +133,7 @@ void ParseAttrValue(const std::string &type, const std::string &attr_name, const
MS_EXCEPTION_IF_NULL(value_type);
auto value_type_str = value_type->ToString();
if (value_type_str == "Int64") {
int64_t data = GetValue<int64_t>(value);
auto data = GetValue<int64_t>(value);
attr_value.push_back(data);
} else {
attr_value = GetValue<std::vector<int64_t>>(value);
@@ -291,11 +291,11 @@ bool CreateNodeDefBytes(const std::shared_ptr<AnfNode> &anf_node,

uint64_t SetExtInfoShapeType(char *ext_info_buf, uint64_t ext_info_offset) {
// deal1: unknown shape type
ExtInfo *info = reinterpret_cast<ExtInfo *>(ext_info_buf + ext_info_offset);
auto *info = reinterpret_cast<ExtInfo *>(ext_info_buf + ext_info_offset);
info->infoType = FWK_ADPT_EXT_SHAPE_TYPE;
info->infoLen = sizeof(int32_t);
ext_info_offset += kExtInfoHeadSize;
int32_t *shape_type = reinterpret_cast<int32_t *>(ext_info_buf + ext_info_offset);
auto *shape_type = reinterpret_cast<int32_t *>(ext_info_buf + ext_info_offset);
*shape_type = UnknowShapeOpType::DEPEND_COMPUTE;
ext_info_offset += info->infoLen;
return ext_info_offset;
@@ -304,12 +304,12 @@ uint64_t SetExtInfoShapeType(char *ext_info_buf, uint64_t ext_info_offset) {
uint64_t SetExtInfoInputShapeType(char *ext_info_buf, uint64_t ext_info_offset,
const std::shared_ptr<AnfNode> &anf_node, size_t input_num) {
// deal2:input ShapeAndType
ExtInfo *info = reinterpret_cast<ExtInfo *>(ext_info_buf + ext_info_offset);
auto *info = reinterpret_cast<ExtInfo *>(ext_info_buf + ext_info_offset);
info->infoType = FWK_ADPT_EXT_INPUT_SHAPE;
info->infoLen = input_num * sizeof(ShapeAndType);
ext_info_offset += kExtInfoHeadSize;

ShapeAndType *inputs = reinterpret_cast<ShapeAndType *>(ext_info_buf + ext_info_offset);
auto *inputs = reinterpret_cast<ShapeAndType *>(ext_info_buf + ext_info_offset);
for (size_t input_index = 0; input_index < input_num; input_index++) {
TypeId input_type = AnfAlgo::GetInputDeviceDataType(anf_node, input_index);
std::vector<size_t> input_shape;
@@ -344,12 +344,12 @@ uint64_t SetExtInfoInputShapeType(char *ext_info_buf, uint64_t ext_info_offset,
uint64_t SetExtInfoOutputShapeType(char *ext_info_buf, uint64_t ext_info_offset,
const std::shared_ptr<AnfNode> &anf_node, size_t output_num) {
// deal3:output ShapeAndType
ExtInfo *info = reinterpret_cast<ExtInfo *>(ext_info_buf + ext_info_offset);
auto *info = reinterpret_cast<ExtInfo *>(ext_info_buf + ext_info_offset);
info->infoType = FWK_ADPT_EXT_OUTPUT_SHAPE;
info->infoLen = output_num * sizeof(ShapeAndType);
ext_info_offset += kExtInfoHeadSize;

ShapeAndType *outputs = reinterpret_cast<ShapeAndType *>(ext_info_buf + ext_info_offset);
auto *outputs = reinterpret_cast<ShapeAndType *>(ext_info_buf + ext_info_offset);
for (size_t output_index = 0; output_index < output_num; output_index++) {
std::vector<size_t> output_shape = AnfAlgo::GetOutputDeviceShape(anf_node, output_index);
TypeId output_type = AnfAlgo::GetOutputDeviceDataType(anf_node, output_index);


+ 0
- 2
mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_dynaminc_shape_util.cc View File

@@ -24,7 +24,6 @@
namespace mindspore {
namespace kernel {
namespace tbe {

bool TbeDynamicShapeUtil::IsDynamicShapeNode(const CNodePtr &cnode) {
MS_EXCEPTION_IF_NULL(cnode);
auto input_num = AnfAlgo ::GetInputTensorNum(cnode);
@@ -133,7 +132,6 @@ std::vector<std::pair<int, int>> TbeDynamicShapeUtil::GetOutputDynamicRange(cons
}
return ret;
}

} // namespace tbe
} // namespace kernel
} // namespace mindspore

+ 0
- 2
mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_dynaminc_shape_util.h View File

@@ -26,7 +26,6 @@
namespace mindspore {
namespace kernel {
namespace tbe {

class TbeDynamicShapeUtil {
public:
TbeDynamicShapeUtil() = default;
@@ -41,7 +40,6 @@ class TbeDynamicShapeUtil {
static std::vector<std::pair<int, int>> GetInputDynamicRange(const AnfNodePtr &anf_node, size_t index);
static std::vector<std::pair<int, int>> GetOutputDynamicRange(const AnfNodePtr &anf_node, size_t index);
};

} // namespace tbe
} // namespace kernel
} // namespace mindspore


+ 0
- 1
mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_parallel_build.cc View File

@@ -261,6 +261,5 @@ std::string ParallelBuildManager::ProcessBuildRetStr(const std::string &build_re
}
return "";
}

} // namespace kernel
} // namespace mindspore

+ 2
- 2
mindspore/ccsrc/debug/data_dump/dump_json_parser.cc View File

@@ -59,9 +59,9 @@ std::string GetIfstreamString(const std::ifstream &ifstream) {
bool DumpJsonParser::IsDumpEnabled() {
auto config_path = std::getenv(kMindsporeDumpConfig);
if (config_path == nullptr) {
MS_LOG(INFO) << "Dump config path is null";
return false;
}
MS_LOG(INFO) << "Dump config path is " << config_path;

auto context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context);
@@ -389,9 +389,9 @@ bool DumpJsonParser::OutputNeedDump() const {

void DumpJsonParser::UpdateNeedDumpKernels(NotNull<const session::KernelGraph *> kernel_graph) {
if (!async_dump_enabled_) {
MS_LOG(INFO) << "E2e dump no need to update dump kernel list";
return;
}
MS_LOG(INFO) << "Update async dump kernel list for hccl";
std::map<std::string, uint32_t> update_kernels;
for (const auto &kernel : kernel_graph->execution_order()) {
MS_EXCEPTION_IF_NULL(kernel);


+ 1
- 1
mindspore/ccsrc/debug/data_dump/e2e_dump_util.cc View File

@@ -314,9 +314,9 @@ bool E2eDumpUtil::DumpData(const session::KernelGraph *graph, uint32_t device_id
dump_json_parser.UpdateDumpIter();
auto dump_flag = dump_json_parser.e2e_dump_enabled();
if (!dump_flag) {
MS_LOG(INFO) << "E2e dump is disabled, skip dump step";
return true;
}
MS_LOG(INFO) << "E2e dump data start";

if (dump_json_parser.iteration() != 0) {
if (dump_json_parser.cur_dump_iter() != dump_json_parser.iteration()) {


+ 3
- 3
mindspore/ccsrc/runtime/device/ascend/executor/ai_core_dynamic_kernel.cc View File

@@ -113,13 +113,13 @@ void AiCoreDynamicKernel::UpdateArgs() {
runtime_args_.clear();

(void)std::transform(std::begin(kernel_inputs), std::end(kernel_inputs), std::back_inserter(runtime_args_),
[](const AddressPtr &input) -> void * { return input->addr; });
[](const AddressPtr &input) { return input->addr; });
(void)std::transform(std::begin(kernel_outputs), std::end(kernel_outputs), std::back_inserter(runtime_args_),
[](const AddressPtr &output) -> void * { return output->addr; });
[](const AddressPtr &output) { return output->addr; });
// Update workspace
if (!workspace_addr_.empty()) {
(void)std::transform(std::begin(workspace_addr_), std::end(workspace_addr_), std::back_inserter(runtime_args_),
[](const DeviceAddressPtr &address_ptr) -> void * { return address_ptr->GetMutablePtr(); });
[](const DeviceAddressPtr &address_ptr) { return address_ptr->GetMutablePtr(); });
}

if (is_dynamic_shape_ && !tiling_data_.empty() && tiling_data_ptr_ != nullptr) {


+ 0
- 1
mindspore/ccsrc/runtime/device/executor/dynamic_kernel.h View File

@@ -26,7 +26,6 @@

namespace mindspore {
namespace device {

constexpr auto kDynamicShapeDepends = "dynamic_shape_depends";

class DynamicKernel {


Loading…
Cancel
Save