Skip to content

Commit

Permalink
[CodeStyle] remove unused-variable warning in linux (#47558)
Browse files Browse the repository at this point in the history
* remove unused-variable warning in linux

* fix unused-variable error in GpuPS
  • Loading branch information
GreatV authored Nov 3, 2022
1 parent 66a1df3 commit e67d6f1
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmake/flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ if(NOT WIN32)
-Wno-error=terminate # Warning in PADDLE_ENFORCE
-Wno-error=int-in-bool-context # Warning in Eigen gcc 7.2
-Wimplicit-fallthrough=0 # Warning in tinyformat.h
-Wno-error=maybe-uninitialized # Warning in boost gcc 7.2
-Wno-error=maybe-uninitialized # Warning in Paddle-Lite
${fsanitize})

if(WITH_IPU)
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/distributed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endif()
proto_library(ps_framework_proto SRCS the_one_ps.proto)

set(DISTRIBUTE_COMPILE_FLAGS
"-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=unused-variable -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result"
"-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result"
)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,6 @@ void GeoCommunicator::InitImpl(const RpcCtxMap &send_varname_to_ctx,
if (varnames.empty()) {
VLOG(0) << "ERROR! sparse variables num can not be zero";
}
auto &varname = varnames[0]; // embedding_0.w_0@GRAD
auto &ids = ctx.remote_sparse_ids;
if (!ids.empty()) {
it = send_varname_to_ctx_.erase(it);
Expand Down
1 change: 0 additions & 1 deletion paddle/fluid/distributed/ps/table/common_graph_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,6 @@ int32_t GraphTable::load_edges(const std::string &path,
const std::string &edge_type) {
#ifdef PADDLE_WITH_HETERPS
if (search_level == 2) total_memory_cost = 0;
const uint64_t fixed_load_edges = 1000000;
#endif
int idx = 0;
if (edge_type == "") {
Expand Down
1 change: 0 additions & 1 deletion paddle/fluid/distributed/ps/table/memory_dense_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ int32_t MemoryDenseTable::Save(const std::string &path,
std::vector<std::string> result_buffer_param;
result_buffer_param.reserve(param_dim_);
auto common = _config.common();
int size = static_cast<int>(common.params().size());
if (_config.common().name() == "summary") {
for (int x = 0; x < param_dim_; ++x) {
result_buffer_param.emplace_back(std::to_string(values_[param_idx_][x]));
Expand Down
2 changes: 0 additions & 2 deletions paddle/fluid/distributed/ps/table/memory_sparse_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ int64_t MemorySparseTable::CacheShuffle(
int shuffle_node_num = _config.sparse_table_cache_file_num();
LOG(INFO) << "Table>> shuffle node num is: " << shuffle_node_num;
// TODO(zhaocaibei123): check shuffle_node_num <= server_node_num
size_t file_start_idx = _avg_local_shard_num * _shard_idx;
int thread_num = _real_local_shard_num < 20 ? _real_local_shard_num : 20;

std::vector<
Expand Down Expand Up @@ -638,7 +637,6 @@ int32_t MemorySparseTable::SaveCache(
return 0;
}
int save_param = atoi(param.c_str()); // batch_model:0 xbox:1
size_t file_start_idx = _avg_local_shard_num * _shard_idx;
std::string table_path = paddle::string::format_string(
"%s/%03d_cache/", path.c_str(), _config.table_id());
_afs_client.remove(paddle::string::format_string(
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/distributed/rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(PADDLE_RPC_SRCS python_rpc_handler.cc rpc_agent.cc)
set(DISTRIBUTE_COMPILE_FLAGS
"-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=unused-variable -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result"
"-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result"
)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
Expand Down

0 comments on commit e67d6f1

Please sign in to comment.