leezu commented on a change in pull request #17214: [tvmop] support cuda multi-arch compilation URL: https://github.com/apache/incubator-mxnet/pull/17214#discussion_r364252192
########## File path: contrib/tvmop/compile.py ########## @@ -99,24 +99,16 @@ def get_cuda_arch(arch): if len(arch) == 0: return None - # the arch string is of format '-gencode;arch=compute_XX,code=sm_XX' - # this format is computed by CMake CUDA_SELECT_NVCC_ARCH_FLAGS - if arch.startswith('-gencode;'): - return arch.split(';') - - # the arch string contains '-arch=sm_xx' - flags = arch.split() + # an example of arch string, + # -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 + # -gencode;arch=compute_75,code=[sm_75,compute_75] --fatbin-options -compress-all + archs = [] + flags = arch.replace("-gencode;", "-gencode ").split() Review comment: Should this be `arch.replace(";", " ").split()`? Consider your example of `gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35`. The equivalent case for cmake is `gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35`. Alternatively you can change the CMakeList ` set(TVM_OP_COMPILE_OPTIONS "${TVM_OP_COMPILE_OPTIONS}" "--cuda-arch" "\"${CUDA_ARCH_FLAGS}\"")` to ` set(TVM_OP_COMPILE_OPTIONS "${TVM_OP_COMPILE_OPTIONS}" "--cuda-arch" "\"${CUDA_ARCH_FLAGS_SPACES}\"")` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services