You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/01/29 05:59:42 UTC

[GitHub] [incubator-mxnet] leezu opened a new pull request #17468: Add -march=native -mtune=native to config/config.cmake

leezu opened a new pull request #17468: Add -march=native -mtune=native to config/config.cmake
URL: https://github.com/apache/incubator-mxnet/pull/17468
 
 
   ## Description ##
   Add settings to `config/config.cmake` to optimize for local CPU architecture.
   
   ### Changes ###
   - [X] Add -march=native -mtune=native to config/config.cmake
   
   ## Comments ##
   Related https://github.com/apache/incubator-mxnet/pull/17047
   
   @TaoLv would providing different default `config/config.cmake` files for different architectures with the respective compiler flags be an easier way forward than adding flags like `USE_X86_ARCH` to the `CMakeLists.txt`. What do you think?
   
   For example, for ARM, the config file would instead contain 
   ```
   # CPU Architecture to optimize for. With default settings, your build may not
   # work on earlier CPUs than the one used by the system you are compiling on.
   # To work with older CPU, set the -march, -mtune variables below to the
   # respective architecture name of the target CPU (see GCC documentation).
   set(CMAKE_C_FLAGS "-mcpu=native" CACHE STRING "C compiler flags")
   set(CMAKE_CXX_FLAGS "-mcpu=native" CACHE STRING "C++ compiler flags")
   ```
   as per https://github.com/apache/incubator-mxnet/pull/17047#issuecomment-565274798, https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] TaoLv commented on issue #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
TaoLv commented on issue #17468: Add -march=native -mtune=native to config/config.cmake
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-580048290
 
 
   It would also change the default behavior of cmake build - previously it can be built on a machine and run on a lower end machine, but now it probably will lead to illegal instruction error?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17468: Add -march=native -mtune=native to config/config.cmake
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-580056128
 
 
    `cmake -C ../config.cmake` didn't exist previously, in that sense we don't break the default behavior. The config file is a new feature in MXNet 1.7 and we're free to set the defaults (IMO).
   
   You are right that there may be people that copy the `config.cmake` file, don't read it and run into this issue when copying `libmxnet.so` to a different computer.
   
   We can comment out the lines introduced by this PR by default to decrease the likelihood of running into the issue you describe. Even thene https://github.com/apache/incubator-mxnet/issues/14664 would mean that `libmxnet.so` would stop working on CPU without AVX.
   
   Would you recommend to comment out the `-march=native -mtune=native` by default?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] TaoLv commented on issue #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
TaoLv commented on issue #17468: Add -march=native -mtune=native to config/config.cmake
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-582474295
 
 
   @leezu Could you please rebase? Then we can merge if CI passes. Because I see the last validation is 7 days ago.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] TaoLv commented on issue #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
TaoLv commented on issue #17468: Add -march=native -mtune=native to config/config.cmake
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-579755643
 
 
   Thank you for adding this! This needs to modify the config.cmake carefully if we want to build binary for another platform, ie. using cmake for the convenient releases.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17468: Add -march=native -mtune=native to config/config.cmake
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-589791317
 
 
   I plan to merge this after the static build instructions are improved.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17468: Add -march=native -mtune=native to config/config.cmake
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-579876732
 
 
   For the binary distribution I suggest to use another set of config files. Please take a look at https://github.com/apache/incubator-mxnet/pull/17448

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on pull request #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #17468:
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-700207559


   @mxnet-bot run ci [windows-gpu]


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #17468:
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-700207602


   Jenkins CI successfully triggered : [windows-gpu]


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on pull request #17468: Add -march=native -mtune=native to config/config.cmake

Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #17468:
URL: https://github.com/apache/incubator-mxnet/pull/17468#issuecomment-699101893


   As the staticbuild is now easy to do via `python ci/build.py --platform centos7_cpu /work/runtime_functions.sh build_static_libmxnet cpu`, this PR is ready


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org