From 5e8ba7d7c043570e313eb02a37f0845f81d022b8 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 26 Aug 2017 00:42:13 +0000 Subject: [PATCH] Deploy to GitHub Pages: 111812fa3b41797a3940bbcd51e51ff21b799ffe --- .../doc/_sources/howto/dev/build_en.md.txt | 124 ++++++ develop/doc/_sources/howto/index_en.rst.txt | 1 + develop/doc/about/index_en.html | 1 + develop/doc/api/index_en.html | 1 + .../api/v1/data_provider/dataprovider_en.html | 1 + .../v1/data_provider/pydataprovider2_en.html | 1 + develop/doc/api/v1/index_en.html | 1 + .../doc/api/v1/predict/swig_py_paddle_en.html | 1 + develop/doc/api/v2/config/activation.html | 1 + develop/doc/api/v2/config/attr.html | 1 + develop/doc/api/v2/config/evaluators.html | 1 + develop/doc/api/v2/config/layer.html | 1 + develop/doc/api/v2/config/networks.html | 1 + develop/doc/api/v2/config/optimizer.html | 1 + develop/doc/api/v2/config/pooling.html | 1 + develop/doc/api/v2/data.html | 1 + develop/doc/api/v2/model_configs.html | 1 + develop/doc/api/v2/run_logic.html | 1 + develop/doc/design/api.html | 1 + develop/doc/design/auto_gradient_check.html | 1 + develop/doc/design/build_system/README.html | 1 + develop/doc/design/cluster_train/README.html | 1 + .../design/cluster_train/checkpointing.html | 1 + .../design/cluster_train/data_dispatch.html | 1 + .../cluster_train/large_model_dist_train.html | 1 + .../design/cluster_train/master_server.html | 1 + .../design/cluster_train/pserver_client.html | 1 + .../remote_parameter_updater.html | 1 + .../doc/design/cluster_train/save_model.html | 1 + .../doc/design/cluster_train/submit-job.html | 1 + develop/doc/design/file_manager/README.html | 1 + .../design/file_manager/pfs/pfsclient.html | 1 + .../00.why_plain_c.html | 1 + .../01.inference_implementation.html | 1 + develop/doc/design/parameters_in_cpp.html | 1 + develop/doc/design/reader/README.html | 1 + develop/doc/design/releasing_process.html | 1 + develop/doc/design/scope.html | 1 + develop/doc/design/simple_op_design.html | 1 + develop/doc/genindex.html | 1 + .../doc/getstarted/basic_usage/index_en.html | 1 + .../build_from_source_en.html | 1 + .../build_and_install/docker_install_en.html | 1 + .../build_and_install/index_en.html | 1 + .../build_and_install/ubuntu_install_en.html | 1 + develop/doc/getstarted/index_en.html | 1 + .../doc/howto/deep_model/rnn/index_en.html | 1 + .../howto/deep_model/rnn/rnn_config_en.html | 1 + develop/doc/howto/dev/build_en.html | 360 +++++++++++++++++ .../howto/dev/contribute_to_paddle_en.html | 1 + develop/doc/howto/dev/new_layer_en.html | 5 +- develop/doc/howto/index_en.html | 2 + .../howto/optimization/gpu_profiling_en.html | 1 + .../howto/usage/cluster/cluster_train_en.html | 1 + .../usage/cmd_parameter/arguments_en.html | 1 + .../cmd_parameter/detail_introduction_en.html | 1 + .../howto/usage/cmd_parameter/index_en.html | 1 + .../usage/cmd_parameter/use_case_en.html | 1 + develop/doc/howto/usage/k8s/k8s_aws_en.html | 5 +- develop/doc/howto/usage/k8s/k8s_en.html | 1 + .../howto/usage/k8s/src/k8s_data/README.html | 1 + .../howto/usage/k8s/src/k8s_train/README.html | 1 + develop/doc/index_en.html | 1 + develop/doc/objects.inv | Bin 2450 -> 2480 bytes develop/doc/search.html | 1 + develop/doc/searchindex.js | 2 +- .../tutorials/embedding_model/index_en.html | 1 + develop/doc/tutorials/gan/index_en.html | 1 + .../image_classification/index_en.html | 1 + .../imagenet_model/resnet_model_en.html | 1 + develop/doc/tutorials/index_en.html | 1 + .../doc/tutorials/quick_start/index_en.html | 1 + develop/doc/tutorials/rec/ml_dataset_en.html | 1 + .../doc/tutorials/rec/ml_regression_en.html | 1 + .../semantic_role_labeling/index_en.html | 1 + .../sentiment_analysis/index_en.html | 1 + .../tutorials/text_generation/index_en.html | 1 + .../doc_cn/_sources/howto/dev/build_cn.md.txt | 124 ++++++ .../doc_cn/_sources/howto/index_cn.rst.txt | 1 + develop/doc_cn/about/index_cn.html | 1 + develop/doc_cn/api/index_cn.html | 1 + .../api/v1/data_provider/dataprovider_cn.html | 1 + .../v1/data_provider/pydataprovider2_cn.html | 1 + develop/doc_cn/api/v1/index_cn.html | 1 + .../api/v1/predict/swig_py_paddle_cn.html | 1 + develop/doc_cn/api/v2/config/activation.html | 1 + develop/doc_cn/api/v2/config/attr.html | 1 + develop/doc_cn/api/v2/config/evaluators.html | 1 + develop/doc_cn/api/v2/config/layer.html | 1 + develop/doc_cn/api/v2/config/networks.html | 1 + develop/doc_cn/api/v2/config/optimizer.html | 1 + develop/doc_cn/api/v2/config/pooling.html | 1 + develop/doc_cn/api/v2/data.html | 1 + develop/doc_cn/api/v2/model_configs.html | 1 + develop/doc_cn/api/v2/run_logic.html | 1 + develop/doc_cn/design/api.html | 1 + .../doc_cn/design/auto_gradient_check.html | 1 + .../doc_cn/design/build_system/README.html | 1 + .../doc_cn/design/cluster_train/README.html | 1 + .../design/cluster_train/checkpointing.html | 1 + .../design/cluster_train/data_dispatch.html | 1 + .../cluster_train/large_model_dist_train.html | 1 + .../design/cluster_train/master_server.html | 1 + .../design/cluster_train/pserver_client.html | 1 + .../remote_parameter_updater.html | 1 + .../design/cluster_train/save_model.html | 1 + .../design/cluster_train/submit-job.html | 1 + .../doc_cn/design/file_manager/README.html | 1 + .../design/file_manager/pfs/pfsclient.html | 1 + .../00.why_plain_c.html | 1 + .../01.inference_implementation.html | 1 + develop/doc_cn/design/parameters_in_cpp.html | 1 + develop/doc_cn/design/reader/README.html | 1 + develop/doc_cn/design/releasing_process.html | 1 + develop/doc_cn/design/scope.html | 1 + develop/doc_cn/design/simple_op_design.html | 1 + develop/doc_cn/faq/index_cn.html | 1 + develop/doc_cn/genindex.html | 1 + .../getstarted/basic_usage/index_cn.html | 1 + .../cmake/build_from_source_cn.html | 1 + .../build_and_install/docker_install_cn.html | 1 + .../build_and_install/index_cn.html | 1 + .../build_and_install/ubuntu_install_cn.html | 1 + .../getstarted/concepts/use_concepts_cn.html | 1 + develop/doc_cn/getstarted/index_cn.html | 1 + .../cross_compiling_for_android_cn.html | 1 + .../cross_compiling_for_raspberry_cn.html | 1 + .../deep_model/rnn/hierarchical_layer_cn.html | 1 + .../rnn/hrnn_rnn_api_compare_cn.html | 1 + .../doc_cn/howto/deep_model/rnn/index_cn.html | 1 + .../deep_model/rnn/recurrent_group_cn.html | 1 + .../howto/deep_model/rnn/rnn_config_cn.html | 1 + develop/doc_cn/howto/dev/build_cn.html | 366 ++++++++++++++++++ .../howto/dev/contribute_to_paddle_cn.html | 1 + develop/doc_cn/howto/dev/new_layer_cn.html | 1 + develop/doc_cn/howto/dev/write_docs_cn.html | 5 +- develop/doc_cn/howto/index_cn.html | 2 + .../howto/optimization/gpu_profiling_cn.html | 1 + .../howto/usage/cluster/cluster_train_cn.html | 1 + .../usage/cmd_parameter/arguments_cn.html | 1 + .../cmd_parameter/detail_introduction_cn.html | 1 + .../howto/usage/cmd_parameter/index_cn.html | 1 + .../usage/cmd_parameter/use_case_cn.html | 1 + .../doc_cn/howto/usage/k8s/k8s_basis_cn.html | 1 + develop/doc_cn/howto/usage/k8s/k8s_cn.html | 1 + .../howto/usage/k8s/k8s_distributed_cn.html | 5 +- .../howto/usage/k8s/src/k8s_data/README.html | 1 + .../howto/usage/k8s/src/k8s_train/README.html | 1 + develop/doc_cn/index_cn.html | 1 + develop/doc_cn/objects.inv | Bin 2937 -> 2967 bytes develop/doc_cn/search.html | 1 + develop/doc_cn/searchindex.js | 2 +- .../tutorials/embedding_model/index_cn.html | 1 + .../image_classification/index_cn.html | 1 + .../imagenet_model/resnet_model_cn.html | 1 + develop/doc_cn/tutorials/index_cn.html | 1 + .../tutorials/quick_start/index_cn.html | 1 + .../doc_cn/tutorials/rec/ml_dataset_cn.html | 1 + .../tutorials/rec/ml_regression_cn.html | 1 + .../semantic_role_labeling/index_cn.html | 1 + .../sentiment_analysis/index_cn.html | 1 + .../tutorials/text_generation/index_cn.html | 1 + 162 files changed, 1140 insertions(+), 10 deletions(-) create mode 100644 develop/doc/_sources/howto/dev/build_en.md.txt create mode 100644 develop/doc/howto/dev/build_en.html create mode 100644 develop/doc_cn/_sources/howto/dev/build_cn.md.txt create mode 100644 develop/doc_cn/howto/dev/build_cn.html diff --git a/develop/doc/_sources/howto/dev/build_en.md.txt b/develop/doc/_sources/howto/dev/build_en.md.txt new file mode 100644 index 00000000000..d0048e3714a --- /dev/null +++ b/develop/doc/_sources/howto/dev/build_en.md.txt @@ -0,0 +1,124 @@ +# Build PaddlePaddle from Source Code and Run Unit Test + +## What Developers Need + +To contribute to PaddlePaddle, you need + +1. A computer -- Linux, BSD, Windows, MacOS, and +1. Docker. + +Nothing else. Not even Python and GCC, because you can install all build tools into a Docker image. We run all the tools by running this image. + +## General Process + +1. Retrieve source code. + + ```bash + git clone https://github.com/paddlepaddle/paddle + ``` + +2. Install build tools into a Docker image. + + ```bash + cd paddle; docker build -t paddle:dev . + ``` + + Please be aware of the `.` at the end of the command, which refers to the [`./Dockerfile` file](https://github.com/PaddlePaddle/Paddle/blob/develop/Dockerfile). `docker build` follows instructions in this file to create a Docker image named `paddle:dev`, and installs building tools into it. + +3. Build from source. + + This following command starts a Docker container that executes the Docker image `paddle:dev`, mapping the current directory to `/paddle/` in the container, and runs the default entry-point [`build.sh`](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/scripts/docker/build.sh) as specified in the Dockefile. `build.sh` invokes `cmake` and `make` to build PaddlePaddle source code, which had been mapped to `/paddle`, and writes outputs to `/paddle/build`, which maps to `build` in the current source directory on the computer. + + ```bash + docker run -v $PWD:/paddle paddle:dev + ``` + + Above command builds a CUDA-enabled version. If we want to build a CPU-only version, we can type + + ```bash + docker run -e WITH_GPU=OFF -v $PWD:/paddle paddle:dev + ``` + +4. Run unit tests. + + To run all unit tests using the first GPU of a node: + + ```bash + NV_GPU=0 nvidia-docker run -v $PWD:/paddle paddle:dev bash -c "cd /paddle/build; ctest" + ``` + + If we used `WITH_GPU=OFF` at build time, it generates only CPU-based unit tests, and we don't need nvidia-docker to run them. We can just run + + ```bash + docker run -v $PWD:/paddle paddle:dev bash -c "cd /paddle/build; ctest" + ``` + + Sometimes we want to run a specific unit test, say `memory_test`, we can run + + ```bash + nvidia-docker run -v $PWD:/paddle paddle:dev bash -c "cd /paddle/build; ctest -V -R memory_test" + ``` + +5. Clean Build. + + Sometimes, we might want to clean all thirt-party dependents and built binaries. To do so, just + + ```bash + rm -rf build + ``` + +## Docker, Or Not? + +- What is Docker? + + If you haven't heard of it, consider it something like Python's virtualenv. + +- Docker or virtual machine? + + Some people compare Docker with VMs, but Docker doesn't virtualize any hardware nor running a guest OS, which means there is no compromise on the performance. + +- Why Docker? + + Using a Docker image of build tools standardizes the building environment, which makes it easier for others to reproduce your problems and to help. + + Also, some build tools don't run on Windows or Mac or BSD, but Docker runs almost everywhere, so developers can use whatever computer they want. + +- Can I choose not to use Docker? + + Sure, you don't have to install build tools into a Docker image; instead, you can install them in your local computer. This document exists because Docker would make the development way easier. + +- How difficult is it to learn Docker? + + It takes you ten minutes to read [an introductory article](https://docs.docker.com/get-started) and saves you more than one hour to install all required build tools, configure them, especially when new versions of PaddlePaddle require some new tools. Not even to mention the time saved when other people trying to reproduce the issue you have. + +- Can I use my favorite IDE? + + Yes, of course. The source code resides on your local computer, and you can edit it using whatever editor you like. + + Many PaddlePaddle developers are using Emacs. They add the following few lines into their `~/.emacs` configure file: + + ```emacs + (global-set-key "\C-cc" 'compile) + (setq compile-command + "docker run --rm -it -v $(git rev-parse --show-toplevel):/paddle paddle:dev") + ``` + + so they could type `Ctrl-C` and `c` to build PaddlePaddle from source. + +- Does Docker do parallel building? + + Our building Docker image runs a [Bash script](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/scripts/docker/build.sh), which calls `make -j$(nproc)` to starts as many processes as the number of your CPU cores. + +## Some Gotchas + +- Docker requires sudo + + An owner of a computer has the administrative privilege, a.k.a., sudo, and Docker requires this privilege to work properly. If you use a shared computer for development, please ask the administrator to install and configure Docker. We will do our best to support rkt, another container technology that doesn't require sudo. + +- Docker on Windows/MacOS builds slowly + + On Windows and MacOS, Docker containers run in a Linux VM. You might want to give this VM some more memory and CPUs so to make the building efficient. Please refer to [this issue](https://github.com/PaddlePaddle/Paddle/issues/627) for details. + +- Not enough disk space + + Examples in this article uses option `--rm` with the `docker run` command. This option ensures that stopped containers do not exist on hard disks. We can use `docker ps -a` to list all containers, including stopped. Sometimes `docker build` generates some intermediate dangling images, which also take disk space. To clean them, please refer to [this article](https://zaiste.net/posts/removing_docker_containers/). diff --git a/develop/doc/_sources/howto/index_en.rst.txt b/develop/doc/_sources/howto/index_en.rst.txt index 1fbfcd260b9..1b6034be4ed 100644 --- a/develop/doc/_sources/howto/index_en.rst.txt +++ b/develop/doc/_sources/howto/index_en.rst.txt @@ -18,6 +18,7 @@ Development .. toctree:: :maxdepth: 1 + dev/build_en.rst dev/new_layer_en.rst dev/contribute_to_paddle_en.md diff --git a/develop/doc/about/index_en.html b/develop/doc/about/index_en.html index 2282cb48733..387661fe3ce 100644 --- a/develop/doc/about/index_en.html +++ b/develop/doc/about/index_en.html @@ -126,6 +126,7 @@
  • Run Distributed Training
  • Paddle On Kubernetes
  • Distributed PaddlePaddle Training on AWS with Kubernetes
  • +
  • Build PaddlePaddle from Source Code and Run Unit Test
  • Write New Layers
  • Contribute Code
  • RNN Models