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

Update installation docs #5818

Merged
merged 7 commits into from
Nov 27, 2017
Merged

Conversation

typhoonzero
Copy link
Contributor

@typhoonzero typhoonzero commented Nov 22, 2017

Fix #4382

For convenient review, please look here

Copy link
Collaborator

@wangkuiyi wangkuiyi left a comment

Choose a reason for hiding this comment

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

Why would we need to convert markdown files into RST?

@typhoonzero
Copy link
Contributor Author

@wangkuiyi convert markdown files into RST so that these docs can be deployed to http://www.paddlepaddle.org/docs/develop/documentation/zh/getstarted/index_cn.html

@luotao1
Copy link
Contributor

luotao1 commented Nov 22, 2017

@wangkuiyi RST is much convenient and strong for displaying table, code, index tree, etc than Markdown.

Though I was not familiar with each function of RST , there is an example when we want to display table beautifully on both website and github.

@luotao1
Copy link
Contributor

luotao1 commented Nov 22, 2017

git clone https://github.com/PaddlePaddle/Paddle.git
cd Paddle
# 如果使用Docker编译环境,执行下面的命令
docker run -it -v $PWD:/paddle -e "WITH_GPU=ON" -e "WITH_TESTING=OFF" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 bash -x paddle/scripts/docker/build.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

示例中WITH_GPU=OFF会不会好一点, 23行也是。或者说明一下?

"MKL_ROOT", "${MKL_ROOT}/include下需要包含mkl.h,${MKL_ROOT}/lib目录下需要包含mkl_core,mkl_sequential和mkl_intel_lp64三个库。"
"ATLAS_ROOT", "${ATLAS_ROOT}/include下需要包含cblas.h,${ATLAS_ROOT}/lib下需要包含cblas和atlas两个库。"
"OPENBLAS_ROOT", "${OPENBLAS_ROOT}/include下需要包含cblas.h,${OPENBLAS_ROOT}/lib下需要包含openblas库。"
"REFERENCE_CBLAS_ROOT", "${REFERENCE_CBLAS_ROOT}/include下需要包含cblas.h,${REFERENCE_CBLAS_ROOT}/lib下需要包含cblas库。"
Copy link
Contributor

Choose a reason for hiding this comment

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

现在这些ROOT都不用用户自己指定了,OpenBlas和MKL都是自动下载第三方库。

编译选项:"WITH_MKL", "是否使用MKL数学库", "是"
否的时候:使用OpenBlas数学库。

如果机器含有AVX2指令集,还会下载MKL-DNN数学库,文档:https://github.com/PaddlePaddle/Paddle/tree/develop/doc/design/mkldnn#cmake

可以再组织一下。

@Xreki @hedaoyuan ATLAS是不是可以删了?

CUDA/Cudnn
+++++++++++

PaddlePaddle可以使用cudnn v2之后的任何一个版本来编译运行,但尽量请保持编译和运行使用的cudnn是同一个版本。 我们推荐使用最新版本的cudnn v5.1。
Copy link
Contributor

Choose a reason for hiding this comment

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

PaddlePaddle可以使用cudnn v2之后的任何一个版本来编译运行

现在必须使用V5.1 @qingqing01 这块还有什么其他需要注意的地方么

Copy link
Contributor

Choose a reason for hiding this comment

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

cudnn -> cuDNN, 要求最低v5.1吧,其他应该没了。

Copy link
Contributor

Choose a reason for hiding this comment

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

CUDA加下 CUDA_ARCH_NAME参数,提醒开发者-DCUDA_ARCH_NAME=Auto可以加速编译吧。


.. code-block:: bash

cmake .. -DMKL_ROOT=/opt/mkl/ -DCUDNN_ROOT=/opt/cudnnv5
Copy link
Contributor

Choose a reason for hiding this comment

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

-DMKL_ROOT=/opt/mkl/ 这个可以去掉,用户不用设置了。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

只保留了MKL和OpenBLAS,我看cmake中其他的已经没在使用了。

访问到主机上的文件。可以通过*挂载Volume*的方式,将主机上的文件或目录挂载到
Docker容器中。下面的命令把当前目录挂载到了容器中的 /data 目录下,容器使用
debian镜像,并且启动后执行 :code:`ls /data`。
下载GPU版本的Docker镜像:
Copy link
Contributor

Choose a reason for hiding this comment

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

这里只说明了GPU版本的镜像,是不是也要说明一下CPU版本的Docker镜像(使用MKL数学库)和CPU版本的Docker镜像(使用OpenBlas数学库)呢?


.. code-block:: bash
docker pull paddlepaddle/paddle:latest-gpu
Copy link
Contributor

@luotao1 luotao1 Nov 22, 2017

Choose a reason for hiding this comment

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

这里没有显示33行的内容。
image


如果要使用GPU,请运行:
假设您已经在当前目录编写了一个PaddlePaddle的程序 :code:`train.py`(可以参考
Copy link
Contributor

Choose a reason for hiding this comment

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

这里能加一下当前目录是什么吗,因为很多用户不知道56行那个命令去哪儿打:

cd your_dir;
docker run -it -v $PWD:/work paddlepaddle/paddle /work/train.py


使用Docker可以快速在本地启动一个包含了PaddlePaddle官方Book教程的Jupiter Notebook,可以通过网页浏览。
Copy link
Contributor

Choose a reason for hiding this comment

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

Jupiter笔误


.. toctree::
:maxdepth: 1

cmake/build_from_source_cn.rst
build_from_source_cn.rst
Copy link
Contributor

Choose a reason for hiding this comment

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


如果需要获取并安装最新的(开发分支)PaddlePaddle,可以从我们的CI系统中下载最新的whl安装包并安装,在下面的链接中,使用guest登陆,然后点击Artifact标签,可以找到最新的whl安装包:

- `CPU版本 <https://paddleci.ngrok.io/viewLog.html?buildTypeId=Manylinux1_CpuAvxCp27cp27mu&buildId=lastSuccessful>`_
Copy link
Contributor

Choose a reason for hiding this comment

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

29行的CPU版本是使用MKL数学库,https://paddleci.ngrok.io/viewType.html?buildTypeId=Manylinux1_CpuAvxOpenblas 这个是使用OpenBlas数学库

@typhoonzero
Copy link
Contributor Author

Markdown docs can also be deployed to http://www.paddlepaddle.org/docs/develop/documentation/zh/getstarted/index_cn.html

@luotao1 Thanks, I see.

然后用密码 :code:`root` SSH进入容器:
下载指定版本的Docker镜像,可以从
`DockerHub网站 <https://hub.docker.com/r/paddlepaddle/paddle/tags/>`_
获取可选的tag,并执行下面的命令:
Copy link
Contributor

Choose a reason for hiding this comment

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

image
这段上下文这儿格式不对,请调整。


.. code-block:: bash

docker run paddlepaddle/paddle:0.10.0
docker pull docker.paddlepaddle.org/paddle
Copy link
Contributor

Choose a reason for hiding this comment

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

这儿的命令都缩进了
image

底下book那里没有缩进了两格
image

请调整全文相似缩进的地方。

.. code-block:: bash

docker build -t paddle:prod -f build/Dockerfile ./build
关于AVX:
Copy link
Contributor

Choose a reason for hiding this comment

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

117行要加粗么

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comments all done, also updated docs under doc/getstarted


PaddlePaddle编译需要使用到下面的依赖(包含但不限于),其他的依赖软件,会自动在编译时下载。

.. csv-table:: PaddlePaddle编译依赖
Copy link
Contributor

Choose a reason for hiding this comment

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

image
表格的标题是斜体?不过可以等merge进整体网站的时候看看标题是否还是斜体。

CUDA/Cudnn
+++++++++++

PaddlePaddle可以使用cudnn v2之后的任何一个版本来编译运行,但尽量请保持编译和运行使用的cudnn是同一个版本。 我们推荐使用最新版本的cudnn v5.1。
Copy link
Contributor

Choose a reason for hiding this comment

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

CUDA加下 CUDA_ARCH_NAME参数,提醒开发者-DCUDA_ARCH_NAME=Auto可以加速编译吧。

"WITH_TESTING", "是否开启单元测试", "是"
"WITH_DOC", "是否编译中英文文档", "否"
"WITH_SWIG_PY", "是否编译PYTHON的SWIG接口,该接口可用于预测和定制化训练", "自动"
"WITH_GOLANG", "是否编译go语言的可容错parameter server", "是"
Copy link
Contributor

Choose a reason for hiding this comment

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

“是“ -> ON, “否”-> OFF?

@wangkuiyi
Copy link
Collaborator

wangkuiyi commented Nov 22, 2017

@luotao1 I looked into https://github.com/PaddlePaddle/Paddle/pull/5399/files#diff-dfd1b6519ee0558a1c7b124efa2ea816, but I don't understand why would we need to change Markdown table format in that diff into HTML format? What was the reason that prevented out documentation system from displaying Markdown table format?

In general, it's much more difficult to write RST than Markdown. Also, to ease the documentation work, we'd prefer one format instead of two.

@luotao1
Copy link
Contributor

luotao1 commented Nov 23, 2017

@wangkuiyi The reason is that Sphinx doesn't support markdown table: https://stackoverflow.com/questions/44461762/sphinx-is-not-recognising-my-markdown-tables

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.

#5818 (review) CUDA加下 CUDA_ARCH_NAME参数,提醒开发者-DCUDA_ARCH_NAME=Auto可以加速编译吧。


docker run -it -v $PWD:/work paddle /work/a.py
假设您已经在当前目录(比如在/home/work)编写了一个PaddlePaddle的程序 :code:`train.py` (可以参考
`PaddlePaddleBook <http://www.paddlepaddle.org/docs/develop/book/01.fit_a_line/index.cn.html>`_
Copy link
Contributor

Choose a reason for hiding this comment

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

image
格式请调整


这里`a.py`包含的所有依赖假设都可以在Paddle的运行容器中。如果需要包含更多的依赖、或者需要发布您的应用的镜像,可以编写`Dockerfile`使用`FROM paddledev/paddle:0.10.0`
创建和发布自己的AI程序镜像。
**注:PaddlePaddle Docker镜像为了减小体积,默认没有安装vim,您可以在容器中执行 :code:`apt-get install -y vim` 安装后,在容器中编辑代码。**
Copy link
Contributor

Choose a reason for hiding this comment

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

image
格式请调整。


.. csv-table:: 各个版本最新的whl包
:header: "版本说明", "cp27-cp27mu", "cp27-cp27mu", "C-API"
:widths: 1, 3, 3, 3
Copy link
Contributor

Choose a reason for hiding this comment

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

image
openblas版本的没有c-api?

Quick Install
----------------------

You can use pip to install PaddlePaddle using a single command, supports
Copy link
Contributor

Choose a reason for hiding this comment

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

using->with

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing, comments all done.


下载 `房价模型文件 <https://raw.githubusercontent.com/PaddlePaddle/book/develop/01.fit_a_line/fit_a_line.tar>`_

创建一个 housing.py 并粘贴此Python代码 (请确保fit_a_line.tar 是在正确的路径上)
Copy link
Contributor

Choose a reason for hiding this comment

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

这里不需要fit_a_line.tar的路径了。https://github.com/PaddlePaddle/book/blob/develop/01.fit_a_line/infer.py
最新的代码里面已经将路径封装了paddle.dataset.uci_housing.model()
英文的请做同样的修改。


You can pass compile options to use intended BLAS/CUDA/Cudnn libraries.
When running cmake command, it will search system paths like
:code:`/usr/lib\:/usr/local/lib` and then search paths that you
Copy link
Contributor

Choose a reason for hiding this comment

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

image
多了一个\

If you wish to install the latest develop branch PaddlePaddle,
you can download the latest whl package from our CI system. Access
the below links, log in as guest, then click at the "Artifact"
tab, you'll find the download link of whl packages.
Copy link
Contributor

Choose a reason for hiding this comment

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

这里需要配图说明一下怎么登录我们的ci系统么?
另外,我看中文文档中没有如何登陆ci系统的介绍,求加上。

PaddlePaddle installation packages (whl) does not only contain .py files,
but also binaries built from C++ code, we ensure that PaddlePaddle can
run on current mainline Linux distributions, like CentOS 6, Ubuntu 14.04
and MacOS 10.12.
Copy link
Contributor

Choose a reason for hiding this comment

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

we前面的逗号改成句号。


Following command will run unit test:
**NOTE: We did not install vim in the default docker image to reduce the image size, you can run :code:`apt-get install -y vim` to install it if you need to edit python files.**
Copy link
Contributor

Choose a reason for hiding this comment

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

image
格式请调整。

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.

ci的图过高,是不是裁剪成
image
就行了呢?

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.

LGTM! Excellent Job!!

@luotao1 luotao1 merged commit 9de8ce1 into PaddlePaddle:develop Nov 27, 2017
@typhoonzero typhoonzero deleted the polish_install_docs branch December 22, 2017 05:45
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.

4 participants