Skip to content

Commit 1f926b8

Browse files
authored
Replace phi::errors [fluid_ops] (#67023)
1 parent ce3e308 commit 1f926b8

File tree

109 files changed

+1569
-1540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1569
-1540
lines changed

paddle/fluid/distributed/common/chunk_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ChunkAllocator {
2727
PADDLE_ENFORCE_EQ(
2828
sizeof(Node),
2929
std::max(sizeof(void*), sizeof(T)),
30-
phi::errors::InvalidArgument(
30+
common::errors::InvalidArgument(
3131
"The size of Node is invalid. Expected sizeof(Node) == "
3232
"max(sizeof(void*), sizeif(T)).\nBut recieved sizeof(Node) = %u "
3333
"and max(sizeof(void*), sizeif(T)) = %u.",

paddle/fluid/distributed/ps/service/brpc_ps_client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,7 @@ std::future<int32_t> BrpcPsClient::PushDense(const Region *regions,
19171917
uint32_t data_num = regions[i].size / sizeof(float);
19181918
PADDLE_ENFORCE_LE((pos + data_num),
19191919
data_size,
1920-
phi::errors::InvalidArgument(
1920+
common::errors::InvalidArgument(
19211921
"Invalid dense size."
19221922
"Expect the sum of current position and data number "
19231923
"to be equal to or smaller than the size."

paddle/fluid/distributed/ps/service/brpc_ps_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class DownpourPsClientService : public PsService {
7272
PADDLE_ENFORCE_EQ(
7373
client_id,
7474
(_client->_client_id),
75-
phi::errors::PreconditionNotMet(
75+
common::errors::PreconditionNotMet(
7676
"Wrong request client's id. Expect to match self. But recieved "
7777
"request client's id = %lu and self = %lu.",
7878
client_id,

paddle/fluid/distributed/ps/service/brpc_ps_server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ int32_t BrpcPsServer::ReceiveFromPServer(int msg_type,
180180
}
181181
PADDLE_ENFORCE_EQ(ar.Cursor(),
182182
ar.Finish(),
183-
phi::errors::InvalidArgument(
183+
common::errors::InvalidArgument(
184184
"Expected 'ar.Cursor()' to be equal to 'ar.Finish()', "
185185
"but found they are not equal."));
186186
this->_shuffled_ins->Write(std::move(data));

paddle/fluid/distributed/ps/service/communicator/communicator.cc

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void Communicator::RpcSendDenseParam(const std::vector<std::string> &varnames,
165165
PADDLE_ENFORCE_NE(
166166
var,
167167
nullptr,
168-
phi::errors::InvalidArgument("Param var should not be NULL!"));
168+
common::errors::InvalidArgument("Param var should not be NULL!"));
169169
phi::DenseTensor *tensor = var->GetMutable<phi::DenseTensor>();
170170
if (phi::is_gpu_place(tensor->place())) {
171171
#ifdef PADDLE_WITH_CUDA
@@ -625,24 +625,24 @@ void AsyncCommunicator::PullSparseToTensorSync(
625625
PADDLE_ENFORCE_LT(
626626
output_index,
627627
outputs->size(),
628-
phi::errors::InvalidArgument(
628+
common::errors::InvalidArgument(
629629
"The output index should be less than %d, but got %d.",
630630
outputs->size(),
631631
output_index)); // NOLINT
632632
output = outputs->at(output_index);
633633
output->set_lod(tensor->lod());
634634
output_data = output->mutable_data<float>(place);
635635
output_len = 0;
636-
PADDLE_ENFORCE_EQ(
637-
output->numel() % fea_dim,
638-
0,
639-
phi::errors::InvalidArgument("The 'output->numel() % fea_dim' "
640-
"should be equal to 0, but got %d.",
641-
output->numel() % fea_dim)); // NOLINT
636+
PADDLE_ENFORCE_EQ(output->numel() % fea_dim,
637+
0,
638+
common::errors::InvalidArgument(
639+
"The 'output->numel() % fea_dim' "
640+
"should be equal to 0, but got %d.",
641+
output->numel() % fea_dim)); // NOLINT
642642
PADDLE_ENFORCE_NE(
643643
output_data,
644644
nullptr,
645-
phi::errors::InvalidArgument(
645+
common::errors::InvalidArgument(
646646
"The output data should not be NULL!")); // NOLINT
647647
}
648648
uint64_t real_id = static_cast<uint64_t>(ids[i]);
@@ -692,7 +692,7 @@ void AsyncCommunicator::PushSparseFromTensorAsync(
692692
}
693693
PADDLE_ENFORCE_GT(batch_size,
694694
0,
695-
phi::errors::InvalidArgument(
695+
common::errors::InvalidArgument(
696696
"The batch size should be greater than 0, but got %d.",
697697
batch_size)); // NOLINT
698698

@@ -701,22 +701,22 @@ void AsyncCommunicator::PushSparseFromTensorAsync(
701701
PADDLE_ENFORCE_EQ(
702702
show_size == batch_size || show_size == 1,
703703
true,
704-
phi::errors::InvalidArgument("The show size should be equal to batch "
705-
"size or equal to 1, but got %d.",
706-
show_size));
704+
common::errors::InvalidArgument("The show size should be equal to batch "
705+
"size or equal to 1, but got %d.",
706+
show_size));
707707
int clk_size =
708708
!clks->lod().empty() ? clks->lod()[0].size() - 1 : clks->dims()[0];
709-
PADDLE_ENFORCE_EQ(
710-
clk_size == batch_size || clk_size == 1,
711-
true,
712-
phi::errors::InvalidArgument("The clk size should be equal to batch size "
713-
"or equal to 1, but got %d.",
714-
clk_size));
709+
PADDLE_ENFORCE_EQ(clk_size == batch_size || clk_size == 1,
710+
true,
711+
common::errors::InvalidArgument(
712+
"The clk size should be equal to batch size "
713+
"or equal to 1, but got %d.",
714+
clk_size));
715715

716716
PADDLE_ENFORCE_EQ(
717717
outputs->size(),
718718
inputs->size(),
719-
phi::errors::InvalidArgument(
719+
common::errors::InvalidArgument(
720720
"The size of outputs should be equal to inputs, but the size of "
721721
"outputs is %d, the size of inputs is %d",
722722
outputs->size(),
@@ -804,7 +804,7 @@ void AsyncCommunicator::PushSparseFromTensorAsync(
804804
PADDLE_ENFORCE_EQ(
805805
static_cast<int64_t>(output_len),
806806
g_tensor->numel(),
807-
phi::errors::InvalidArgument(
807+
common::errors::InvalidArgument(
808808
"The output length should be equal to %d, but got %d.",
809809
g_tensor->numel(),
810810
static_cast<int64_t>(output_len)));

paddle/fluid/distributed/ps/service/ps_graph_client.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ ::std::future<int32_t> PsGraphClient::PullSparsePtr(
118118
VLOG(0) << "PullSparsePtr, miss key " << k << " rank=" << _rank_id;
119119
PADDLE_ENFORCE_NE(it,
120120
keys2rank_vec[shard].end(),
121-
phi::errors::InvalidArgument(
121+
common::errors::InvalidArgument(
122122
"The key was not found in the expected shard."));
123123
}
124124
} else {
@@ -217,7 +217,7 @@ ::std::future<int32_t> PsGraphClient::PullSparseKey(
217217
PADDLE_ENFORCE_NE(
218218
it,
219219
keys2rank_vec[shard].end(),
220-
phi::errors::InvalidArgument(
220+
common::errors::InvalidArgument(
221221
"The key was not found in the expected shard.", k));
222222
}
223223
} else {

paddle/fluid/distributed/ps/service/ps_service/service.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ int PSCore::InitServer(
8383
::paddle::distributed::PSServerFactory::Create(_ps_param));
8484
ret = _server_ptr->Configure(_ps_param, _ps_env, index, server_sub_program);
8585
PADDLE_ENFORCE_EQ(
86-
ret, 0UL, phi::errors::PreconditionNotMet("Failed to configure server."));
86+
ret,
87+
0UL,
88+
common::errors::PreconditionNotMet("Failed to configure server."));
8789
return ret;
8890
}
8991

paddle/fluid/distributed/ps/table/common_graph_table.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ void GraphTable::fennel_graph_edge_partition() {
12331233
PADDLE_ENFORCE_GT(
12341234
max_score,
12351235
0,
1236-
phi::errors::InvalidArgument("max_score should be greater than 0"));
1236+
common::errors::InvalidArgument("max_score should be greater than 0"));
12371237
return index;
12381238
};
12391239
// 查找关系最远点作为起点
@@ -1274,10 +1274,10 @@ void GraphTable::fennel_graph_edge_partition() {
12741274
break;
12751275
}
12761276
}
1277-
PADDLE_ENFORCE_NE(
1278-
key,
1279-
0xffffffffffffffffL,
1280-
phi::errors::InvalidArgument("key should not be 0xffffffffffffffffL"));
1277+
PADDLE_ENFORCE_NE(key,
1278+
0xffffffffffffffffL,
1279+
common::errors::InvalidArgument(
1280+
"key should not be 0xffffffffffffffffL"));
12811281
return key;
12821282
};
12831283
// 其它结点都添加完成,剩余的点就直接放到这个机器上面

paddle/fluid/distributed/ps/table/ctr_accessor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ int CtrCommonAccessor::ParseFromString(const std::string& str, float* value) {
340340
PADDLE_ENFORCE_GE(
341341
ret,
342342
6UL,
343-
phi::errors::InvalidArgument(
343+
common::errors::InvalidArgument(
344344
"Invalid return value. Expect more than 6. But recieved %d.", ret));
345345
return ret;
346346
}

paddle/fluid/distributed/ps/table/ctr_double_accessor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ int CtrDoubleAccessor::ParseFromString(const std::string& str, float* value) {
346346
PADDLE_ENFORCE_GE(
347347
str_len,
348348
6UL,
349-
phi::errors::InvalidArgument(
349+
common::errors::InvalidArgument(
350350
"Invalid string length. Expect more than 6. But recieved %d.",
351351
str_len));
352352
int show_index = CtrDoubleFeatureValue::ShowIndex();

0 commit comments

Comments
 (0)