-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-1225] Always use config.mk in make install instructions #13364
Conversation
@mxnet-label-bot add [Build, Doc, Installation] Also @aaronmarkham |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look good. Thanks for going for consistency!
You might want to dig around a bit more... there's the build from source page and a centos page to name a ...two... but this PR looks fine as it is.
Why are we documenting make instead of CMake? We want to completely switch over to CMake... |
@larroy I am documenting make because as far as I know the scala package only works through make. If it works through cmake, is there anything blocking us from entirely switching all make commands to cmake throughout the install instructions? Also, does cmake use config.mk as well? If it does, I think the same thing applies such that all cmake commands should use config.mk instead of passing arguments directly. I ran into a few cmake commands that did not use config.mk in the build_from_source.md, but I was unsure whether they could be switched or not. |
I'm not familiar with the compilation in the Scala package. And no CMake doesn't work with config.mk Just wanted to make you aware of the CMake efforts. |
@mxnet-label-bot add [pr-awaiting-review] @larroy The scala package compilation process currently requires a number of building and linking flags used to build the backend to be passed to the Java Native Interface as well. So, we currently call make and then make calls maven with those flags. Right now, we are working on improving the scala build so that it doesn't require those flags, but it doesn't seem to be trivial. Therefore, I added redundant flags to all cmake calls for now since it would at least result in the scala build always working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't hurt for someone a bit more familiar with the build process to take a look but this LGTM.
Could you please raise a discussion on devlist? |
I ran through this to test. Everything seemed to work fine except I had to specify USE_CUDA = 0 in the ubuntu_setup instructions. |
@zachgk , @lanking520 , do you guys think it makes sense to merge this in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use cmake throughout?
Also, can you note the Scala dependency on make in this section: https://mxnet.incubator.apache.org/install/build_from_source.html#build-configurations
I would suggest to converge in using CMake, I would propose to use a thin wrapper over cmake so we can use a file to define options in this fashion: /~https://github.com/apache/incubator-mxnet/blob/master/cmake/cmake_options.yml This would then work in the same way as config.mk now. But parsed into a commandline as it's done here: /~https://github.com/apache/incubator-mxnet/blob/master/dev_menu.py#L48 Also, some of the changes proposed here don't work at all, have they been tested locally? |
@larroy @aaronmarkham In the meantime, we have a redundancy in our docs between the build_from_source instructions and the os specific files. Our current plan is to take advantage of it by leaving cmake in the build_from_source and make in the os specific. Then, we will tell all scala users that they must use the os specific instructions and not the build from source instructions. If they did build using cmake and the build_from_source instructions, they should "make clean" and remake it with the os specific instructions. |
@larroy Can you point me to more info on "dev menu"? I think I understand what you're suggesting, but I don't see anything on the wiki or in the repo, other than the code itself.
|
Minor doc fixes
@aaronmarkham I extended dev_menu.py with a CMake builder helper that uses cmake options from a file, as the pattern of copying config.mk was useful for several people: You can try what I mean by using ./dev_menu.py and choosing "Local build" check the CMake class inside that file: Or when this PR gets merged, one can do
/~https://github.com/apache/incubator-mxnet/pull/13529/files Maybe you can give some feedback about this method, to see if you consider it would make sense to use this simplification on the documentation. So far I haven't documented any of this as I'm refining these convenience scripts and are more targeted to development. |
@larroy If you have no objections, I will also open a PR to move the rest of the install instructions to cmake once scala is ready. |
@zachgk shall we leave Scala as it is with Make but move the others to CMake? that would be my preferred option. |
I fixed the CPP instructions for now, but all of the other usages of make in the install docs could be reached on the path to installing scala (scala defers the engine build to the os specific pages) |
``` | ||
|
||
#### Recommended for Systems with NVIDIA GPUs | ||
* Build with both OpenBLAS, GPU, and OpenCV support: | ||
|
||
```bash | ||
cmake -j BLAS=open USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 | ||
mkdir build && cd build | ||
cmake -DBLAS=open -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -GNinja . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does ninja
do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a build system (https://ninja-build.org/). I believe CMake generates the ninja configuration files and then ninja performs the actual build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Please explain the change you have made on cmake.
* upstream/master: (38 commits) Feature/mkldnn static (apache#13628) Fix the bug of BidirectionalCell (apache#13575) Set install path for libmxnet.so dynamic lib on Mac OS (apache#13629) add batch norm test (apache#13625) Scripts for building dependency libraries of MXNet (apache#13282) fix quantize pass error when the quantization supported Op are excluded in the model (apache#13596) Optimize C++ API (apache#13496) Fix warning in waitall doc (apache#13618) [MXNET-1225] Always use config.mk in make install instructions (apache#13364) [MXNET-1224]: improve scala maven jni build and packing. (apache#13493) [MXNET-1155] Add scala packageTest utility (apache#13046) fix the Float not showing correctly problem (apache#13617) apache#13385 [Clojure] - Turn examples into integration tests (apache#13554) Add Intel MKL blas to Jenkins (apache#13607) Revert "[MXNET-1198] MXNet Java API (apache#13162)" Reducing the length of setup tutorial (apache#13306) [MXNET-1182] Predictor example (apache#13237) [MXNET-1187] Added Java SSD Inference Tutorial for website (apache#13201) add defaults and clean up the tests (apache#13295) [MXNET-1181] Added command line alternative to IntelliJ in install instructions (apache#13267) ...
Description
Arguments to make for the mxnet build can be passed either directly through the command line or through config.mk. The install instructions are inconsistent and use both options. However, some frontends such as scala require the arguments as well so they must be passed to both the initial make and the following "make scalapkg". Failure to pass the arguments to the scalapkg make can result in an improper configuration and slower performance. To resolve this, I am switching the install instructions to consistently use the config.mk because it is automatically used by all make commands which resolves the potential frontend problems.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
@nswamy @lanking520 @yzhliu @andrewfayres @piyushghai