Skip to content

Commit b4ebfe5

Browse files
committed
Merge branch 'macro3' of github.com:uanu2002/Paddle into macro3
2 parents ff32463 + ec1dbf3 commit b4ebfe5

File tree

2,004 files changed

+35980
-23685
lines changed

Some content is hidden

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

2,004 files changed

+35980
-23685
lines changed

cmake/generic.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ function(math_library TARGET)
13121312
set(cc_srcs)
13131313
set(cu_srcs)
13141314
set(hip_srcs)
1315-
set(math_common_deps device_context framework_proto enforce)
1315+
set(math_common_deps device_context framework_proto phi common)
13161316
if(WITH_GPU)
13171317
if(${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0)
13181318
list(APPEND math_common_deps cub)

cmake/third_party.cmake

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,35 @@ if(NOT WITH_SETUP_INSTALL)
5555
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
5656
RESULT_VARIABLE result_var)
5757
if(NOT result_var EQUAL 0)
58-
message(
59-
FATAL_ERROR "Failed to update submodule, please check your network !")
58+
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
59+
set(THIRD_PARTY_TAR_URL
60+
https://xly-devops.bj.bcebos.com/PR/build_whl/0/third_party.tar.gz
61+
CACHE STRING "third_party.tar.gz url")
62+
execute_process(
63+
COMMAND wget -q ${THIRD_PARTY_TAR_URL}
64+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
65+
RESULT_VARIABLE wget_result)
66+
if(NOT wget_result EQUAL 0)
67+
message(
68+
FATAL_ERROR
69+
"Failed to download third_party.tar.gz, please check your network !"
70+
)
71+
else()
72+
execute_process(
73+
COMMAND tar -xzf third_party.tar.gz -C ${CMAKE_SOURCE_DIR}/
74+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
75+
RESULT_VARIABLE tar_result)
76+
if(NOT tar_result EQUAL 0)
77+
message(
78+
FATAL_ERROR
79+
"Failed to extract third_party.tar.gz, please make sure tar.gz file is not corrupted !"
80+
)
81+
endif()
82+
endif()
83+
else()
84+
message(
85+
FATAL_ERROR "Failed to update submodule, please check your network !")
86+
endif()
6087
endif()
6188

6289
endif()

paddle/cinn/adt/adt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ struct Ok final {
283283
bool operator!=(const Ok&) const { return false; }
284284
};
285285

286-
#define ADT_TODO() PADDLE_THROW(phi::errors::Fatal("TODO"))
286+
#define ADT_TODO() PADDLE_THROW(::common::errors::Fatal("TODO"))
287287

288288
inline std::size_t hash_combine(std::size_t lhs, std::size_t rhs) {
289289
return lhs ^= rhs + 0x9e3779b9 + (lhs << 6) + (lhs >> 2);

paddle/cinn/adt/anchor_sd_equation_context.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void GenerateScheduleMeshEquationsImpl(const List<ScheduleDim>& sched_dims,
3131
PADDLE_ENFORCE_EQ(
3232
input_iterators->size() == output_iterators->size(),
3333
true,
34-
phi::errors::InvalidArgument(
34+
::common::errors::InvalidArgument(
3535
"The size of input iterators and output iterators should be equal, "
3636
"but got input iterators size = %d, output iterators size = %d.",
3737
input_iterators->size(),
@@ -53,7 +53,7 @@ void GenerateScheduleMeshEquationsImpl(
5353
PADDLE_ENFORCE_EQ(
5454
shape.value()->size() == output_iterators->size(),
5555
true,
56-
phi::errors::InvalidArgument(
56+
::common::errors::InvalidArgument(
5757
"The size of shape and output iterators should be equal, but got "
5858
"shape size = %d, output iterators size = %d.",
5959
shape.value()->size(),
@@ -75,7 +75,7 @@ void GenerateScheduleMeshEquationsImpl(
7575
const auto& [sched_mesh, perm] = sched_transpose.tuple();
7676
PADDLE_ENFORCE_EQ(GetOutputRank(sched_mesh) == output_iterators->size(),
7777
true,
78-
phi::errors::InvalidArgument(
78+
::common::errors::InvalidArgument(
7979
"The size of output iterators should be equal to the "
8080
"rank of the schedule mesh, but got output iterators "
8181
"size = %d, rank of the schedule mesh = %d.",
@@ -99,7 +99,7 @@ void GenerateScheduleMeshEquationsImpl(
9999
const auto& [sched_mesh, _] = sched_padding.tuple();
100100
PADDLE_ENFORCE_EQ(GetOutputRank(sched_mesh) == output_iterators->size(),
101101
true,
102-
phi::errors::InvalidArgument(
102+
::common::errors::InvalidArgument(
103103
"The size of output iterators should be equal to the "
104104
"rank of the schedule mesh, but got output iterators "
105105
"size = %d, rank of the schedule mesh = %d.",

paddle/cinn/adt/equation_solver.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ std::unordered_map<Variable, Value> InferValuesImpl(
186186
PADDLE_ENFORCE_EQ(
187187
out_msg_in_indexes.value()->size() == in_msg_in_indexes.value()->size(),
188188
true,
189-
phi::errors::InvalidArgument(
189+
::common::errors::InvalidArgument(
190190
"The size of out_msg_in_indexes should be equal to the size of "
191191
"in_msg_in_indexes, but got out_msg_in_indexes size = %d, "
192192
"in_msg_in_indexes size = %d.",
@@ -195,7 +195,7 @@ std::unordered_map<Variable, Value> InferValuesImpl(
195195
PADDLE_ENFORCE_EQ(
196196
out_msg_out_indexes.value()->size() == in_msg_out_indexes.value()->size(),
197197
true,
198-
phi::errors::InvalidArgument(
198+
::common::errors::InvalidArgument(
199199
"The size of out_msg_out_indexes should be equal to the size of "
200200
"in_msg_out_indexes, but got out_msg_out_indexes size = %d, "
201201
"in_msg_out_indexes size = %d.",
@@ -288,8 +288,8 @@ void CheckEquationsSolvable(
288288
[&](const auto& opt_old_value, const auto& simplified_value) {
289289
LOG(ERROR) << "old_value: " << ToTxtString(opt_old_value);
290290
LOG(ERROR) << "simplified_value: " << ToTxtString(simplified_value);
291-
PADDLE_THROW(
292-
phi::errors::InvalidArgument("CheckEquationsSolvable Failed"));
291+
PADDLE_THROW(::common::errors::InvalidArgument(
292+
"CheckEquationsSolvable Failed"));
293293
return tValueInferSuccess<bool>{false};
294294
});
295295
};

paddle/cinn/adt/generate_map_expr.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ bool HasDynamicShape(const ::pir::Value& tensor) {
105105
PADDLE_ENFORCE_EQ(
106106
dim,
107107
-1UL,
108-
phi::errors::InvalidArgument(
108+
::common::errors::InvalidArgument(
109109
"The dynamic shape dim should be -1, but got %d.", dim));
110110
return true;
111111
}
@@ -249,7 +249,7 @@ std::shared_ptr<KGroup> GenerateKGroups(
249249
PADDLE_ENFORCE_EQ(
250250
igroups.size(),
251251
1UL,
252-
phi::errors::InvalidArgument(
252+
::common::errors::InvalidArgument(
253253
"The size of igroups should be 1, but got %d.", igroups.size()));
254254
return std::make_shared<KGroup>(group, igroups);
255255
}
@@ -326,7 +326,7 @@ LoopDescriptor4IterVarT MakeGetterLoopDescriptor4IterVar(
326326
PADDLE_ENFORCE_EQ(
327327
loop_iters->size(),
328328
sd->size(),
329-
phi::errors::InvalidArgument(
329+
::common::errors::InvalidArgument(
330330
"The size of loop iterators and loop descriptors should be equal, "
331331
"but got loop iterators size = %d, loop descriptors size = %d.",
332332
loop_iters->size(),
@@ -363,8 +363,8 @@ MapStmt<Stmt> MakeMapStmt(const MapIrList& map_irs) {
363363
PADDLE_ENFORCE_EQ(
364364
stmts->size(),
365365
1UL,
366-
phi::errors::InvalidArgument("The size of stmts should be 1, but got %d.",
367-
stmts->size()));
366+
::common::errors::InvalidArgument(
367+
"The size of stmts should be 1, but got %d.", stmts->size()));
368368
CHECK(stmts->at(0).Has<MapStmt<Stmt>>());
369369
return stmts->at(0).Get<MapStmt<Stmt>>();
370370
}

paddle/cinn/adt/get_sub_reshape_dim_ranges.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ GetSubReshapeDimRanges(const List<DimExpr>& lhs_dims,
8282
} else if (LhsAcc() > RhsAcc()) {
8383
rhs_end++;
8484
} else {
85-
PADDLE_THROW(phi::errors::Fatal("Dead code"));
85+
PADDLE_THROW(::common::errors::Fatal("Dead code"));
8686
}
8787
}
8888
CHECK(lhs_end == lhs_dims->size() && rhs_end == rhs_dims->size());

paddle/cinn/adt/igroup.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ List<Iterator> IGroup::GetIndexIterators(const Index& index) const {
102102
} else if (arg_pos.Has<Undefined>()) {
103103
// do nothing
104104
} else {
105-
PADDLE_THROW(phi::errors::Fatal("Dead code"));
105+
PADDLE_THROW(::common::errors::Fatal("Dead code"));
106106
}
107107
}
108-
PADDLE_THROW(phi::errors::Fatal("Can not find anchor iterators"));
108+
PADDLE_THROW(::common::errors::Fatal("Can not find anchor iterators"));
109109
}
110110

111111
} // namespace cinn::adt

paddle/cinn/adt/m_ir.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ void CollectTensorIndexIterators(const TensorIndexExpr& tensor_index_expr,
3838

3939
void CollectTensorIndexIteratorsImpl(const Undefined& tensor_index_expr,
4040
std::unordered_set<Iterator>* ret) {
41-
PADDLE_THROW(phi::errors::Unimplemented("Not Implemented"));
41+
PADDLE_THROW(::common::errors::Unimplemented("Not Implemented"));
4242
}
4343

4444
void CollectTensorIndexIteratorsImpl(const Ok& ok,
4545
std::unordered_set<Iterator>* ret) {
46-
PADDLE_THROW(phi::errors::Unimplemented("Not Implemented"));
46+
PADDLE_THROW(::common::errors::Unimplemented("Not Implemented"));
4747
}
4848

4949
void CollectTensorIndexIteratorsImpl(const Iterator& iterator,
@@ -134,7 +134,7 @@ LoopIterators GetAnchorTensorLoopIterators(
134134
namespace {
135135

136136
Tensor GetTensorImpl(const OpStmt& op_stmt, const Undefined& undefined) {
137-
PADDLE_THROW(phi::errors::Fatal("position not found"));
137+
PADDLE_THROW(::common::errors::Fatal("position not found"));
138138
}
139139

140140
Tensor GetTensorImpl(const OpStmt& op_stmt, const tIn<std::size_t>& pos) {

paddle/cinn/adt/naive_bidirection_equation_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void VisitEachInMsgOutMsgPair(const List<Index>& in_msg_indexes,
7171
PADDLE_ENFORCE_EQ(
7272
in_msg_indexes->size(),
7373
out_msg_indexes->size(),
74-
phi::errors::InvalidArgument(
74+
::common::errors::InvalidArgument(
7575
"The size of in_msg_indexes and out_msg_indexes should be equal, but "
7676
"got in_msg_indexes size = %d, out_msg_indexes size = %d.",
7777
in_msg_indexes->size(),

0 commit comments

Comments
 (0)