From 224c726d823c31bdf3cb0f0c4f6f6000e61440a8 Mon Sep 17 00:00:00 2001 From: hbhu_bin Date: Tue, 28 Feb 2023 15:13:31 +0800 Subject: [PATCH] upgrade_ascend_20230222_master --- graphengine | 2 +- .../device/ascend/kernel/tbe/tbe_kernel_compile.cc | 11 ++++++++++- .../device/ascend/kernel/tbe/tbe_kernel_compile.h | 1 + .../plugin/device/ascend/kernel/tbe/tbe_utils.cc | 2 +- tests/st/dump/test_dynamic_shape.py | 2 +- .../dynamic_shape/test_dynamic_shape_input_train.py | 2 +- tests/st/ge/ge_pass/test_ge_passes.py | 2 +- tests/st/ops/ascend/test_dynamic_asr.py | 2 +- tests/st/pynative/test_tensor_augassign.py | 2 +- tests/st/tensor/test_logsumexp.py | 2 +- 10 files changed, 19 insertions(+), 9 deletions(-) diff --git a/graphengine b/graphengine index 0ef64f22a5e..333eb9e71ed 160000 --- a/graphengine +++ b/graphengine @@ -1 +1 @@ -Subproject commit 0ef64f22a5e5ca99c89c8753548cc53e8aeae0ae +Subproject commit 333eb9e71edfbcc698a6eb125627f6e38f9b72c4 diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.cc b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.cc index 1a78aa3d735..b157473aa33 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.cc +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.cc @@ -295,6 +295,15 @@ void TbeKernelCompileManager::ParseTargetJobStatus(const nlohmann::json &json, T } } +std::string TbeKernelCompileManager::ParseOpPattern(const std::string &json_str) const { + nlohmann::json result; + if (!ParseJson(json_str, &result)) { + MS_LOG(WARNING) << "Parse op pattern json error. Origin result: " << json_str; + return kernel::kPatternOpaque; + } + return GetJsonValue(result, "pattern"); +} + nlohmann::json TbeKernelCompileManager::TurnStrToJson(const std::string &string) const { nlohmann::json json; if (!ParseJson(string, &json)) { @@ -372,7 +381,7 @@ void TbeKernelCompileManager::SavePreBuildResult(const std::string &json_name, c MS_LOG(WARNING) << "Parse pre-build result error. Origin result: " << pre_build_result; return; } - auto op_pattern = GetJsonValue(result, "op_pattern"); + auto op_pattern = ParseOpPattern(GetJsonValue(result, "op_pattern")); auto output_data_desc = GetJsonValue(result, "op_params"); auto core_type = GetJsonValue(result, "core_type"); // save pre build result diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.h b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.h index b05c8e01364..bc57f61f55d 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.h +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_kernel_compile.h @@ -117,6 +117,7 @@ class TbeKernelCompileManager { void PrintCompileResult(const nlohmann::json &json); std::string ParseSelectAndCheckResult(const nlohmann::json &json, const CNodePtr &node) const; void ParseTargetJobStatus(const nlohmann::json &json, TargetJobStatus *target_status) const; + std::string ParseOpPattern(const std::string &json_str) const; nlohmann::json TurnStrToJson(const std::string &string) const; void SaveIOSizeInfo(const nlohmann::json &json, const std::string &json_name, const std::vector &output_nodes = {}); diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc index 43e4917da22..f05e561907d 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc @@ -491,7 +491,7 @@ void TbeUtils::GetCompileInfo(const AnfNodePtr &node, std::string *compile_info, if (!ParseJson(build_res_str, &build_res_json)) { MS_LOG(EXCEPTION) << "Parse build result for " << node->fullname_with_scope() << " error :" << build_res_str; } - *compile_info = build_res_json.dump(); + *compile_info = read_new_json.at("compileInfo").dump(); file.close(); file.clear(); MS_LOG(DEBUG) << "Get compile info from json file success."; diff --git a/tests/st/dump/test_dynamic_shape.py b/tests/st/dump/test_dynamic_shape.py index 2dc264607c1..7bfe2620656 100644 --- a/tests/st/dump/test_dynamic_shape.py +++ b/tests/st/dump/test_dynamic_shape.py @@ -178,7 +178,7 @@ class ReluReduceMeanDenseRelu(Cell): return x_ -@pytest.mark.level0 +@pytest.mark.level1 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard diff --git a/tests/st/ge/dynamic_shape/test_dynamic_shape_input_train.py b/tests/st/ge/dynamic_shape/test_dynamic_shape_input_train.py index d05bda21d75..43b488ac8e0 100644 --- a/tests/st/ge/dynamic_shape/test_dynamic_shape_input_train.py +++ b/tests/st/ge/dynamic_shape/test_dynamic_shape_input_train.py @@ -177,7 +177,7 @@ def train(batch_size, lr, momentum, epochs, dataset_sink_mode): return avg_loss -@pytest.mark.level0 +@pytest.mark.level1 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard diff --git a/tests/st/ge/ge_pass/test_ge_passes.py b/tests/st/ge/ge_pass/test_ge_passes.py index 257f0097ffb..21fde68a64b 100644 --- a/tests/st/ge/ge_pass/test_ge_passes.py +++ b/tests/st/ge/ge_pass/test_ge_passes.py @@ -76,7 +76,7 @@ def test_convert_attr_to_input(): utils.run_testcase('pass_convert_attr_to_input') -@pytest.mark.level0 +@pytest.mark.level1 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard diff --git a/tests/st/ops/ascend/test_dynamic_asr.py b/tests/st/ops/ascend/test_dynamic_asr.py index 09f182a2543..cae9c13124c 100644 --- a/tests/st/ops/ascend/test_dynamic_asr.py +++ b/tests/st/ops/ascend/test_dynamic_asr.py @@ -321,7 +321,7 @@ class MaxPool(nn.Cell): return out -@pytest.mark.level0 +@pytest.mark.level1 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard diff --git a/tests/st/pynative/test_tensor_augassign.py b/tests/st/pynative/test_tensor_augassign.py index f289fc3c2f8..0f911257d6d 100644 --- a/tests/st/pynative/test_tensor_augassign.py +++ b/tests/st/pynative/test_tensor_augassign.py @@ -428,7 +428,7 @@ def test_tesnsor_augassign_by_tensor(): # GPU: does not supported op "FloorMod" -@pytest.mark.level0 +@pytest.mark.level1 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard diff --git a/tests/st/tensor/test_logsumexp.py b/tests/st/tensor/test_logsumexp.py index e9d8c06a51c..6d363ac79e2 100644 --- a/tests/st/tensor/test_logsumexp.py +++ b/tests/st/tensor/test_logsumexp.py @@ -24,7 +24,7 @@ class Net(nn.Cell): return x.logsumexp(dim, keepdim=True) -@pytest.mark.level0 +@pytest.mark.level1 @pytest.mark.platform_x86_cpu @pytest.mark.platform_arm_cpu @pytest.mark.platform_x86_gpu_training