pull/8563/head
caifubi 4 years ago
parent 5f7a9bd0b8
commit 589dd9e782

@ -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);

@ -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

@ -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

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

@ -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);

@ -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()) {

@ -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) {

@ -26,7 +26,6 @@
namespace mindspore {
namespace device {
constexpr auto kDynamicShapeDepends = "dynamic_shape_depends";
class DynamicKernel {

Loading…
Cancel
Save