Skip to content

Commit e66a725

Browse files
authored
Merge branch 'develop' into transpiler_doc
2 parents f63d071 + 1d7e60f commit e66a725

File tree

204 files changed

+7049
-3374
lines changed

Some content is hidden

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

204 files changed

+7049
-3374
lines changed

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(

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 transpiler
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+

doc/fluid/api/io.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,39 @@ get_inference_program
5959
.. autofunction:: paddle.fluid.io.get_inference_program
6060
:noindex:
6161

62+
save_checkpoint
63+
---------------
64+
65+
.. autofunction:: paddle.fluid.io.save_checkpoint
66+
:noindex:
67+
68+
load_checkpoint
69+
---------------
70+
71+
.. autofunction:: paddle.fluid.io.load_checkpoint
72+
:noindex:
73+
74+
clean_checkpoint
75+
----------------
76+
77+
.. autofunction:: paddle.fluid.io.clean_checkpoint
78+
:noindex:
79+
80+
load_persist_vars_without_grad
81+
------------------------------
82+
83+
.. autofunction:: paddle.fluid.io.load_persist_vars_without_grad
84+
:noindex:
85+
86+
save_persist_vars_without_grad
87+
------------------------------
88+
89+
.. autofunction:: paddle.fluid.io.save_persist_vars_without_grad
90+
:noindex:
91+
92+
get_latest_checkpoint_serial
93+
----------------------------
94+
95+
.. autofunction:: paddle.fluid.io.get_latest_checkpoint_serial
96+
:noindex:
97+

0 commit comments

Comments
 (0)