Skip to content

Commit 17bd7a4

Browse files
authored
Merge branch 'PaddlePaddle:develop' into svdvals_new_branch
2 parents 7d407b5 + 121745f commit 17bd7a4

File tree

56 files changed

+1344
-713
lines changed

Some content is hidden

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

56 files changed

+1344
-713
lines changed

_typos.toml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ extend-exclude = [
1212
anc = 'anc'
1313
arange = "arange"
1414
astroid = 'astroid'
15+
Clas = 'Clas'
16+
clen = 'clen'
1517
dout = "dout"
1618
eles = 'eles'
1719
grad = "grad"
@@ -60,10 +62,6 @@ cann = 'cann'
6062
vart = 'vart'
6163
checkings = 'checkings'
6264
childs = 'childs'
63-
Chunck = 'Chunck'
64-
clen = 'clen'
65-
Clas = 'Clas'
66-
clas = 'clas'
6765
compability = 'compability'
6866
compatiblity = 'compatiblity'
6967
Compitable = 'Compitable'
@@ -136,13 +134,6 @@ defind = 'defind'
136134
defeine = 'defeine'
137135
defition = 'defition'
138136
defination = 'defination'
139-
delet = 'delet'
140-
dependecies = 'dependecies'
141-
dependecy = 'dependecy'
142-
decprecated = 'decprecated'
143-
derivated = 'derivated'
144-
descripor = 'descripor'
145-
deserailize = 'deserailize'
146137
Destory = 'Destory'
147138
DEIVCE = 'DEIVCE'
148139
dictionnary = 'dictionnary'
@@ -422,7 +413,6 @@ fo = 'fo'
422413
offets = 'offets'
423414
offseted = 'offseted'
424415
OLT = 'OLT'
425-
olny = 'olny'
426416
pn = 'pn'
427417
Operants = 'Operants'
428418
operants = 'operants'
@@ -441,13 +431,11 @@ orginal = 'orginal'
441431
onces = 'onces'
442432
outter = 'outter'
443433
outpus = 'outpus'
444-
outputing = 'outputing'
445434
outout = 'outout'
446435
ouput = 'ouput'
447436
outpout = 'outpout'
448437
ouptut = 'ouptut'
449438
Ouput = 'Ouput'
450-
ouside = 'ouside'
451439
overriden = 'overriden'
452440
Overide = 'Overide'
453441
overide = 'overide'

cmake/external/xpu.cmake

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(XPU_API_LIB_NAME "libxpuapi.so")
2222
set(XPU_RT_LIB_NAME "libxpurt.so")
2323
set(XPU_CUDA_LIB_NAME "libxpucuda.so")
2424
set(XPU_CUDA_RT_LIB_NAME "libcudart.so")
25+
set(XPU_ML_LIB_NAME "libxpuml.so")
2526
set(XPU_XFT_LIB_NAME "libxft.so")
2627
set(XPU_XPTI_LIB_NAME "libxpti.so")
2728
set(XPU_XBLAS_LIB_NAME "libxpu_blas.so")
@@ -31,7 +32,7 @@ set(XPU_XPUDNN_LIB_NAME "libxpu_dnn.so")
3132
if(NOT DEFINED XPU_XHPC_BASE_DATE)
3233
set(XPU_XHPC_BASE_DATE "dev/20241127")
3334
endif()
34-
set(XPU_XCCL_BASE_VERSION "3.0.0.5") # For XRE5
35+
set(XPU_XCCL_BASE_VERSION "3.0.1.1") # For XRE5
3536
if(NOT DEFINED XPU_XFT_BASE_VERSION)
3637
set(XPU_XFT_BASE_VERSION "20230602")
3738
endif()
@@ -146,6 +147,7 @@ set(XPU_XBLAS_LIB "${XPU_LIB_DIR}/${XPU_XBLAS_LIB_NAME}")
146147
set(XPU_RT_LIB "${XPU_LIB_DIR}/${XPU_RT_LIB_NAME}")
147148
set(XPU_CUDA_LIB "${XPU_LIB_DIR}/${XPU_CUDA_LIB_NAME}")
148149
set(XPU_CUDA_RT_LIB "${XPU_LIB_DIR}/${XPU_CUDA_RT_LIB_NAME}")
150+
set(XPU_ML_LIB "${XPU_LIB_DIR}/${XPU_ML_LIB_NAME}")
149151
set(XPU_XFA_LIB "${XPU_LIB_DIR}/${XPU_XFA_LIB_NAME}")
150152
set(XPU_XPUDNN_LIB "${XPU_LIB_DIR}/${XPU_XPUDNN_LIB_NAME}")
151153

@@ -190,6 +192,7 @@ if(WITH_XPU_XRE5)
190192
BUILD_BYPRODUCTS ${XPU_XFA_LIB}
191193
BUILD_BYPRODUCTS ${XPU_RT_LIB}
192194
BUILD_BYPRODUCTS ${XPU_CUDA_RT_LIB}
195+
BUILD_BYPRODUCTS ${XPU_ML_LIB}
193196
BUILD_BYPRODUCTS ${XPU_BKCL_LIB})
194197
else()
195198
ExternalProject_Add(
@@ -221,12 +224,6 @@ set_property(TARGET shared_xpuapi PROPERTY IMPORTED_LOCATION "${XPU_API_LIB}")
221224
# for cc_library(xxx SRCS xxx.c DEPS xpulib)
222225
generate_dummy_static_lib(LIB_NAME "xpulib" GENERATOR "xpu.cmake")
223226

224-
if(WITH_XPU_XRE5)
225-
target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_CUDA_RT_LIB})
226-
else()
227-
target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB})
228-
endif()
229-
230227
if(WITH_XPU_XFT)
231228
message(STATUS "Compile with XPU XFT!")
232229
add_definitions(-DPADDLE_WITH_XPU_XFT)
@@ -272,13 +269,20 @@ if(WITH_XPU_XRE5)
272269
xpulib
273270
${XPU_RT_LIB}
274271
${XPU_CUDA_RT_LIB}
275-
${XPU_BKCL_LIB}
276272
${XPU_XBLAS_LIB}
277273
${XPU_API_LIB}
278274
${XPU_XFA_LIB}
279275
${XPU_XPUDNN_LIB})
280276
else()
281-
target_link_libraries(xpulib ${XPU_RT_LIB} ${XPU_BKCL_LIB} ${XPU_API_LIB})
277+
target_link_libraries(xpulib ${XPU_RT_LIB} ${XPU_API_LIB})
278+
endif()
279+
280+
if(WITH_XPU_BKCL)
281+
if(WITH_XPU_XRE5)
282+
target_link_libraries(xpulib ${XPU_ML_LIB} ${XPU_BKCL_LIB})
283+
else()
284+
target_link_libraries(xpulib ${XPU_BKCL_LIB})
285+
endif()
282286
endif()
283287

284288
add_dependencies(xpulib ${XPU_PROJECT})

paddle/cinn/hlir/dialect/operator/transforms/pd_to_cinn_pass.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,18 @@ class FullWithTensorOpPattern
969969
.result(0);
970970
}
971971

972-
auto out =
973-
rewriter.Build<paddle::dialect::ExpandOp>(value, shape).result(0);
972+
const auto &out = [&]() -> pir::Value {
973+
const auto &out_type =
974+
op->result(0).type().dyn_cast<paddle::dialect::DenseTensorType>();
975+
if (out_type.dims().size() == 0) {
976+
const auto &dtype =
977+
op->attribute<paddle::dialect::DataTypeAttribute>("dtype").data();
978+
return rewriter
979+
.Build<paddle::dialect::FullOp>(std::vector<int64_t>{}, 0.0, dtype)
980+
.result(0);
981+
}
982+
return rewriter.Build<paddle::dialect::ExpandOp>(value, shape).result(0);
983+
}();
974984

975985
rewriter.ReplaceAllUsesWith(op.result(0), out);
976986

paddle/common/flags.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,8 +1521,8 @@ PHI_DEFINE_EXPORTED_bool(use_shm_cache,
15211521
* Since Version: 2.6.2
15221522
* Value Range: bool, default=false
15231523
* Example:
1524-
* Note: . If True, mmap_allocator will use file descripor to open shared memory
1525-
* operation.
1524+
* Note: . If True, mmap_allocator will use file descriptor to open shared
1525+
* memory operation.
15261526
*/
15271527
PHI_DEFINE_EXPORTED_bool(dataloader_use_file_descriptor,
15281528
false,

paddle/fluid/eager/autograd_meta.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ using AbstractAutogradMeta = paddle::AbstractAutogradMeta;
5656
*
5757
* **/
5858

59-
// No other AutogradMeta class should be derivated from AbstractAutogradMeta.
59+
// No other AutogradMeta class should be derived from AbstractAutogradMeta.
6060
// It's only used by
6161
class AutogradMeta : public AbstractAutogradMeta {
6262
public:

paddle/fluid/framework/framework.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,19 @@ message VarType {
195195
}
196196
optional TensorDesc selected_rows = 2;
197197

198-
message LoDTensorDesc {
198+
message DenseTensorDesc {
199199
required TensorDesc tensor = 1;
200200
optional int32 lod_level = 2 [ default = 0 ];
201201
}
202-
optional LoDTensorDesc lod_tensor = 3;
202+
optional DenseTensorDesc dense_tensor = 3;
203203

204-
message LoDTensorArrayDesc {
204+
message DenseTensorArrayDesc {
205205
required TensorDesc tensor = 1;
206206
optional int32 lod_level = 2 [ default = 0 ];
207207
}
208-
optional LoDTensorArrayDesc tensor_array = 4;
208+
optional DenseTensorArrayDesc tensor_array = 4;
209209

210-
message ReaderDesc { repeated LoDTensorDesc lod_tensor = 1; }
210+
message ReaderDesc { repeated DenseTensorDesc dense_tensor = 1; }
211211
optional ReaderDesc reader = 5;
212212

213213
message Tuple { repeated Type element_type = 1; }

paddle/fluid/framework/ir/lock_free_optimize_pass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Graph;
3030

3131
/*
3232
* Remove the sum op of all gradients of the backward op.
33-
* And remove the dependecies of the optimizer related to the
33+
* And remove the dependencies of the optimizer related to the
3434
* same backward op.
3535
*
3636
* Before this pass:

paddle/fluid/framework/op_registry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class OpVersionMap_OpVersionPair;
6161
class ProgramDesc;
6262
class VarDesc;
6363
class VarType;
64-
class VarType_LoDTensorArrayDesc;
65-
class VarType_LoDTensorDesc;
64+
class VarType_DenseTensorArrayDesc;
65+
class VarType_DenseTensorDesc;
6666
class VarType_ReaderDesc;
6767
class VarType_TensorDesc;
6868
class VarType_Tuple;

paddle/fluid/framework/shape_inference.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class OpVersionMap_OpVersionPair;
4141
class ProgramDesc;
4242
class VarDesc;
4343
class VarType;
44-
class VarType_LoDTensorArrayDesc;
45-
class VarType_LoDTensorDesc;
44+
class VarType_DenseTensorArrayDesc;
45+
class VarType_DenseTensorDesc;
4646
class VarType_ReaderDesc;
4747
class VarType_TensorDesc;
4848
class VarType_Tuple;

paddle/fluid/framework/var_desc.cc

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ void VarDesc::SetShape(const std::vector<int64_t> &dims) {
5858
void VarDesc::SetTensorDescNum(size_t num) {
5959
switch (desc_.type().type()) {
6060
case proto::VarType::READER: {
61-
auto *lod_tensors_ptr =
62-
desc_.mutable_type()->mutable_reader()->mutable_lod_tensor();
63-
lod_tensors_ptr->Clear();
61+
auto *dense_tensors_ptr =
62+
desc_.mutable_type()->mutable_reader()->mutable_dense_tensor();
63+
dense_tensors_ptr->Clear();
6464
for (size_t i = 0; i < num; ++i) {
65-
lod_tensors_ptr->Add();
65+
dense_tensors_ptr->Add();
6666
}
6767
return;
6868
} break;
@@ -78,7 +78,7 @@ void VarDesc::SetTensorDescNum(size_t num) {
7878
size_t VarDesc::GetTensorDescNum() const {
7979
switch (desc_.type().type()) {
8080
case proto::VarType::READER:
81-
return desc_.type().reader().lod_tensor_size();
81+
return desc_.type().reader().dense_tensor_size();
8282
break;
8383
default:
8484
PADDLE_THROW(
@@ -162,7 +162,7 @@ std::vector<proto::VarType::Type> VarDesc::GetDataTypes() const {
162162
void VarDesc::SetLoDLevel(int32_t lod_level) {
163163
switch (desc_.type().type()) {
164164
case proto::VarType::DENSE_TENSOR:
165-
desc_.mutable_type()->mutable_lod_tensor()->set_lod_level(lod_level);
165+
desc_.mutable_type()->mutable_dense_tensor()->set_lod_level(lod_level);
166166
break;
167167
case proto::VarType::DENSE_TENSOR_ARRAY:
168168
desc_.mutable_type()->mutable_tensor_array()->set_lod_level(lod_level);
@@ -187,9 +187,9 @@ void VarDesc::SetLoDLevels(const std::vector<int32_t> &multiple_lod_level) {
187187
switch (desc_.type().type()) {
188188
case proto::VarType::READER: {
189189
size_t i = 0;
190-
for (auto &lod_tensor :
191-
*desc_.mutable_type()->mutable_reader()->mutable_lod_tensor()) {
192-
lod_tensor.set_lod_level(multiple_lod_level[i++]);
190+
for (auto &dense_tensor :
191+
*desc_.mutable_type()->mutable_reader()->mutable_dense_tensor()) {
192+
dense_tensor.set_lod_level(multiple_lod_level[i++]);
193193
}
194194
} break;
195195
default:
@@ -203,7 +203,7 @@ void VarDesc::SetLoDLevels(const std::vector<int32_t> &multiple_lod_level) {
203203
int32_t VarDesc::GetLoDLevel() const {
204204
switch (desc_.type().type()) {
205205
case proto::VarType::DENSE_TENSOR:
206-
return desc_.type().lod_tensor().lod_level();
206+
return desc_.type().dense_tensor().lod_level();
207207
case proto::VarType::DENSE_TENSOR_ARRAY:
208208
return desc_.type().tensor_array().lod_level();
209209
default:
@@ -217,9 +217,9 @@ std::vector<int32_t> VarDesc::GetLoDLevels() const {
217217
std::vector<int32_t> res;
218218
switch (desc_.type().type()) {
219219
case proto::VarType::READER:
220-
res.reserve(desc_.type().reader().lod_tensor_size());
221-
for (auto &lod_tensor : desc_.type().reader().lod_tensor()) {
222-
res.push_back(lod_tensor.lod_level());
220+
res.reserve(desc_.type().reader().dense_tensor_size());
221+
for (auto &dense_tensor : desc_.type().reader().dense_tensor()) {
222+
res.push_back(dense_tensor.lod_level());
223223
}
224224
return res;
225225
break;
@@ -243,7 +243,7 @@ const proto::VarType::TensorDesc &VarDesc::tensor_desc() const {
243243
case proto::VarType::SELECTED_ROWS:
244244
return desc_.type().selected_rows();
245245
case proto::VarType::DENSE_TENSOR:
246-
return desc_.type().lod_tensor().tensor();
246+
return desc_.type().dense_tensor().tensor();
247247
case proto::VarType::DENSE_TENSOR_ARRAY:
248248
return desc_.type().tensor_array().tensor();
249249
case proto::VarType::STRINGS:
@@ -268,8 +268,8 @@ std::vector<proto::VarType::TensorDesc> VarDesc::tensor_descs() const {
268268
res.reserve(GetTensorDescNum());
269269
switch (desc_.type().type()) {
270270
case proto::VarType::READER:
271-
for (const auto &lod_tensor : desc_.type().reader().lod_tensor()) {
272-
res.push_back(lod_tensor.tensor());
271+
for (const auto &dense_tensor : desc_.type().reader().dense_tensor()) {
272+
res.push_back(dense_tensor.tensor());
273273
}
274274
return res;
275275
default:
@@ -292,7 +292,7 @@ proto::VarType::TensorDesc *VarDesc::mutable_tensor_desc() {
292292
case proto::VarType::SELECTED_ROWS:
293293
return desc_.mutable_type()->mutable_selected_rows();
294294
case proto::VarType::DENSE_TENSOR:
295-
return desc_.mutable_type()->mutable_lod_tensor()->mutable_tensor();
295+
return desc_.mutable_type()->mutable_dense_tensor()->mutable_tensor();
296296
case proto::VarType::DENSE_TENSOR_ARRAY:
297297
return desc_.mutable_type()->mutable_tensor_array()->mutable_tensor();
298298
case proto::VarType::STRINGS:
@@ -323,9 +323,9 @@ std::vector<proto::VarType::TensorDesc *> VarDesc::mutable_tensor_descs() {
323323
res.reserve(GetTensorDescNum());
324324
switch (desc_.type().type()) {
325325
case proto::VarType::READER:
326-
for (auto &lod_tensor :
327-
*desc_.mutable_type()->mutable_reader()->mutable_lod_tensor()) {
328-
res.push_back(lod_tensor.mutable_tensor());
326+
for (auto &dense_tensor :
327+
*desc_.mutable_type()->mutable_reader()->mutable_dense_tensor()) {
328+
res.push_back(dense_tensor.mutable_tensor());
329329
}
330330
return res;
331331
default:

0 commit comments

Comments
 (0)