!23239 [AutoPar - DRec] fix codedex warnning

Merge pull request !23239 from Chong/xtan
This commit is contained in:
i-robot 2021-09-16 07:15:25 +00:00 committed by Gitee
commit 79b6d06cbf
1 changed files with 3 additions and 2 deletions

View File

@ -73,8 +73,9 @@ Strategys PrepareMatMul(const std::shared_ptr<Graph> &graph, const std::vector<s
// HCCL does not support multi-dimension partition, and the hardware does not support excessive // HCCL does not support multi-dimension partition, and the hardware does not support excessive
// number of EVENT, so we temporarily disable matmul's multi-dimension partition function. // number of EVENT, so we temporarily disable matmul's multi-dimension partition function.
const auto max_cut = 1.0 / g_device_manager->DeviceNum(); const auto max_cut = 1.0 / g_device_manager->DeviceNum();
if (graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h != max_cut && // The rule of cut is 0.5, 0.125. To compare the result we have to use ">" so we multiply max_cut to 1.1
graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_w != max_cut) { if (graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h > max_cut * 1.1 &&
graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_w > max_cut * 1.1) {
graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h = 1.0; graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h = 1.0;
graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_w = 1.0; graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_w = 1.0;
graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_h = 1.0; graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_h = 1.0;