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/24 20:14:03 UTC

[GitHub] [incubator-mxnet] leezu opened a new pull request #17430: cmake: add config files similar to make/config.mk

leezu opened a new pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430
 
 
   ## Description ##
   Add config files similar to make/config.mk and update the `ubuntu_setup` guide.
   
   CC @eric-haibin-lin @apeforest @yajiedesign 

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370860435
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually. If no architecture is
+# detected or specified, compilation will target all available architectures,
+# which significantly slows down the build .
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+set(ENABLE_CUDA_RTC OFF CACHE BOOL "Build with CUDA runtime compilation support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+# set(USE_NVTX ON CACHE BOOL "Build with NVTX support")  # TODO Currently always autodetected in CMake
+set(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
+set(NCCL_ROOT "" CACHE BOOL "NCCL install path. Supports autodetection.")
+
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+# USE_LIBJPEG_TURBO = 0  # TODO Not yet supported in CMake build
+# set(LIBJPEG_TURBO_ROOT "" CACHE BOOL "libjpeg-turbo install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
+
+# USE_NNPACK = 0  # TODO Not yet supported in CMake build
+
+# Building with lapack is only effective when compiled with any of
+# openblas/apple/atlas/mkl blas versions
+set(USE_LAPACK ON CACHE BOOL "Build with lapack support")
+
+
+#---------------------------------------------
+# CPU instruction sets: The support is autodetected if turned ON
+#---------------------------------------------
+set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction support")
+set(USE_F16C ON CACHE BOOL "Build with x86 F16C instruction support")
+
+
+#----------------------------
+# distributed computing
+#----------------------------
+set(USE_DIST_KVSTORE OFF CACHE BOOL "Build with DIST_KVSTORE support")
+# set(USE_HDFS OFF CACHE BOOL "Allow read and write to HDFS directly; requires hadoop")  # TODO Not yet supported in CMake build
+# # path to libjvm.so. required if USE_HDFS=1
+# LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server
 
 Review comment:
   `# TODO Not yet supported in CMake build`

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r371014979
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,129 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
 
 Review comment:
   Thanks. The typo was copy-pasted from https://github.com/apache/incubator-mxnet/blob/47349ce50004d52af7844ea7c3c509de96678928/make/config.mk#L22

----------------------------------------------------------------
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] eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370826579
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually. If no architecture is
+# detected or specified, compilation will target all available architectures,
+# which significantly slows down the build .
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+set(ENABLE_CUDA_RTC OFF CACHE BOOL "Build with CUDA runtime compilation support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+# set(USE_NVTX ON CACHE BOOL "Build with NVTX support")  # TODO Currently always autodetected in CMake
+set(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
 
 Review comment:
   We can probably remove it since nccl kvstore is seldom used

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r371014806
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,129 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------------------------------
+# GPU support
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+
+# Target NVIDIA GPU achitecture.
+# Valid options are "Auto" for autodetection, "All" for all available
+# architectures or a list of architectures by compute capability number, such as
+# "7.0" or "7.0;7.5" as well as name, such as "Volta" or "Volta;Turing".
+# The value specified here is passed to cmake's CUDA_SELECT_NVCC_ARCH_FLAGS to
+# obtain the compilation flags for nvcc.
+#
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually to avoid excessive
+# compilation times.
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+#---------------------------------------------
+# Common libraries
+#---------------------------------------------
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
 
 Review comment:
   The check is not skipped, but the `option` call becomes a no-op.
   
   > In CMake 3.13 and above the option() command prefers to do nothing when a normal variable of the given name already exists. It does not create or update a cache entry or remove the normal variable. The new behavior is consistent between the first and later runs in a build tree. This policy provides compatibility with projects that have not been updated to expect the new behavior.
   
   https://cmake.org/cmake/help/latest/policy/CMP0077.html

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370860561
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
 
 Review comment:
   Order follows `config.mk`. We can change it

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370862301
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually. If no architecture is
+# detected or specified, compilation will target all available architectures,
+# which significantly slows down the build .
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+set(ENABLE_CUDA_RTC OFF CACHE BOOL "Build with CUDA runtime compilation support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+# set(USE_NVTX ON CACHE BOOL "Build with NVTX support")  # TODO Currently always autodetected in CMake
+set(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
 
 Review comment:
   Let's move it to the bottom of the file into a category of seldomly used features.

----------------------------------------------------------------
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] eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370825974
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually. If no architecture is
+# detected or specified, compilation will target all available architectures,
+# which significantly slows down the build .
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+set(ENABLE_CUDA_RTC OFF CACHE BOOL "Build with CUDA runtime compilation support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+# set(USE_NVTX ON CACHE BOOL "Build with NVTX support")  # TODO Currently always autodetected in CMake
+set(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
+set(NCCL_ROOT "" CACHE BOOL "NCCL install path. Supports autodetection.")
+
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+# USE_LIBJPEG_TURBO = 0  # TODO Not yet supported in CMake build
+# set(LIBJPEG_TURBO_ROOT "" CACHE BOOL "libjpeg-turbo install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
+
+# USE_NNPACK = 0  # TODO Not yet supported in CMake build
+
+# Building with lapack is only effective when compiled with any of
+# openblas/apple/atlas/mkl blas versions
+set(USE_LAPACK ON CACHE BOOL "Build with lapack support")
+
+
+#---------------------------------------------
+# CPU instruction sets: The support is autodetected if turned ON
+#---------------------------------------------
+set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction support")
 
 Review comment:
   Are these two frequently used configs? 

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370863015
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually. If no architecture is
+# detected or specified, compilation will target all available architectures,
+# which significantly slows down the build .
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+set(ENABLE_CUDA_RTC OFF CACHE BOOL "Build with CUDA runtime compilation support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+# set(USE_NVTX ON CACHE BOOL "Build with NVTX support")  # TODO Currently always autodetected in CMake
+set(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
+set(NCCL_ROOT "" CACHE BOOL "NCCL install path. Supports autodetection.")
+
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+# USE_LIBJPEG_TURBO = 0  # TODO Not yet supported in CMake build
+# set(LIBJPEG_TURBO_ROOT "" CACHE BOOL "libjpeg-turbo install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
+
+# USE_NNPACK = 0  # TODO Not yet supported in CMake build
+
+# Building with lapack is only effective when compiled with any of
+# openblas/apple/atlas/mkl blas versions
+set(USE_LAPACK ON CACHE BOOL "Build with lapack support")
+
+
+#---------------------------------------------
+# CPU instruction sets: The support is autodetected if turned ON
+#---------------------------------------------
+set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction support")
 
 Review comment:
   I expect there are some power users that need it. In particular, they are important when you build on a different machine compared to where you run MXNet. In that case autodetection may find F16C is available, but on your target machine it's not. 
   Currently the selection of options is based on what is included in `config.mk`. 

----------------------------------------------------------------
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] eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370826100
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually. If no architecture is
+# detected or specified, compilation will target all available architectures,
+# which significantly slows down the build .
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+set(ENABLE_CUDA_RTC OFF CACHE BOOL "Build with CUDA runtime compilation support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+# set(USE_NVTX ON CACHE BOOL "Build with NVTX support")  # TODO Currently always autodetected in CMake
+set(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
+set(NCCL_ROOT "" CACHE BOOL "NCCL install path. Supports autodetection.")
+
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+# USE_LIBJPEG_TURBO = 0  # TODO Not yet supported in CMake build
+# set(LIBJPEG_TURBO_ROOT "" CACHE BOOL "libjpeg-turbo install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
+
+# USE_NNPACK = 0  # TODO Not yet supported in CMake build
+
+# Building with lapack is only effective when compiled with any of
+# openblas/apple/atlas/mkl blas versions
+set(USE_LAPACK ON CACHE BOOL "Build with lapack support")
+
+
+#---------------------------------------------
+# CPU instruction sets: The support is autodetected if turned ON
+#---------------------------------------------
+set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction support")
+set(USE_F16C ON CACHE BOOL "Build with x86 F16C instruction support")
+
+
+#----------------------------
+# distributed computing
+#----------------------------
+set(USE_DIST_KVSTORE OFF CACHE BOOL "Build with DIST_KVSTORE support")
+# set(USE_HDFS OFF CACHE BOOL "Allow read and write to HDFS directly; requires hadoop")  # TODO Not yet supported in CMake build
+# # path to libjvm.so. required if USE_HDFS=1
+# LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server
 
 Review comment:
   what are these commented lines? 

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370861969
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
 
 Review comment:
   It's a feature of upstream https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/FindCUDA/select_compute_arch.cmake
   
   Let's document it better (the documentation you mention is taken from upstream, but leaves room for improvement). For example, `"7.0(6.0)"` translates to `-gencode;arch=compute_60,code=sm_70`.

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370860435
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually. If no architecture is
+# detected or specified, compilation will target all available architectures,
+# which significantly slows down the build .
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+set(ENABLE_CUDA_RTC OFF CACHE BOOL "Build with CUDA runtime compilation support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+# set(USE_NVTX ON CACHE BOOL "Build with NVTX support")  # TODO Currently always autodetected in CMake
+set(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
+set(NCCL_ROOT "" CACHE BOOL "NCCL install path. Supports autodetection.")
+
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+# USE_LIBJPEG_TURBO = 0  # TODO Not yet supported in CMake build
+# set(LIBJPEG_TURBO_ROOT "" CACHE BOOL "libjpeg-turbo install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
+
+# USE_NNPACK = 0  # TODO Not yet supported in CMake build
+
+# Building with lapack is only effective when compiled with any of
+# openblas/apple/atlas/mkl blas versions
+set(USE_LAPACK ON CACHE BOOL "Build with lapack support")
+
+
+#---------------------------------------------
+# CPU instruction sets: The support is autodetected if turned ON
+#---------------------------------------------
+set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction support")
+set(USE_F16C ON CACHE BOOL "Build with x86 F16C instruction support")
+
+
+#----------------------------
+# distributed computing
+#----------------------------
+set(USE_DIST_KVSTORE OFF CACHE BOOL "Build with DIST_KVSTORE support")
+# set(USE_HDFS OFF CACHE BOOL "Allow read and write to HDFS directly; requires hadoop")  # TODO Not yet supported in CMake build
+# # path to libjvm.so. required if USE_HDFS=1
+# LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server
 
 Review comment:
   `# TODO Not yet supported in CMake build`
   
   Let's remove the inline TODOs and track them outside of the file instead. 

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
TaoLv commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370997064
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,129 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------------------------------
+# GPU support
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+
+# Target NVIDIA GPU achitecture.
+# Valid options are "Auto" for autodetection, "All" for all available
+# architectures or a list of architectures by compute capability number, such as
+# "7.0" or "7.0;7.5" as well as name, such as "Volta" or "Volta;Turing".
+# The value specified here is passed to cmake's CUDA_SELECT_NVCC_ARCH_FLAGS to
+# obtain the compilation flags for nvcc.
+#
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually to avoid excessive
+# compilation times.
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+#---------------------------------------------
+# Common libraries
+#---------------------------------------------
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
 
 Review comment:
   How does this work with the if condition here: https://github.com/apache/incubator-mxnet/blob/master/CMakeLists.txt#L40? Will the check be skipped?

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
TaoLv commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370996139
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,129 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
 
 Review comment:
   "First copy the this file ... " --> "First copy this file ..."

----------------------------------------------------------------
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] eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370838578
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
 
 Review comment:
   Is it possible to reorder the configurations in this cmake, so that the frequently used ones appear first? For instance: USE_CUDA, USE_CUDNN, USE_MKLDNN 

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r371015437
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,129 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------------------------------
+# GPU support
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+
+# Target NVIDIA GPU achitecture.
+# Valid options are "Auto" for autodetection, "All" for all available
+# architectures or a list of architectures by compute capability number, such as
+# "7.0" or "7.0;7.5" as well as name, such as "Volta" or "Volta;Turing".
+# The value specified here is passed to cmake's CUDA_SELECT_NVCC_ARCH_FLAGS to
+# obtain the compilation flags for nvcc.
+#
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually to avoid excessive
+# compilation times.
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+#---------------------------------------------
+# Common libraries
+#---------------------------------------------
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
 
 Review comment:
   Could you advise if `if(USE_MKL_IF_AVAILABLE AND (NOT APPLE) AND (NOT MSVC) AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") AND (NOT CMAKE_CROSSCOMPILING))` condition is correct?
   
   Is MKL-DNN unsupported on Apple and MSVC?
   Ideally we can use MKL-DNN for builds for all x86_64 platforms and thus the `config.cmake` file introduced in this PR is valid for all of these.

----------------------------------------------------------------
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 a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
TaoLv commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r371047881
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,129 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------------------------------
+# GPU support
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+set(USE_CUDNN ON CACHE BOOL "Build with cudnn support, if found")
+
+# Target NVIDIA GPU achitecture.
+# Valid options are "Auto" for autodetection, "All" for all available
+# architectures or a list of architectures by compute capability number, such as
+# "7.0" or "7.0;7.5" as well as name, such as "Volta" or "Volta;Turing".
+# The value specified here is passed to cmake's CUDA_SELECT_NVCC_ARCH_FLAGS to
+# obtain the compilation flags for nvcc.
+#
+# When compiling on a machine without GPU, autodetection will fail and you
+# should instead specify the target architecture manually to avoid excessive
+# compilation times.
+set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture")
+
+#---------------------------------------------
+# Common libraries
+#---------------------------------------------
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.")
+
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+
+set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
 
 Review comment:
   MKL-DNN should also support Apple and MSVC. See https://github.com/intel/mkl-dnn/#runtime-dependencies.
   Previously we decided to enable MKL-DNN by default only on linux machines, so Apple and MSVC are excluded. One note is that, if MSVC, `CMAKE_HOST_SYSTEM_PROCESSOR` may not be `x86_64`. Also if we want to default MKL-DNN on all platforms, similar change should be applied to makefile too.

----------------------------------------------------------------
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 merged pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
leezu merged pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430
 
 
   

----------------------------------------------------------------
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] eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on a change in pull request #17430: cmake: add config files similar to make/config.mk
URL: https://github.com/apache/incubator-mxnet/pull/17430#discussion_r370823858
 
 

 ##########
 File path: config/config.cmake
 ##########
 @@ -0,0 +1,143 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling MXNet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp config/config.cmake config.cmake
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ mkdir build; cd build
+#  $ cmake -C ../config.cmake ..
+#  $ cmake --build . --parallel 8
+#
+# You can increase the --parallel 8 argument to match the number of processor
+# cores of your computer.
+#
+#-------------------------------------------------------------------------------
+
+#---------------------
+# Compilers
+#--------------------
+# Compilers are usually autodetected. Uncomment and modify the next 3 lines to
+# choose manually:
+
+# set(CMAKE_C_COMPILER "" CACHE BOOL "C compiler")
+# set(CMAKE_CXX_COMPILER "" CACHE BOOL "C++ compiler")
+# set(CMAKE_CUDA_COMPILER "" CACHE BOOL "Cuda compiler (nvcc)")
+
+# Uncomment the following line to compile with debug information
+# set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMake build type")
+
+# Whether to build operators written in TVM
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
+
+# Target NVIDIA GPU achitecture.
+# Format: Auto | Common | All | LIST(ARCH_AND_PTX ...)
+# - "Auto" detects local machine GPU compute arch at runtime.
+# - "Common" and "All" cover common and entire subsets of architectures
+# - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+# - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# - NUM: Any number. Only those pairs are currently accepted by NVCC though:
+#        2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
 
 Review comment:
   Why is there `NUM.NUM(NUM.NUM)` ? 

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