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 the Build PaddlePaddle for Raspberry Pi document #5177

Merged
merged 5 commits into from
Oct 31, 2017

Conversation

wangkuiyi
Copy link
Collaborator

@wangkuiyi wangkuiyi commented Oct 27, 2017

Fixes #5176

@bijit-baidu
Copy link

Made some minor edits. Otherwise, LGTM.

@wangkuiyi wangkuiyi mentioned this pull request Oct 27, 2017
bijit-baidu
bijit-baidu previously approved these changes Oct 27, 2017
Copy link

@bijit-baidu bijit-baidu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@kavyasrinet kavyasrinet left a comment

Choose a reason for hiding this comment

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

LGTM. Just a few nits :)


1. Build it: Log in to a Raspberry Pi via SSH and build the library. The required development tools and third-party dependencies are listed in [`/Dockerfile`](https://github.com/PaddlePaddle/Paddle/blob/develop/Dockerfile).

1. Cross-compile: This article explains how to cross-compile PaddlePaddle for Raspberry Pi on a Linux/x64 computer.

Choose a reason for hiding this comment

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

  1. -> 2. Cross-compile: We talk about how to cross-compile PaddlePaddle for Raspberry Pi on a Linux/x64 machine, in more detail in this article.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

I didn't change 1 to 2, because Github can automatically generate the enumeration.

# Build PaddlePaddle for Raspberry Pi
You may use any of the following two approaches to build the inference library of PaddlePaddle for Raspberry Pi:

1. Build it: Log in to a Raspberry Pi via SSH and build the library. The required development tools and third-party dependencies are listed in [`/Dockerfile`](https://github.com/PaddlePaddle/Paddle/blob/develop/Dockerfile).

Choose a reason for hiding this comment

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

Rephrase: Build using SSH: Log in to a Raspberry Pi using SSH and build the library. The required development tools and third-party dependencies are listed here: /Dockerfile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


## The Cross-Compiling Toolchain

Step 1. Clone the following Github repo

Choose a reason for hiding this comment

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

Rephrase: Step 1. Clone the Github repo by running the following command.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


## CMake Arguments

CMake supports [cross-compiling](https://cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html#cross-compiling). All CMake configuraition arguments required for the cross-compilation for Raspberry Pi can be found in [`cmake/cross_compiling/raspberry_pi.cmake`](https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/cross_compiling/raspberry_pi.cmake).

Choose a reason for hiding this comment

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

configuraition => configuration

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


- `RPI_TOOLCHAIN`: The absolute path of the cross-compiling toolchain.

- `RPI_ARM_NEON`: Use ARM NEON Intrinsics. Must be and default to `ON`.

Choose a reason for hiding this comment

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

Rephrase: RPI_ARM_NEON: Use ARM NEON Intrinsics. This is a required argument and set default to ON.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

make install
```

The intermediate files will be in `build`. Third-party libraries will be in `build/third_party`. If you have built for other platforms, e.g., Android or iOS, you may want to clear these directories by running `rm -rf build`.

Choose a reason for hiding this comment

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

Rephrase: The intermediate files will be stored in build. Third-party libraries will be located in build/third_party. If you have already built it for other platforms like Android or iOS, you may want to clear these directories by running the command: rm -rf build.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator Author

@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.

Thank you for the very detailed review!

# Build PaddlePaddle for Raspberry Pi
You may use any of the following two approaches to build the inference library of PaddlePaddle for Raspberry Pi:

1. Build it: Log in to a Raspberry Pi via SSH and build the library. The required development tools and third-party dependencies are listed in [`/Dockerfile`](https://github.com/PaddlePaddle/Paddle/blob/develop/Dockerfile).
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


1. Build it: Log in to a Raspberry Pi via SSH and build the library. The required development tools and third-party dependencies are listed in [`/Dockerfile`](https://github.com/PaddlePaddle/Paddle/blob/develop/Dockerfile).

1. Cross-compile: This article explains how to cross-compile PaddlePaddle for Raspberry Pi on a Linux/x64 computer.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

I didn't change 1 to 2, because Github can automatically generate the enumeration.


## The Cross-Compiling Toolchain

Step 1. Clone the following Github repo
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


## CMake Arguments

CMake supports [cross-compiling](https://cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html#cross-compiling). All CMake configuraition arguments required for the cross-compilation for Raspberry Pi can be found in [`cmake/cross_compiling/raspberry_pi.cmake`](https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/cross_compiling/raspberry_pi.cmake).
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


- `RPI_TOOLCHAIN`: The absolute path of the cross-compiling toolchain.

- `RPI_ARM_NEON`: Use ARM NEON Intrinsics. Must be and default to `ON`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

make install
```

The intermediate files will be in `build`. Third-party libraries will be in `build/third_party`. If you have built for other platforms, e.g., Android or iOS, you may want to clear these directories by running `rm -rf build`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


## CMake Arguments

CMake supports [cross-compiling](https://cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html#cross-compiling). All CMake configuration arguments required for the cross-compilation for Raspberry Pi can be found in [`cmake/cross_compiling/raspberry_pi.cmake`](https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/cross_compiling/raspberry_pi.cmake).
Copy link
Contributor

Choose a reason for hiding this comment

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

In fact, we have little experiment on RPi, so I am not sure whether the raspberry_pi.cmake is detailed enough for RPi. Maybe we need to complete it in the future.

..
```

To build the inference library, please set the argument WITH_API to ON: `WITH_C_API=ON`.
Copy link
Contributor

Choose a reason for hiding this comment

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

please set the argument WITH_API to ON -> please set the argument WITH_C_API to ON

@Xreki
Copy link
Contributor

Xreki commented Oct 30, 2017

We also need to name the English documentation file to cross_compiling_for_raspberry_en.md. We will add the documentation to index.rst, and it cannot be correctly generated by sphinx if not with _cn or _en suffix.

@Xreki Xreki added the mobile label Oct 30, 2017
@Xreki Xreki added this to Design & Doc in Embedded and Mobile Deployment Oct 30, 2017
@wangkuiyi
Copy link
Collaborator Author

We also need to name the English documentation file to cross_compiling_for_raspberry_en.md. We will add the documentation to index.rst, and it cannot be correctly generated by sphinx if not with _cn or _en suffix.

Got it. I added the suffix. @Xreki

Copy link
Contributor

@Xreki Xreki left a comment

Choose a reason for hiding this comment

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

LGTM

@wangkuiyi wangkuiyi merged commit 8b1c50c into PaddlePaddle:develop Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants