Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ddeb925
Update API usage according to 1.8 recommendations (#4657)
FlyingQianMM May 22, 2020
edf1a87
add VideoTag to video (#4666)
huangjun12 May 28, 2020
b0239e3
change some model using data loader (#4595)
chenwhql May 28, 2020
856c428
Makeing script more flexible (#4681)
jczaja Jun 3, 2020
20d1e9b
update new reader for resnet, mobilenet; test=develop (#4685)
phlrain Jun 9, 2020
5c6dded
[dygraph] Polish the timing method and log of some dygraph models. (#…
Xreki Jun 16, 2020
c5bfe4b
Update docs (#4707)
ceci3 Jun 19, 2020
5c244bf
fix paddlers readme (#4717)
frankwhzhang Jun 23, 2020
09f7796
fix fconv in paddle 1.8 (#4705)
LDOUBLEV Jul 1, 2020
2293e33
Update VOT code: add SiamRPN and SiamMask (#4734)
xbsu Jul 2, 2020
365fe58
Update README.md (#4739)
anpark Jul 5, 2020
131a315
add JiebaTokenizer demo (#4747)
Jul 10, 2020
a70288d
Fix concat (#4755)
ceci3 Jul 16, 2020
a7fb45f
update the key word of mobilenet log (#4766)
hysunflower Jul 27, 2020
eb7eb9c
remove unused code in ml (#4781)
Jul 30, 2020
64cde5d
Update run_ernie_classifier.py (#4790)
ChinaLiuHao Aug 6, 2020
f9f0d30
Enable CPU training for DyGraph MNIST Resnet (#4824)
arlesniak Sep 1, 2020
096fa39
Fix logging in transformer dygraph (#4827)
qingqing01 Sep 1, 2020
2c8b76b
add slowfast model to video classification (#4815)
huangjun12 Sep 1, 2020
e320130
support data_parallel training and ucf101 dataset (#4819)
chajchaj Sep 1, 2020
6726ad5
Update Pix2pix_network.py (#4829)
DrRyanHuang Sep 2, 2020
12080a0
fix dygraph reader (#4832)
Sep 3, 2020
bc07a01
Transfer the value of stop_gradient for feeding data. (#4831)
Xreki Sep 3, 2020
7a36ec5
Fix random seed for language model in static mode (#4836)
LiuChiachi Sep 7, 2020
4257b82
add tsn model based on paddle 2.0 platform (#4837)
LiuChaoXD Sep 7, 2020
a00c8af
fix resnet50 usetime statistics (#4838)
wanghuancoder Sep 8, 2020
a33f081
update np.float16 usage (#4851)
luotao1 Sep 12, 2020
08f3c0b
add M3D-RPN model (#4822)
shuluoshu Sep 14, 2020
22cf383
fix slowfast interface bug caused by the movement of hapi dir (#4834)
huangjun12 Sep 14, 2020
bde994e
Refine some configurations in TSN model (#4853)
LiuChaoXD Sep 15, 2020
4d1187d
update tsn Reader using dataloader and pipline (#4856)
huangjun12 Sep 16, 2020
295c16b
Update mpii_reader.py (#4862)
a2824256 Sep 18, 2020
db6ce5e
fix language model time print (#4865)
wanghuancoder Sep 22, 2020
cf186f3
fix ptb_dy time print for benchmark, test=develop (#4866)
wanghuancoder Sep 22, 2020
e07327e
fix mobilenet model time print (#4867)
luotao1 Sep 22, 2020
ba9a787
fix resnet usetime bug (#4869)
wanghuancoder Sep 23, 2020
38ada7f
fix resnet dygraph model time print (#4868)
luotao1 Sep 23, 2020
0739cc7
use pre-commit formate code (#4870)
wanghuancoder Sep 23, 2020
b9b8c88
use pre-commit formate code ptb_dy.py (#4871)
wanghuancoder Sep 23, 2020
93c4daa
Calculate the average time for gan models when benchmarking. (#4873)
Xreki Sep 23, 2020
fa73c7f
add enable_static() (#4879)
zhiqiu Sep 24, 2020
f09c442
add ips for dygraph mobilenet and resnet models (#4883)
luotao1 Sep 24, 2020
00b7796
add sequece/sec; test=develop (#4877)
phlrain Sep 25, 2020
fd2ff20
add words/sec; test=develop (#4878)
phlrain Sep 25, 2020
8a31b1c
add tokens per sec; test=develop (#4875)
phlrain Sep 25, 2020
69557e4
add tokens per sec in transformer (#4874)
phlrain Sep 25, 2020
c91cb2c
add ips print for ptb_lm (#4886)
wanghuancoder Sep 25, 2020
58fe1a3
add ips print for language_model (#4887)
wanghuancoder Sep 25, 2020
4000dfb
refine benchmark log (#4888)
luotao1 Sep 27, 2020
afaf06e
refine resnet benchmard print (#4893)
wanghuancoder Sep 29, 2020
c4ff279
Delete PaddleRec model (#4872)
frankwhzhang Oct 10, 2020
16c1da5
upgrade to API2.0 (#4880)
shippingwang Oct 12, 2020
3fad507
revert PR4893 and use Xreki‘s Code (#4902)
wanghuancoder Oct 13, 2020
5f18785
Update2.0 model (#4905)
frankwhzhang Oct 14, 2020
294ff30
add fuse_bn_add_act_ops args (#4864)
zhangting2020 Oct 15, 2020
a25c065
fix permute api to transpose (#4913)
Oct 21, 2020
2392894
pad input to use tensor core (#4911)
zhangting2020 Oct 22, 2020
60d045d
support enable_addto (#4909)
zhiqiu Oct 22, 2020
b480de5
Revert "add fuse_bn_add_act_ops args" (#4914)
zhangting2020 Oct 27, 2020
8b769e2
Add fp16 training for ResNeXt101
huangxu96 Nov 11, 2020
b3509b8
Added training script
huangxu96 Nov 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tokens per sec in transformer (#4874)
* add tokens/sec; test=develop

* change np.array to np.asarray to avoid data copy; test=develop
  • Loading branch information
phlrain authored Sep 25, 2020
commit 69557e42a7e30a0fa58161b9e61e23c86cbeec0a
23 changes: 14 additions & 9 deletions 23 PaddleNLP/machine_translation/transformer/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def do_train(args):

step_idx = 0
total_batch_num = 0 # this is for benchmark
total_batch_token_num = 0 # this is for benchmark word count
for pass_id in range(args.epoch):
pass_start_time = time.time()
input_field.loader.start()
Expand All @@ -185,12 +186,12 @@ def do_train(args):
return
try:
outs = exe.run(compiled_train_prog,
fetch_list=[sum_cost.name, token_num.name]
if step_idx % args.print_step == 0 else [])
fetch_list=[sum_cost.name, token_num.name])

total_batch_token_num += np.asarray(outs[1]).sum()
if step_idx % args.print_step == 0:
sum_cost_val, token_num_val = np.array(outs[0]), np.array(
outs[1])
sum_cost_val, token_num_val = np.asarray(outs[
0]), np.asarray(outs[1])
# sum the cost from multi-devices
total_sum_cost = sum_cost_val.sum()
total_token_num = token_num_val.sum()
Expand All @@ -207,13 +208,17 @@ def do_train(args):
else:
logging.info(
"step_idx: %d, epoch: %d, batch: %d, avg loss: %f, "
"normalized loss: %f, ppl: %f, speed: %.2f step/s" %
(step_idx, pass_id, batch_id, total_avg_cost,
total_avg_cost - loss_normalizer,
np.exp([min(total_avg_cost, 100)]),
args.print_step / (time.time() - avg_batch_time)))
"normalized loss: %f, ppl: %f, batch speed: %.2f steps/s, token speed: %.2f words/sec"
% (step_idx, pass_id, batch_id, total_avg_cost,
total_avg_cost - loss_normalizer,
np.exp([min(total_avg_cost, 100)]),
args.print_step / (time.time() - avg_batch_time),
total_batch_token_num /
(time.time() - avg_batch_time)))
avg_batch_time = time.time()

total_batch_token_num = 0

if step_idx % args.save_step == 0 and step_idx != 0:
if args.save_model_path:
model_path = os.path.join(args.save_model_path,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.