File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -1230,7 +1230,10 @@ void GraphTable::fennel_graph_edge_partition() {
12301230 }
12311231 inter_cost[i] = 0 ;
12321232 }
1233- CHECK_GT (max_score, 0 );
1233+ PADDLE_ENFORCE_GT (
1234+ max_score,
1235+ 0 ,
1236+ phi::errors::InvalidArgument (" max_score should be greater than 0" ));
12341237 return index;
12351238 };
12361239 // 查找关系最远点作为起点
@@ -1271,7 +1274,10 @@ void GraphTable::fennel_graph_edge_partition() {
12711274 break ;
12721275 }
12731276 }
1274- CHECK_NE (key, 0xffffffffffffffffL );
1277+ PADDLE_ENFORCE_NE (
1278+ key,
1279+ 0xffffffffffffffffL ,
1280+ phi::errors::InvalidArgument (" key should not be 0xffffffffffffffffL" ));
12751281 return key;
12761282 };
12771283 // 其它结点都添加完成,剩余的点就直接放到这个机器上面
Original file line number Diff line number Diff line change @@ -1359,10 +1359,21 @@ int MultiEncoderXPUFusePass::ApplySingleEncoderXPUFuse(
13591359 {q_cos_embedding->Name (), q_sin_embedding->Name ()});
13601360 op_desc.SetAttr (" relative_type" , 1 );
13611361 auto q_cos_emb_shape = q_cos_embedding->Var ()->GetShape ();
1362- CHECK_GE (static_cast <int >(q_cos_emb_shape.size ()), 2 )
1363- << q_cos_emb_shape.size ();
1362+ PADDLE_ENFORCE_GE (static_cast <int >(q_cos_emb_shape.size ()),
1363+ 2 ,
1364+ phi::errors::InvalidArgument (
1365+ " The rank of q_cos_embedding should be greater "
1366+ " than or equal to 2" ));
1367+
13641368 auto size_per_head = q_reshape_out->Var ()->GetShape ()[3 ];
1365- CHECK_EQ (size_per_head, q_cos_emb_shape[q_cos_emb_shape.size () - 1 ]);
1369+ PADDLE_ENFORCE_EQ (
1370+ size_per_head,
1371+ q_cos_emb_shape[q_cos_emb_shape.size () - 1 ],
1372+ phi::errors::InvalidArgument (
1373+ " The last dimension of q_cos_embedding should be %d "
1374+ " equal to size_per_head, but received %d." ,
1375+ size_per_head,
1376+ q_cos_emb_shape[q_cos_emb_shape.size () - 1 ]));
13661377 int max_pos_len = q_cos_emb_shape[q_cos_emb_shape.size () - 2 ];
13671378 VLOG (3 ) << " relative embedding max sequence len: " << max_pos_len;
13681379 op_desc.SetAttr (" max_pos_len" , max_pos_len);
You can’t perform that action at this time.
0 commit comments