forked from mindspore-Ecosystem/mindspore
!23239 [AutoPar - DRec] fix codedex warnning
Merge pull request !23239 from Chong/xtan
This commit is contained in:
commit
79b6d06cbf
5
mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc
Normal file → Executable file
5
mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc
Normal file → Executable 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
|
||||
// number of EVENT, so we temporarily disable matmul's multi-dimension partition function.
|
||||
const auto max_cut = 1.0 / g_device_manager->DeviceNum();
|
||||
if (graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h != max_cut &&
|
||||
graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_w != 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
|
||||
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_w = 1.0;
|
||||
graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_h = 1.0;
|
||||
|
|
Loading…
Reference in New Issue