Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc11compile error #173

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cmake/external_libs/mkl_dnn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ set(onednn_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(onednn_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
mindspore_add_pkg(onednn
VER 2.2
VER 2.4.4
LIBS dnnl mkldnn
HEAD_ONLY ./include
RELEASE on
URL https://github.com/oneapi-src/oneDNN/releases/download/v2.2/dnnl_win_2.2.0_cpu_vcomp.zip
URL https://github.com/oneapi-src/oneDNN/releases/download/v2.4/dnnl_win_2.4.4_cpu_vcomp.zip
MD5 fa12c693b2ec07700d174e1e99d60a7e)
else()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/MKL-DNN/repository/archive/v2.2.tar.gz")
set(MD5 "49c650e0cc24ef9ae7033d4cb22ebfad")
set(REQ_URL "https://gitee.com/mirrors/MKL-DNN/repository/archive/v2.4.4.tar.gz")
set(MD5 "8789434977e918f45cc430277c8eb803")
else()
set(REQ_URL "https://github.com/oneapi-src/oneDNN/archive/v2.2.tar.gz")
set(MD5 "6a062e36ea1bee03ff55bf44ee243e27")
set(REQ_URL "https://github.com/oneapi-src/oneDNN/archive/v2.4.4.tar.gz")
set(MD5 "791bbe23cba4a6de22d20a0e1f72a077")
endif()
mindspore_add_pkg(onednn
VER 2.2
VER 2.4.4
LIBS dnnl mkldnn
URL ${REQ_URL}
MD5 ${MD5}
Expand Down
2 changes: 1 addition & 1 deletion cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ endif()

if(ENABLE_CPU)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
install(FILES ${onednn_LIBPATH}/libdnnl.so.2.2
install(FILES ${onednn_LIBPATH}/libdnnl.so.2.4
DESTINATION ${INSTALL_LIB_DIR} RENAME libdnnl.so.2 COMPONENT mindspore)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/libdnnl*${CMAKE_SHARED_LIBRARY_SUFFIX}*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ void DumpParallelGroups(const std::vector<std::vector<AnfNodePtrList>> &groups,
MS_LOG(INFO) << "[" << title << "]"
<< "There are " << groups.size() << " parallel groups, their detail is: ";
int i = 0;
for (const auto group : groups) {
for (const auto &group : groups) {
std::stringstream buf;
buf << "[" << i << " group] " << group.size() << ":\n";
for (const auto nodes : group) {
for (const auto &nodes : group) {
buf << " " << nodes.size() << ": [<";
for (const auto node : nodes) {
for (const auto &node : nodes) {
buf << "(" << DumpNode(node) << ") -> ";
}
buf << ">]\n";
Expand Down
1 change: 1 addition & 0 deletions mindspore/ccsrc/debug/env_config_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <map>
#include <set>
#include <mutex>
#include <optional>
#include "nlohmann/json.hpp"
#include "utils/ms_utils.h"
namespace mindspore {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <string>
#include <utility>
#include <vector>
#include <stdexcept>
#include <limits>

#include "frontend/parallel/auto_parallel/rec_core/rec_graph.h"
#include "frontend/parallel/auto_parallel/rec_core/rec_strategy.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Status DatasetIterator::GetNextAsMap(TensorMap *out_map) {
}

// Populate the out map from the row and return it
for (const auto colMap : col_name_id_map_) {
for (const auto &colMap : col_name_id_map_) {
std::string column_name = colMap.first;
// Need to filter meta column start with kDftMetaColumnPrefix
size_t pos = column_name.find(kDftMetaColumnPrefix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ GraphDataServiceImpl::GraphDataServiceImpl(GraphDataServer *server, GraphDataImp

Status GraphDataServiceImpl::FillDefaultFeature(GnnClientRegisterResponsePb *response) {
const auto default_node_features = graph_data_impl_->GetAllDefaultNodeFeatures();
for (const auto feature : *default_node_features) {
for (const auto &feature : *default_node_features) {
GnnFeatureInfoPb *feature_info = response->add_default_node_feature();
feature_info->set_type(feature.first);
RETURN_IF_NOT_OK(TensorToPb(feature.second->Value(), feature_info->mutable_feature()));
}
const auto default_edge_features = graph_data_impl_->GetAllDefaultEdgeFeatures();
for (const auto feature : *default_edge_features) {
for (const auto &feature : *default_edge_features) {
GnnFeatureInfoPb *feature_info = response->add_default_edge_feature();
feature_info->set_type(feature.first);
RETURN_IF_NOT_OK(TensorToPb(feature.second->Value(), feature_info->mutable_feature()));
Expand Down
2 changes: 1 addition & 1 deletion mindspore/ccsrc/ps/core/file_configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void FileConfiguration::PersistNodes(const core::ClusterConfig &clusterConfig) c
persist_js[kRecoveryNextServerRankId] = clusterConfig.initial_next_server_rank_id;

auto node_infos = clusterConfig.initial_registered_nodes_infos;
for (const auto kvs : node_infos) {
for (const auto &kvs : node_infos) {
std::unordered_map<std::string, std::string> res;
res["ip"] = kvs.second.ip_;
res["port"] = std::to_string(kvs.second.port_);
Expand Down
4 changes: 2 additions & 2 deletions mindspore/ccsrc/ps/core/scheduler_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void SchedulerNode::RunRecovery() {
node_manager_.set_next_server_rank_id(clusterConfig.initial_next_server_rank_id);
node_manager_.set_total_node_num(clusterConfig.initial_total_node_num);

for (const auto kvs : initial_node_infos) {
for (const auto &kvs : initial_node_infos) {
auto client = std::make_shared<TcpClient>(kvs.second.ip_, kvs.second.port_, config_.get());
client->SetMessageCallback(
[&](const std::shared_ptr<MessageMeta> &meta, const Protos &protos, const void *data, size_t size) {
Expand Down Expand Up @@ -1348,7 +1348,7 @@ void SchedulerNode::BroadcastTimeoutEvent() {
auto initial_node_infos = clusterConfig.initial_registered_nodes_infos;
const uint32_t event = static_cast<uint32_t>(ps::UserDefineEvent::kNodeTimeout);
MS_LOG(INFO) << "Broad timeout event:" << event;
for (const auto kvs : initial_node_infos) {
for (const auto &kvs : initial_node_infos) {
auto client = GetOrCreateClient(kvs.second);
SendEvent(client, event);
}
Expand Down
2 changes: 1 addition & 1 deletion mindspore/ccsrc/ps/core/scheduler_recovery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bool SchedulerRecovery::Recover() {
<< ", the initial next server rank id:" << clusterConfig.initial_next_server_rank_id;

if (!clusterConfig.initial_registered_nodes_infos.empty()) {
for (const auto kvs : clusterConfig.initial_registered_nodes_infos) {
for (const auto &kvs : clusterConfig.initial_registered_nodes_infos) {
MS_LOG(INFO) << "The ip:" << kvs.second.ip_ << ", the port:" << kvs.second.port_
<< ", the node_id:" << kvs.second.node_id_
<< ", the node_role:" << CommUtil::NodeRoleToString(kvs.second.node_role_)
Expand Down
1 change: 1 addition & 0 deletions mindspore/ccsrc/ps/random_normal/random_normal.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifndef MINDSPORE_CCSRC_PS_RANDOM_NORMAL_RANDOM_NORMAL_H_
#define MINDSPORE_CCSRC_PS_RANDOM_NORMAL_RANDOM_NORMAL_H_
#include <vector>
#include <cstddef>

namespace mindspore {
namespace ps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <securec.h>
#include <math.h>
#include <array>
#include <cstdint>

namespace mindspore {
static constexpr int gResultNum = 4;
Expand Down
8 changes: 4 additions & 4 deletions mindspore/ccsrc/runtime/framework/control_node_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ std::set<FuncGraphPtr> GetFuncGraphbyCallNode(const AnfNodePtr &node, std::stack
}
MS_EXCEPTION_IF_NULL(make_tuple);
auto partials = make_tuple->cast<CNodePtr>()->inputs();
for (const auto partial : partials) {
for (const auto &partial : partials) {
if (IsPartial(partial)) {
std::stack<size_t> tmp_output_indexs;
(void)func_graphs.emplace(GetFuncGraphFromPartial(partial, &tmp_output_indexs));
Expand Down Expand Up @@ -335,7 +335,7 @@ void FetchWeightbyHostParameter(const AnfNodePtr &node, std::set<AnfNodePtr> *de
}

const auto weight_nodes = iter->second;
for (const auto weight_node : weight_nodes) {
for (const auto &weight_node : weight_nodes) {
FetchWeightbyHostParameter(weight_node.first, dest_nodes, front_to_front_weight);
}
}
Expand Down Expand Up @@ -1343,7 +1343,7 @@ void ControlNodeParser::ParseFormalToRealParameter(const std::vector<AnfNodePtr>
const auto &cnode = node->cast<CNodePtr>();
const auto &inputs = cnode->inputs();
const auto &func_graphs = FetchFuncGraphbyCallNode(node);
for (const auto func_graph : func_graphs) {
for (const auto &func_graph : func_graphs) {
const auto &parameters = func_graph->parameters();
for (size_t i = inputs.size() - 1, j = parameters.size() - 1; i >= kCallInputStartPos && j >= 0; --i, --j) {
MS_EXCEPTION_IF_NULL(inputs[i]);
Expand Down Expand Up @@ -1510,7 +1510,7 @@ void ControlNodeParser::ParseFrontToBackendParameter(const std::vector<KernelGra
std::set<KernelWithIndex> invalid_call_nodes;
FetchRealParameterByNode(front_node_with_index, &real_parameters, &invalid_call_nodes,
call_node_to_func_graphs_);
for (const auto real_parameter : real_parameters) {
for (const auto &real_parameter : real_parameters) {
if (real_parameter.first->isa<Parameter>() || real_parameter.first->isa<ValueNode>()) {
front_to_backend_parameters_[real_parameter].emplace(parameter, device_context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ void ControlNodeScheduler::LinkControlArrowByAutoMonad(ControlActor *to_actor, c
if (func_graphs.empty()) {
MS_LOG(EXCEPTION) << "Failed to get funcgraph by call node:" << depend_node->DebugString();
}
for (const auto func_graph : func_graphs) {
for (const auto &func_graph : func_graphs) {
auto exit_actor_name = func_graph->ToString() + kExitActorNameSuffix;
from_actor = FetchActor(exit_actor_name);
MS_EXCEPTION_IF_NULL(from_actor);
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/build_mindspore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build_mindspore()
echo "start build mindspore project."
mkdir -pv "${BUILD_PATH}/mindspore"
cd "${BUILD_PATH}/mindspore"
CMAKE_ARGS="-DDEBUG_MODE=$DEBUG_MODE -DBUILD_PATH=$BUILD_PATH"
CMAKE_ARGS="-DDEBUG_MODE=$DEBUG_MODE -DBUILD_PATH=$BUILD_PATH -DCMAKE_EXPORT_COMPILE_COMMAND=ON"
if [[ "X$ENABLE_COVERAGE" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_COVERAGE=ON"
fi
Expand Down