Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Installation instructions consolidation #12388

Merged
merged 26 commits into from
Sep 5, 2018

Conversation

aaronmarkham
Copy link
Contributor

Description

Different installation pages were out of date or out of sync. The install page was over-complicated. The build from source instructions weren't really working.

This PR consolidates install info, directs users to where the more recent updates happen to be, and simplifies the basic user install. I started off just trying to fix the C++ setup info, but found so many other issues, I worked on those too.

Features

  • Fixes a bug that made it so you couldn't preview the dev version's install page without it redirecting you. (options.js)
  • Updates the build_from_source page
    • Point to the OS-focused pages where this information is most up-to-date.
    • Added a table that maps links to each binding.
    • Leaves the centos/other linux sections there since this info isn't covered elsewhere
    • Leaves the NCCL section alone (is this even current info?)
    • Links this page in the Download Source section found at the bottom of install
  • Creates a new C++ setup page that brings together C++ info found around the project.
  • Refactors the install page.
    • Moves the validation section to a new page
    • Removes virtualenv (this was repeated multiple times in the file w/o much real value
    • Super simplifies the pip install sections
    • Links back to each OS's detailed setup guides
    • Links to specific install guide sections for Perl and Julia
    • and more... the file went from 2531 lines to 1062. So much easier to deal with... probably could take more pruning...
  • Fixes some issues on the OS guide pages - the Python binding steps were missing

Preview

http://34.201.8.176/versions/cplusplus_install/install/index.html

@@ -28,184 +32,102 @@ You need C++ build tools and BLAS library to build MXNet shared library. If you
for Windows) to build the library.
Copy link
Contributor

Choose a reason for hiding this comment

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

A C++ compiler that supports C++ 11.
G++ (4.8 or later), Clang or Visual Studio 2015 (on Windows) is required.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also make CMake the default (instead of GNU Make and cmake only for Windows)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd be happy to do that, but so many other downstream instructions use make. Are we ready to update all of those too?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, maybe it can wait then and be done in a separate PR

```
MXNet relies on the
[BLAS](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) (Basic
Linear Algebra Subprograms) library for numerical computations. You can install
Copy link
Contributor

Choose a reason for hiding this comment

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

... library for numerical computations. Those can be extended with the LAPACK (Linear Algebra Package) - an additional set of mathematical functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems like this would be a good spot to mention mkl-dnn? Also could link to those instructions within the project... wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely

Linear Algebra Subprograms) library for numerical computations. You can install
any one among [ATLAS](http://math-atlas.sourceforge.net/),
[OpenBLAS](http://www.openblas.net/) and
[MKL](https://software.intel.com/en-us/intel-mkl).
Copy link
Contributor

Choose a reason for hiding this comment

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

[Accelerate](https://developer.apple.com/documentation/accelerate) on MAC OSX.

</div>
### Other Linux
Installing both `git` and `make` by following instructions on the websites is
straightforward. Here we provide the instructions to build `gcc-4.8` from source codes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure that we need instructions how to build gcc? Is there any use case where it can not be installed with a package manager?

Say: sudo apt install gcc-4.8 or sudo apt install gcc-4.9

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, with Caffe2 on CentOS, I had to build gcc from scratch. I haven't tried MXNet on CentOS yet, but I wonder if whoever wrote this ran into a similar issue.

Since this is for "other linux" the apt instructions won't cut it.
My preference would be to split out a separate page for CentOS and have thorough, tested instructions. (maybe as a separate PR?)


In Visual Studio, open the solution file,```.sln```, and compile it.
These commands produce a library called ```mxnet.dll``` in the ```./build/Release/``` or ```./build/Debug``` folder.
* Build on macOS with the default BLAS library and clang installed with `xcode` (OPENMP is disabled because it is not supported in default by clang):
Copy link
Contributor

Choose a reason for hiding this comment

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

To use OpenMP on MacOS you need to install the Clang compiler brew install llvm (the one provided by Apple does not support OpenMP)


</div>
```bash
make USE_OPENCV=0
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this would be a good place to put the BLAS libraries explanation from #11148. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This caused me to rearrange the page for a better flow. This is all good info. It should be double-checked in case it is only for cmake and won't work for make.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, yes you're right

**Experimental Choice** If You would like to install mxnet with Intel MKL, try the experimental pip package with MKL:
```bash
$ pip install mxnet-mkl
$ pip install mxnet
Copy link
Contributor

Choose a reason for hiding this comment

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

Not mxnet-mkl anymore? There are a lot of other options as well: https://pypi.org/search/?q=mxnet Maybe add some recommendation or at least list some options here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2018-08-29_11-35-04

I added the link to PyPI as a "footer" for every pip install instruction. That way users can look for them. I could also put in a footer note that adding *-mkl to a package would get them the experimental mkl support.... that would be good?

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome


- [G++ (4.8 or later)](https://gcc.gnu.org/gcc-4.8/). Make sure to use gcc 4 and not 5 or 6 as there
Copy link
Contributor

Choose a reason for hiding this comment

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

Clang 3.9 - 6 as well

-DUSE_SIGNAL_HANDLER=ON \
-DCMAKE_BUILD_TYPE=Release \
-GNinja ..
ninja -j1
Copy link
Contributor

Choose a reason for hiding this comment

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

-j $(nproc)


```bash
$ cd python
$ pip install -e .
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the `-e` flag is optional. It is equivalent to `--editable` and means that if you edit the source files, these changes will be reflected in the package installed.

@aaronmarkham
Copy link
Contributor Author

aaronmarkham commented Aug 29, 2018

@lebeg thanks for the review! I've addressed most of you comments. Please take a look at the build from source page again since I made a lot of changes after incorporating your cmake documentation on BLAS. That was all really good stuff to add here!

A big update would be to switch using cmake as the default and change all of the examples, but I think we should hold off until your cmake PR is merged, right?

@aaronmarkham
Copy link
Contributor Author

I could also add this table to the pip footer...

pip

@lebeg
Copy link
Contributor

lebeg commented Aug 30, 2018

A big update would be to switch using cmake as the default and change all of the examples, but I think we should hold off until your cmake PR is merged, right?

Yes, absolutely.

Both JDK and Maven are required to build the Scala package.

<div class="ubuntu">
* Build on **macOS** with the default BLAS library and clang installed with `xcode` (OPENMP is disabled because it is not supported in default by clang):
Copy link
Contributor

Choose a reason for hiding this comment

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

Build on macOS with the default BLAS library and Clang installed with xcode (OpenMP is disabled because it is not supported by default by Apple version of Clang):

@aaronmarkham
Copy link
Contributor Author

This PR also fixes #10020

@indhub indhub merged commit d7111d3 into apache:master Sep 5, 2018
aaronmarkham added a commit to aaronmarkham/incubator-mxnet that referenced this pull request Sep 11, 2018
* initial edits for c++ instructions

* consolidation and reorg of install docs

* simplify python section

* fix url rewrite to allow for testing

* further simplify install

* fix render issues

* adjust formatting

* adjust formatting

* fix python/gpu/master

* install footers

* update footers

* add mac dev setup link for osx

* adjust formatting for footer

* separate validation page

* add toc

* adjust formatting

* break out julia and perl

* fix pypi link

* fix formatting

* fix formatting

* fix formatting

* add build from source link

* updating from PR feedback

* add c++ and clojure to ubuntu guide; clarify c++ setup

* added pip chart to install; updates from PR feedback

* correct reference to c infer api
@marcoabreu
Copy link
Contributor

@aaronmarkham
Copy link
Contributor Author

I'll take a look. I removed the virtualenv section so it should be an easy fix.

anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request Sep 19, 2018
* initial edits for c++ instructions

* consolidation and reorg of install docs

* simplify python section

* fix url rewrite to allow for testing

* further simplify install

* fix render issues

* adjust formatting

* adjust formatting

* fix python/gpu/master

* install footers

* update footers

* add mac dev setup link for osx

* adjust formatting for footer

* separate validation page

* add toc

* adjust formatting

* break out julia and perl

* fix pypi link

* fix formatting

* fix formatting

* fix formatting

* add build from source link

* updating from PR feedback

* add c++ and clojure to ubuntu guide; clarify c++ setup

* added pip chart to install; updates from PR feedback

* correct reference to c infer api
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants