Skip to content

Commit 7d1b146

Browse files
committed
Merge branch 'develop' of github.com:PaddlePaddle/Paddle into overlap_memcpy_with_dist
2 parents 3d875b6 + 1d7e60f commit 7d1b146

File tree

223 files changed

+7729
-3454
lines changed

Some content is hidden

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

223 files changed

+7729
-3454
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
| jczaja | Jacek Czaja |
2323
| JiayiFeng | Jia-Yi Feng |
2424
| kbinias | Krzysztof Binias |
25+
| kexinzhao | Ke-Xin Zhao |
2526
| kuke | Yi-Bing Liu |
2627
| lcy-seso | Ying Cao |
2728
| lipeng-unisound | Peng Li |

benchmark/fluid/fluid_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def dist_transpile(trainer_id, args):
9797
return train_program, fluid.default_startup_program()
9898
else:
9999
raise ValueError(
100-
'TRAINING_ROLE environment variable must be either TRAINER or PSERVER'
100+
'PADDLE_TRAINING_ROLE environment variable must be either TRAINER or PSERVER'
101101
)
102102

103103

benchmark/fluid/kube_gen_job.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ def gen_job():
108108
tn_container["ports"][0]["containerPort"] = spreadport
109109

110110
envs.append({"name": "PADDLE_JOB_NAME", "value": args.jobname})
111-
envs.append({"name": "TRAINERS", "value": str(args.trainers)})
111+
envs.append({"name": "PADDLE_TRAINERS", "value": str(args.trainers)})
112112
envs.append({"name": "PSERVERS", "value": str(args.pservers)})
113113
envs.append({"name": "ENTRY", "value": args.entry})
114-
envs.append({"name": "PADDLE_INIT_PORT", "value": str(args.port)})
114+
envs.append({"name": "PADDLE_PSERVER_PORT", "value": str(args.port)})
115115
envs.append({"name": "PADDLE_PSERVER_PORT", "value": str(args.port)})
116116
# NOTE: these directories below are cluster specific, please modify
117117
# this settings before you run on your own cluster.
@@ -167,16 +167,22 @@ def gen_job():
167167
tn_container["volumeMounts"] = volumeMounts
168168

169169
ps_container["env"] = envs
170-
ps_container["env"].append({"name": "TRAINING_ROLE", "value": "PSERVER"})
170+
ps_container["env"].append({
171+
"name": "PADDLE_TRAINING_ROLE",
172+
"value": "PSERVER"
173+
})
171174
tn_container["env"] = envs
172175
if args.disttype == "pserver":
173176
tn_container["env"].append({
174-
"name": "TRAINING_ROLE",
177+
"name": "PADDLE_TRAINING_ROLE",
175178
"value": "TRAINER"
176179
})
177180
elif args.disttype == "nccl2" or args.disttype == "local":
178181
# NCCL2 have no training role, set to plain WORKER
179-
tn_container["env"].append({"name": "TRAINING_ROLE", "value": "WORKER"})
182+
tn_container["env"].append({
183+
"name": "PADDLE_TRAINING_ROLE",
184+
"value": "WORKER"
185+
})
180186

181187
os.mkdir(args.jobname)
182188
if args.disttype == "pserver":

benchmark/fluid/models/machine_translation.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,6 @@ def simple_attention(encoder_vec, encoder_proj, decoder_state):
173173
return avg_cost, feeding_list
174174

175175

176-
def to_lodtensor(data, place):
177-
seq_lens = [len(seq) for seq in data]
178-
cur_len = 0
179-
lod = [cur_len]
180-
for l in seq_lens:
181-
cur_len += l
182-
lod.append(cur_len)
183-
flattened_data = np.concatenate(data, axis=0).astype("int64")
184-
flattened_data = flattened_data.reshape([len(flattened_data), 1])
185-
lod_t = core.LoDTensor()
186-
lod_t.set(flattened_data, place)
187-
lod_t.set_lod([lod])
188-
return lod_t, lod[-1]
189-
190-
191176
def lodtensor_to_ndarray(lod_tensor):
192177
dims = lod_tensor.get_dims()
193178
ndarray = np.zeros(shape=dims).astype('float32')

benchmark/fluid/models/stacked_dynamic_lstm.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,3 @@ def gate_common(
125125
batch_size=args.batch_size)
126126

127127
return loss, inference_program, adam, train_reader, test_reader, batch_acc
128-
129-
130-
def to_lodtensor(data, place):
131-
seq_lens = [len(seq) for seq in data]
132-
cur_len = 0
133-
lod = [cur_len]
134-
for l in seq_lens:
135-
cur_len += l
136-
lod.append(cur_len)
137-
flattened_data = numpy.concatenate(data, axis=0).astype("int64")
138-
flattened_data = flattened_data.reshape([len(flattened_data), 1])
139-
res = fluid.LoDTensor()
140-
res.set(flattened_data, place)
141-
res.set_lod([lod])
142-
return res

cmake/external/mkldnn.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ IF(${CBLAS_PROVIDER} STREQUAL "MKLML")
4545
ELSE()
4646
MESSAGE(FATAL_ERROR "Should enable MKLML when build MKLDNN")
4747
ENDIF()
48-
SET(MKLDNN_FLAG "-Wno-error=strict-overflow -Wno-error=unused-result -Wno-unused-result")
48+
SET(MKLDNN_FLAG "-Wno-error=strict-overflow -Wno-error=unused-result")
49+
SET(MKLDNN_FLAG "${MKLDNN_FLAG} -Wno-unused-result -Wno-unused-value")
4950
SET(MKLDNN_CFLAG "${CMAKE_C_FLAGS} ${MKLDNN_FLAG}")
5051
SET(MKLDNN_CXXFLAG "${CMAKE_CXX_FLAGS} ${MKLDNN_FLAG}")
5152
ExternalProject_Add(

cmake/external/openblas.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ IF(NOT ${CBLAS_FOUND})
2929
"${CBLAS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}openblas${CMAKE_STATIC_LIBRARY_SUFFIX}"
3030
CACHE FILEPATH "openblas library." FORCE)
3131

32+
ADD_DEFINITIONS(-DPADDLE_USE_OPENBLAS)
33+
3234
SET(OPENBLAS_CC "${CMAKE_C_COMPILER} -Wno-unused-but-set-variable -Wno-unused-variable")
3335
SET(OPENBLAS_COMMIT "v0.2.20")
3436

cmake/inference_lib.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function(copy TARGET)
3939
message(FATAL_ERROR "${TARGET} source numbers are not equal to destination numbers")
4040
endif()
4141
math(EXPR len "${copy_lib_SRCS_len} - 1")
42-
42+
4343
add_custom_target(${TARGET} DEPENDS ${copy_lib_DEPS})
4444
foreach(index RANGE ${len})
4545
list(GET copy_lib_SRCS ${index} src)
@@ -155,6 +155,15 @@ copy(inference_lib DEPS paddle_fluid_shared paddle_fluid
155155
DSTS ${dst_dir}/${module} ${dst_dir}/${module}
156156
)
157157

158+
if(WITH_CONTRIB)
159+
set(contrib_dst_dir "${FLUID_INSTALL_DIR}/contrib/inference")
160+
copy(contrib_inference_lib DEPS paddle_inference_api
161+
SRCS ${PADDLE_SOURCE_DIR}/paddle/contrib/inference/paddle_inference_api.h
162+
${PADDLE_BINARY_DIR}/paddle/contrib/inference/libpaddle_inference_api.*
163+
DSTS ${contrib_dst_dir} ${contrib_dst_dir}
164+
)
165+
endif()
166+
158167
set(module "platform")
159168
copy(platform_lib DEPS profiler_py_proto
160169
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/dynload/*.h ${src_dir}/${module}/details/*.h

doc/fluid/api/gen_doc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
python gen_doc.py layers --submodules control_flow device io nn ops tensor detection learning_rate_scheduler > layers.rst
2+
python gen_doc.py layers --submodules control_flow device io nn ops tensor detection learning_rate_scheduler metric > layers.rst
33

44
for module in data_feeder clip metrics executor initializer io nets optimizer param_attr profiler regularizer
55
do

doc/fluid/api/initializer.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ Xavier
3333
:members:
3434
:noindex:
3535

36+
Bilinear
37+
--------
38+
39+
.. autoclass:: paddle.fluid.initializer.Bilinear
40+
:members:
41+
:noindex:
42+
3643
force_init_on_cpu
3744
-----------------
3845

@@ -73,3 +80,10 @@ XavierInitializer
7380
:members:
7481
:noindex:
7582

83+
BilinearInitializer
84+
-------------------
85+
86+
.. autoclass:: paddle.fluid.initializer.BilinearInitializer
87+
:members:
88+
:noindex:
89+

0 commit comments

Comments
 (0)