Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark including PaddlePaddle, TensorFlow and Caffe. #219

Merged
merged 6 commits into from
Dec 5, 2016

Conversation

qingqing01
Copy link
Contributor

  1. All the configs are in benchmark/ file.
  2. use run.sh or run_multi.sh to execute.

@qingqing01 qingqing01 changed the title benchmark including PaddlePaddle, TensorFlow and Caffe. Benchmark including PaddlePaddle, TensorFlow and Caffe. Oct 18, 2016
@reyoung reyoung changed the base branch from master to develop October 26, 2016 08:13

```bash
pip install tflearn
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. run.sh和run_multi.sh里面除了个数不一样,很多地方都一样,能不能写成一个.sh文件呢,或者共用下命令行函数。
  2. tensorflow里面单节点的py和多节点的py,看着也非常像,是不是也就只有节点数不一样,其他都一样呢。那写成一个py就够了。


Platform:

- PaddlePaddle:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是要加一下是Paddle的哪个版本,比如就这次release版本

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, 增加的是这次release版本对应的Docker Image

- Tensorflow: gcr.io/tensorflow/tensorflow:0.11.0rc0-gpu
- Caffe:

Several convolutional neural networks and recurrent neural network are used to test.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recurrent neural network后面加s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- CPU: 12-core Intel(R) Xeon(R) CPU E5-2620 v2 @2.10GHz
- GPU: Tesla K40m
- cuDNN: v5.1
- system: Docker 1.12.1, all platform are tested in docker environment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all platforms

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


### Benchmark Model

AlexNet, GooleNet and a small network which refer the config of cifar10 in Caffe are used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a small network which refer the config of cifar10 in Caffe 不是很通。是说用了caffe中那个cifar10的网络么?a small network use cifar10 in Caffe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- [SmallNet](https://github.com/BVLC/caffe/blob/master/examples/cifar10/cifar10\_quick\_train\_test.prototxt)


### Singe-GPU
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single-GPU

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


#### LSTM in Text Classification

Testing network for different hidden size, batch size with `2 lstm layer + fc` network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing 2 lstm layer + fc network with differnt hidden size and batch size

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


#### Seq2Seq

The benchmark of sequence-to-sequence network will be add later.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will be added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


#### Seq2Seq

The benchmark of sequence-to-sequence network will be add later.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

--log_period=10 \
--test_period=100 \
--config_args=$args \
--cudnn_dir=/home/dangqingqing/tools/cudnn-5.1/lib64 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cudnn_dir路径写死了,下同

if [ ! -d "train.txt" ]; then
for ((i=1;i<=1024;i++))
do
echo "train/n09246464/n09246464_38735.jpeg 972" >> train.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这行是用来做什么呢,写1024个一样的jpeg?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是因为:

  1. 使用 paddle train命令发起程序,PaddlePaddle必须依赖DataProvider才能知道数据类型和大小(dense_vector, integer_value等)。
  2. 配置文件中define_py_data_sources2指定DataProvider的同时,必须有train_list,而且如果文件为空的话,Init parameters done之后就结束了。

所以这里生成伪数据列表,实际在DataProvider里产生的是随机数据。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改了DataProvider, 可以使用空的文件列表,已更新。

@qingqing01 qingqing01 force-pushed the benchmark_cfg_doc branch 4 times, most recently from 0447e63 to 3046e2d Compare November 23, 2016 11:44
@qingqing01
Copy link
Contributor Author

qingqing01 commented Nov 23, 2016

run.sh和run_multi.sh里面除了个数不一样,很多地方都一样,能不能写成一个.sh文件呢,或者共用下命令行函数。

这个只合并了PaddlePaddle的命令。 Caffe和Tensorflow没有合并,是因为这两个单机和多机发起程序的命令本身就不一样。

tensorflow里面单节点的py和多节点的py,看着也非常像,是不是也就只有节点数不一样,其他都一样呢。那写成一个py就够了。

TensorFlow多卡的配置本身可以跑单卡, 但是单卡配置可以写的更简单、少一些逻辑。在看Tensorflow的一些教程( https://github.com/tensorflow/tensorflow/tree/master/tensorflow/models/image/cifar10 )、包括这里的配置 https://github.com/soumith/convnet-benchmarks/tree/master/tensorflow (当然这个没有多卡配置)时, 单卡配置和多卡也是分开的,单卡并没有公用多卡配置来跑单卡。

所以TensorFlow这里单卡和多卡是分开的,如果大家觉得有必要合并的,合并一下也可以。


All the tests in caffe use `caffe time` to execute, which is not including the parameter updating process. But the time in PaddlePaddle and TensorFlow contains it.
All the experiments in caffe use `caffe time` to execute, which does not include the time of parameter updating. The time in PaddlePaddle and TensorFlow contains it. But, compared with the total time, the time of parameter updating is relatively little.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the single-GPU experiments in caffe use caffe time to calculate the elapsed time, which does not include the parameter updating time. However, both PaddlePaddle and TensorFlow benchmark contain this parameter updating time. As compared with the total time, this part is relatively little, we can ignore it.

@@ -102,15 +102,15 @@ We use lstm network for text classfication to test benchmark.

### Dataset
- [IMDB](http://www.iro.umontreal.ca/~lisa/deep/data/imdb.pkl)
- Sequence legth=100, in fact, PaddlePaddle support training with variable-length sequence. But TensorFlow need to pad, in order to compare, we also pad sequence length to 100 in PaddlePaddle.
- Sequence legth is 100. In fact, PaddlePaddle supports training with variable-length sequence, but TensorFlow needs to pad, we also pad sequence length to 100 in PaddlePaddle in order to compare.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sequence length.

In fact, PaddlePaddle supports training with variable-length sequence, but TensorFlow needs to pad. Thus, we also pad sequence length to 100 in PaddlePaddle in order to compare.

@luotao1
Copy link
Contributor

luotao1 commented Nov 23, 2016

所以TensorFlow这里单卡和多卡是分开的,如果大家觉得有必要合并的,合并一下也可以。

@wangkuiyi @reyoung @gangliao @hedaoyuan @backyes 的意见

@reyoung
Copy link
Collaborator

reyoung commented Nov 28, 2016

如果Paddle不是核心的code,那么咱也没必要非要 DIY(Don't Repeat Yourself) 吧。况且,@qingqing01 说这个tensorflow的官方也没有合并这些。

@luotao1 luotao1 merged commit a0a87ac into PaddlePaddle:develop Dec 5, 2016
@qingqing01 qingqing01 deleted the benchmark_cfg_doc branch July 7, 2017 13:35
thisjiang pushed a commit to thisjiang/Paddle that referenced this pull request Oct 28, 2021
zhoutianzi666 pushed a commit to zhoutianzi666/Paddle that referenced this pull request May 23, 2022
lizexu123 pushed a commit to lizexu123/Paddle that referenced this pull request Feb 23, 2024
* Stand out toy example & fix bugs in child threads

* Refine comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants