Skip to content

Commit 3b0c1d6

Browse files
committed
Polish copyright and error messages.
1 parent abdfd76 commit 3b0c1d6

9 files changed

+30
-23
lines changed

paddle/ap/include/paddle/pass/add_pcc_pass.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

paddle/ap/include/paddle/pass/fallback_fusion_op_to_phi_pass.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

paddle/ap/include/paddle/pass/fuse_ap_trivial_pass.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

paddle/ap/include/paddle/pass/move_trivial_fusion_range_to_fusion_op_pass.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

paddle/ap/src/paddle/pass/add_pcc_pass.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

paddle/ap/src/paddle/pass/fallback_fusion_op_to_phi_pass.cc

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -48,13 +48,16 @@ class FallbackFusionOpToPhiPattern
4848
bool MatchAndRewrite(::cinn::dialect::FusionOp fusion_op,
4949
pir::PatternRewriter& rewriter) const override {
5050
const auto& ret = TryMatchAndRewrite(fusion_op, &rewriter);
51-
PADDLE_ENFORCE(!ret.HasError(),
52-
"FallbackFusionOpToPhiPattern::MatchAndRewrite failed. "
53-
"\nTraceback (most recent call "
54-
"last):\n%s\n%s: %s. ",
55-
ret.GetError().CallStackToString(),
56-
ret.GetError().class_name(),
57-
ret.GetError().msg());
51+
PADDLE_ENFORCE_EQ(
52+
ret.HasError(),
53+
false,
54+
phi::errors::Fatal(
55+
"FallbackFusionOpToPhiPattern::MatchAndRewrite failed. "
56+
"\nTraceback (most recent call "
57+
"last):\n%s\n%s: %s. ",
58+
ret.GetError().CallStackToString(),
59+
ret.GetError().class_name(),
60+
ret.GetError().msg()));
5861
return ret.GetOkValue();
5962
}
6063

paddle/ap/src/paddle/pass/fuse_ap_trivial_pass.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

paddle/ap/src/paddle/pass/move_trivial_fusion_range_to_fusion_op_pass.cc

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -49,14 +49,16 @@ class MoveTrivialFusionRangeToFusionOpPattern
4949
::paddle::dialect::ApTrivialFusionEndOp ap_trivial_fusion_end_op,
5050
pir::PatternRewriter& rewriter) const override {
5151
const auto& ret = TryMatchAndRewrite(ap_trivial_fusion_end_op, &rewriter);
52-
PADDLE_ENFORCE(
53-
!ret.HasError(),
54-
"MoveTrivialFusionRangeToFusionOpPattern::MatchAndRewrite failed. "
55-
"\nTraceback (most recent call "
56-
"last):\n%s\n%s: %s. ",
57-
ret.GetError().CallStackToString(),
58-
ret.GetError().class_name(),
59-
ret.GetError().msg());
52+
PADDLE_ENFORCE_EQ(
53+
ret.HasError(),
54+
false,
55+
phi::errors::Fatal(
56+
"MoveTrivialFusionRangeToFusionOpPattern::MatchAndRewrite failed. "
57+
"\nTraceback (most recent call "
58+
"last):\n%s\n%s: %s. ",
59+
ret.GetError().CallStackToString(),
60+
ret.GetError().class_name(),
61+
ret.GetError().msg()));
6062
return ret.GetOkValue();
6163
}
6264

paddle/fluid/pir/dialect/op_generator/op_build_gen.py

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
'AddNInferMeta',
7373
'ApVariadicInferMeta',
7474
'ApFacadeInferMeta',
75+
'ApTrivialFusionBeginInferMeta',
76+
'ApTrivialFusionEndInferMeta',
7577
'AddNTensorArrayInferMeta',
7678
'AttentionLstmInferMeta',
7779
'AucInferMeta',

0 commit comments

Comments
 (0)