k2-fsa / k2

FSA/FST algorithms, differentiable, with PyTorch compatibility.
https://k2-fsa.github.io/k2
Apache License 2.0
1.11k stars 213 forks source link

Error when Install from source #1173

Closed xIaott-s closed 1 year ago

xIaott-s commented 1 year ago

I try to install k2 from source, but some error about "no matching function for call to ‘torch::jit::Compound::create(torch::jit::TokenKind, const torch::jit::SourceRange&, const torch::jit::List&)" happened: (k2) [sunty@3090 k2]$ python3 setup.py install running install /data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info writing k2.egg-info/PKG-INFO writing dependency_links to k2.egg-info/dependency_links.txt writing requirements to k2.egg-info/requires.txt writing top-level names to k2.egg-info/top_level.txt reading manifest file 'k2.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'k2.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build creating build/lib.linux-x86_64-cpython-38 creating build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/init.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/autograd.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/autograd_utils.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/ctc_loss.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/decode.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/dense_fsa_vec.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/fsa.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/fsa_algo.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/fsa_properties.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/mutual_information.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/mwer_loss.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/nbest.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/online_dense_intersecter.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/ops.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/rnnt_decode.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/rnnt_loss.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/symbol_table.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/utils.py -> build/lib.linux-x86_64-cpython-38/k2 copying k2/python/k2/torch_version.py -> build/lib.linux-x86_64-cpython-38/k2 creating build/lib.linux-x86_64-cpython-38/k2/ragged copying k2/python/k2/ragged/init.py -> build/lib.linux-x86_64-cpython-38/k2/ragged creating build/lib.linux-x86_64-cpython-38/k2/sparse copying k2/python/k2/sparse/init.py -> build/lib.linux-x86_64-cpython-38/k2/sparse copying k2/python/k2/sparse/autograd.py -> build/lib.linux-x86_64-cpython-38/k2/sparse creating build/lib.linux-x86_64-cpython-38/k2/version copying k2/python/k2/version/init.py -> build/lib.linux-x86_64-cpython-38/k2/version copying k2/python/k2/version/main.py -> build/lib.linux-x86_64-cpython-38/k2/version copying k2/python/k2/version/version.py -> build/lib.linux-x86_64-cpython-38/k2/version running build_ext cmake_path: /usr/bin/cmake Setting PYTHON_EXECUTABLE to /data1/sunty/miniconda3/envs/k2/bin/python3 build command is:

            cd build/temp.linux-x86_64-cpython-38

            cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/data1/sunty/miniconda3/envs/k2/bin/python3 -DK2_ENABLE_BENCHMARK=OFF  -DK2_ENABLE_TESTS=OFF  -DCMAKE_INSTALL_PREFIX=/data1/sunty/workspace/k2_env/k2/build/lib.linux-x86_64-cpython-38/k2  /data1/sunty/workspace/k2_env/k2

            cat k2/csrc/version.h

            make -j6 install

-- CMAKE_VERSION: 3.25.0 -- Enabled languages: CXX;CUDA -- The CXX compiler identification is GNU 8.3.1 -- The CUDA compiler identification is NVIDIA 11.1.105 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /opt/rh/devtoolset-8/root/bin/g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: /usr/local/cuda-11.1/bin/nvcc - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done -- K2_OS: -- Found Git: /usr/bin/git (found version "1.8.3.1") -- Looking for C++ include cxxabi.h -- Looking for C++ include cxxabi.h - found -- Looking for C++ include execinfo.h -- Looking for C++ include execinfo.h - found -- Performing Test K2_COMPILER_SUPPORTS_CXX14 -- Performing Test K2_COMPILER_SUPPORTS_CXX14 - Success -- C++ Standard version: 14 -- Autodetected CUDA architecture(s): 8.6 8.6 8.6 8.6 -- K2_COMPUTE_ARCH_FLAGS: -gencode;arch=compute_86,code=sm_86 -- K2_COMPUTE_ARCH_CANDIDATES 35;50;60;61;70;75;80;86 -- Skipping arch 35 -- Skipping arch 50 -- Skipping arch 60 -- Skipping arch 61 -- Skipping arch 70 -- Skipping arch 75 -- Skipping arch 80 -- Adding arch 86 -- K2_COMPUTE_ARCHS: 86 -- Found Valgrind: /usr/bin
-- Found Valgrind: /usr/bin/valgrind -- To check memory, run ctest -R <NAME> -D ExperimentalMemCheck -- Downloading pybind11 from https://github.com/pybind/pybind11/archive/5bc0943ed96836f46489f53961f6c438d2935357.zip -- pybind11 is downloaded to /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/pybind11-src -- pybind11 v2.11.0 dev1 -- Found PythonInterp: /data1/sunty/miniconda3/envs/k2/bin/python3 (found suitable version "3.8.16", minimum required is "3.6") -- Found PythonLibs: /data1/sunty/miniconda3/envs/k2/lib/libpython3.8.so -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Python executable: /data1/sunty/miniconda3/envs/k2/bin/python3 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda-11.1 (found version "11.1") -- Caffe2: CUDA detected: 11.1 -- Caffe2: CUDA nvcc is: /usr/local/cuda-11.1/bin/nvcc -- Caffe2: CUDA toolkit directory: /usr/local/cuda-11.1 -- Caffe2: Header version is: 11.1 -- Found CUDNN: /usr/local/cuda-11.1/lib64/libcudnn.so
-- Found cuDNN: v8.2.0 (include: /usr/local/cuda-11.1/include, library: /usr/local/cuda-11.1/lib64/libcudnn.so) -- /usr/local/cuda-11.1/lib64/libnvrtc.so shorthash is 3a20f2b6 -- Autodetected CUDA architecture(s): 8.6 8.6 8.6 8.6 -- Added CUDA NVCC flags for: -gencode;arch=compute_86,code=sm_86 CMake Warning at /data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:22 (message): static library kineto_LIBRARY-NOTFOUND not found. Call Stack (most recent call first): /data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:127 (append_torchlib_if_found) cmake/torch.cmake:11 (find_package) CMakeLists.txt:292 (include)

-- Found Torch: /data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/lib/libtorch.so
-- K2_TORCH_VERSION: 1.10 -- PyTorch version: 1.10.1+cu111 -- PyTorch cuda version: 11.1 -- Generated /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/torch_version.py -- Downloading moderngpu from https://github.com/moderngpu/moderngpu/archive/8ec9ac0de8672de7217d014917eedec5317f75f3.zip -- moderngpu is downloaded to /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/moderngpu-src -- CMAKE_CUDA_FLAGS: -Wno-deprecated-gpu-targets -lineinfo --expt-extended-lambda -use_fast_math -Xptxas=-w --expt-extended-lambda -gencode arch=compute_86,code=sm_86 -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options -Wall --compiler-options -Wno-strict-overflow --compiler-options -Wno-unknown-pragmas -- CMAKE_CXX_FLAGS: -D_GLIBCXX_USE_CXX11_ABI=0 -Wno-unused-variable -Wno-strict-overflow -- CMAKE_CUDA_FLAGS: -Wno-deprecated-gpu-targets -lineinfo --expt-extended-lambda -use_fast_math -Xptxas=-w --expt-extended-lambda -gencode arch=compute_86,code=sm_86 -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options -Wall --compiler-options -Wno-strict-overflow --compiler-options -Wno-unknown-pragmas -- Generated /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/k2/csrc/version.h -- PYTHON_LIBRARY: /data1/sunty/miniconda3/envs/k2/lib/libpython3.8.so -- Including k2/torch. K2_TORCH_VERSION is 1.10 -- Downloading kaldifeat from https://github.com/csukuangfj/kaldifeat/archive/refs/tags/v1.20.tar.gz -- kaldifeat is downloaded to /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src -- kaldifeat's binary dir is /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-build -- The C compiler identification is GNU 8.3.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /opt/rh/devtoolset-8/root/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- C++ Standard version: 14 -- Python executable: /data1/sunty/miniconda3/envs/k2/bin/python3 CMake Warning at /data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:22 (message): static library kineto_LIBRARY-NOTFOUND not found. Call Stack (most recent call first): /data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:127 (append_torchlib_if_found) cmake/torch.cmake:11 (find_package) build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/CMakeLists.txt:55 (include)

-- K2_TORCH_VERSION: 1.10 -- PyTorch version: 1.10.1+cu111 -- PyTorch cuda version: 11.1 -- CMAKE_CXX_FLAGS: -D_GLIBCXX_USE_CXX11_ABI=0 -Wno-unused-variable -Wno-strict-overflow -D_GLIBCXX_USE_CXX11_ABI=0 -- CMAKE_INSTALL_PREFIX: /home/sunty/workspace/k2_env/k2/build/lib.linux-x86_64-cpython-38/k2 -- All headers: /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-common-inl.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-common.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-fbank.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-functions.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-mfcc.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-plp.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-spectrogram.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/feature-window.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/log.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/matrix-functions.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/mel-computations.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/online-feature-itf.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/online-feature.h;/home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38/_deps/kaldifeat-src/kaldifeat/csrc/pitch-functions.h -- Configuring done -- Generating done -- Build files have been written to: /home/sunty/workspace/k2_env/k2/build/temp.linux-x86_64-cpython-38 /**

ifndef K2_CSRC_VERSIONH

define K2_CSRC_VERSIONH

namespace k2 {

// Version of k2 in "major.minor.patch" format static constexpr const char *kVersion = "1.23.4";

// The commit used to build k2 static constexpr const char *kGitSha1 = "0d7ef1a7867f70354ab5c59f2feb98c45558dcc7";

// Date of the commit used to build k2 static constexpr const char *kGitDate = "Sat Mar 18 12:59:04 2023";

// Version of CUDA used to build k2. // Its format is "major.minor", e.g., 10.1 static constexpr const char *kCudaVersion = "11.1";

// cuDNN version, e.g., 8.0.2 static constexpr const char *kCudnnVersion = "8.2.0";

// clang-format off // Version of Python used to build k2 Python bindings. static constexpr const char *kPythonVersion = "3.8";

// clang-format on

// CMake build type, e.g., Release or Debug. static constexpr const char *kBuildType = "Release";

// The operating system that is used to build k2, e.g., Ubuntu 16.04 LTS static constexpr const char *kOS = R"os()os";

// e.g., 3.18.0 static constexpr const char *kCMakeVersion = "3.25.0";

// Version of the compiler, e.g., 5.4.0 static constexpr const char *kGCCVersion = "8.3.1";

// CUDA flags used to compile k2 static constexpr const char *kCMakeCudaFlags = R"cuda_flags( -Wno-deprecated-gpu-targets -lineinfo --expt-extended-lambda -use_fast_math -Xptxas=-w --expt-extended-lambda -gencode arch=compute_86,code=sm_86 -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options -Wall --compiler-options -Wno-strict-overflow --compiler-options -Wno-unknown-pragmas )cuda_flags";

// CXX flags used to compile k2 static constexpr const char *kCMakeCxxFlags = R"cxx_flags( -D_GLIBCXX_USE_CXX11_ABI=0 -Wno-unused-variable -Wno-strict-overflow )cxx_flags";

// Which PyTorch version k2 is using, e.g., 1.6.0+cu101 static constexpr const char *kTorchVersion = "1.10.1+cu111";

// Which CUDA version PyTorch is using, e.g., 10.1 static constexpr const char *kTorchCudaVersion = "11.1";

ifndef K2_WITH_CUDA

define K2_WITH_CUDA

endif

ifdef K2_WITH_CUDA

static constexpr bool kWithCuda = true;

else

static constexpr bool kWithCuda = false;

endif

// Indicate whether NVTX is enabled or not

ifndef K2_ENABLE_NVTX

define K2_ENABLE_NVTX

endif

ifdef K2_ENABLE_NVTX

static constexpr bool kEnableNvtx = true;

else

static constexpr bool kEnableNvtx = false;

endif

} // namespace k2

endif // K2_CSRC_VERSIONH

[ 1%] Building CUDA object k2/csrc/CMakeFiles/k2_log.dir/log.cu.o [ 3%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-fbank.cc.o [ 3%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-functions.cc.o [ 3%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-mfcc.cc.o [ 4%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-plp.cc.o [ 5%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-spectrogram.cc.o [ 6%] Linking CUDA shared library ../../lib/libk2_log.so [ 6%] Built target k2_log [ 6%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/arcsort.cc.o [ 7%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/aux_labels.cc.o [ 8%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/connect.cc.o [ 10%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/determinize.cc.o [ 11%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-window.cc.o [ 12%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/determinize_pruned.cc.o [ 12%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/fsa.cc.o [ 13%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/fsa_equivalent.cc.o [ 14%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/fsa_renderer.cc.o [ 15%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/matrix-functions.cc.o [ 16%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/fsa_util.cc.o [ 16%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/mel-computations.cc.o [ 17%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/online-feature.cc.o [ 17%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/intersect.cc.o [ 18%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/properties.cc.o [ 20%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/rmepsilon_pruned.cc.o [ 21%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/topsort.cc.o [ 21%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/util.cc.o [ 22%] Building CXX object k2/csrc/host/CMakeFiles/fsa.dir/weights.cc.o [ 23%] Linking CXX shared library ../../../lib/libk2fsa.so [ 23%] Built target fsa [ 24%] Building CUDA object k2/csrc/CMakeFiles/context.dir/algorithms.cu.o [ 25%] Building CUDA object k2/csrc/CMakeFiles/context.dir/array_of_ragged.cu.o [ 26%] Building CUDA object k2/csrc/CMakeFiles/context.dir/array_ops.cu.o [ 27%] Building CUDA object k2/csrc/CMakeFiles/context.dir/connect.cu.o [ 27%] Building CUDA object k2/csrc/CMakeFiles/context.dir/context.cu.o [ 28%] Building CUDA object k2/csrc/CMakeFiles/context.dir/dtype.cu.o [ 30%] Building CUDA object k2/csrc/CMakeFiles/context.dir/fsa.cu.o [ 31%] Building CUDA object k2/csrc/CMakeFiles/context.dir/fsa_algo.cu.o [ 31%] Building CUDA object k2/csrc/CMakeFiles/context.dir/fsa_utils.cu.o [ 32%] Linking CXX shared library ../../../../lib/libkaldifeat_core.so [ 33%] Building CUDA object k2/csrc/CMakeFiles/context.dir/hash.cu.o [ 33%] Built target kaldifeat_core [ 33%] Building CXX object k2/torch/csrc/CMakeFiles/k2_fbank.dir/features.cc.o [ 34%] Building CUDA object k2/csrc/CMakeFiles/context.dir/host_shim.cu.o [ 35%] Building CUDA object k2/csrc/CMakeFiles/context.dir/intersect.cu.o [ 35%] Building CUDA object k2/csrc/CMakeFiles/context.dir/intersect_dense.cu.o [ 36%] Building CUDA object k2/csrc/CMakeFiles/context.dir/intersect_dense_pruned.cu.o [ 37%] Linking CXX shared library ../../../lib/libk2_fbank.so [ 37%] Built target k2_fbank [ 38%] Building CUDA object k2/csrc/CMakeFiles/context.dir/math.cu.o [ 40%] Building CUDA object k2/csrc/CMakeFiles/context.dir/moderngpu_allocator.cu.o [ 41%] Building CUDA object k2/csrc/CMakeFiles/context.dir/pinned_context.cu.o [ 41%] Building CUDA object k2/csrc/CMakeFiles/context.dir/ragged.cu.o [ 42%] Building CUDA object k2/csrc/CMakeFiles/context.dir/ragged_ops.cu.o [ 43%] Building CUDA object k2/csrc/CMakeFiles/context.dir/ragged_utils.cu.o [ 44%] Building CUDA object k2/csrc/CMakeFiles/context.dir/rand.cu.o [ 44%] Building CUDA object k2/csrc/CMakeFiles/context.dir/reverse.cu.o [ 45%] Building CUDA object k2/csrc/CMakeFiles/context.dir/rm_epsilon.cu.o [ 46%] Building CUDA object k2/csrc/CMakeFiles/context.dir/rnnt_decode.cu.o [ 47%] Building CUDA object k2/csrc/CMakeFiles/context.dir/tensor.cu.o [ 47%] Building CUDA object k2/csrc/CMakeFiles/context.dir/tensor_ops.cu.o [ 48%] Building CUDA object k2/csrc/CMakeFiles/context.dir/thread_pool.cu.o [ 50%] Building CUDA object k2/csrc/CMakeFiles/context.dir/timer.cu.o [ 51%] Building CUDA object k2/csrc/CMakeFiles/context.dir/top_sort.cu.o [ 52%] Building CUDA object k2/csrc/CMakeFiles/context.dir/torch_util.cu.o [ 52%] Building CUDA object k2/csrc/CMakeFiles/context.dir/utils.cu.o /home/sunty/workspace/k2_env/k2/k2/csrc/ragged_ops_inl.h: In function ‘k2::Renumbering k2::PruneRaggedAxis1(k2::Ragged&, T, int32_t) [with T = double]’: /home/sunty/workspace/k2_env/k2/k2/csrc/ragged_ops_inl.h:870:16: warning: ‘order_map_data’ may be used uninitialized in this function [-Wmaybe-uninitialized] const int32_t *order_map_data; ^~~~~~ [ 53%] Building CUDA object k2/csrc/CMakeFiles/context.dir/nbest.cu.o [ 54%] Building CUDA object k2/csrc/CMakeFiles/context.dir/pytorch_context.cu.o [ 55%] Building CUDA object k2/csrc/CMakeFiles/context.dir/cudpp/cudpp.cu.o [ 55%] Linking CUDA device code CMakeFiles/context.dir/cmake_device_link.o [ 56%] Linking CUDA shared library ../../lib/libk2context.so [ 56%] Built target context [ 56%] Building CUDA object k2/torch/csrc/CMakeFiles/k2_torch.dir/beam_search.cu.o [ 57%] Building CUDA object k2/torch/csrc/CMakeFiles/k2_torch.dir/dense_fsa_vec.cu.o [ 57%] Building CUDA object k2/python/csrc/CMakeFiles/_k2.dir/k2.cu.o [ 57%] Building CUDA object k2/torch/csrc/CMakeFiles/k2_torch.dir/fsa_algo.cu.o [ 58%] Building CUDA object k2/torch/csrc/CMakeFiles/k2_torch.dir/decode.cu.o [ 60%] Building CUDA object k2/torch/csrc/CMakeFiles/k2_torch.dir/deserialization.cu.o /home/sunty/workspace/k2_env/k2/k2/torch/csrc/beam_search.cu: In function ‘std::vector<std::vector, std::allocator<std::vector > > k2::ModifiedBeamSearch(const torch::jit::Module&, const at::Tensor&, const at::Tensor&, int32_t)’: /home/sunty/workspace/k2_env/k2/k2/torch/csrc/beam_search.cu:272:20: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘std::vector::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] if (cur_batch_size < cur.size()) {


/home/sunty/workspace/k2_env/k2/k2/torch/csrc/beam_search.cu:298:23: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘std::vector<k2::Hypothesis>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
     for (int32_t k = 0; k != prev.size(); ++k) {
                     ~~^~~~~~~~~~~~~~
/home/sunty/workspace/k2_env/k2/k2/torch/csrc/deserialization.cu: In function ‘void k2::_GLOBAL__N__50_tmpxft_00007637_00000000_7_deserialization_cpp1_ii_4aae5ec1::restoreAccurateTypeTags(const c10::IValue&, const TypePtr&)’:
/home/sunty/workspace/k2_env/k2/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘StorageType’ not handled in switch [-Wswitch]
     switch (w.static_type->kind()) {
        ^
/home/sunty/workspace/k2_env/k2/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘ComplexType’ not handled in switch [-Wswitch]
/home/sunty/workspace/k2_env/k2/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘StreamObjType’ not handled in switch [-Wswitch]
/home/sunty/workspace/k2_env/k2/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘UnionType’ not handled in switch [-Wswitch]
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree_views.h: In instantiation of ‘static torch::jit::Maybe<T> torch::jit::Maybe<T>::create(const torch::jit::SourceRange&, const T&) [with T = torch::jit::List<torch::jit::Property>]’:
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree_views.h:502:135:   required from here
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree_views.h:220:33: error: no matching function for call to ‘torch::jit::Compound::create(torch::jit::TokenKind, const torch::jit::SourceRange&, const torch::jit::List<torch::jit::Property>&)’
     return Maybe<T>(Compound::create(TK_OPTION, range, {value}));
                ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree.h:142:16: note: candidate: ‘static torch::jit::TreeRef torch::jit::Compound::create(int, const torch::jit::SourceRange&, torch::jit::TreeList&&)’
   static TreeRef create(
                ^~~~~~
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree.h:142:16: note:   no known conversion for argument 3 from ‘const torch::jit::List<torch::jit::Property>’ to ‘torch::jit::TreeList&&’ {aka ‘c10::SmallVector<c10::intrusive_ptr<torch::jit::Tree>, 4>&&’}
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree_views.h: In instantiation of ‘static torch::jit::Maybe<T> torch::jit::Maybe<T>::create(const torch::jit::SourceRange&, const T&) [with T = torch::jit::List<torch::jit::Assign>]’:
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree_views.h:502:186:   required from here
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree_views.h:220:33: error: no matching function for call to ‘torch::jit::Compound::create(torch::jit::TokenKind, const torch::jit::SourceRange&, const torch::jit::List<torch::jit::Assign>&)’
     return Maybe<T>(Compound::create(TK_OPTION, range, {value}));
                ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree.h:142:16: note: candidate: ‘static torch::jit::TreeRef torch::jit::Compound::create(int, const torch::jit::SourceRange&, torch::jit::TreeList&&)’
   static TreeRef create(
                ^~~~~~
/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree.h:142:16: note:   no known conversion for argument 3 from ‘const torch::jit::List<torch::jit::Assign>’ to ‘torch::jit::TreeList&&’ {aka ‘c10::SmallVector<c10::intrusive_ptr<torch::jit::Tree>, 4>&&’}
[ 61%] Building CUDA object k2/torch/csrc/CMakeFiles/k2_torch.dir/fsa_class.cu.o
make[2]: *** [k2/torch/csrc/CMakeFiles/k2_torch.dir/deserialization.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 62%] Building CUDA object k2/python/csrc/CMakeFiles/_k2.dir/torch.cu.o
[ 63%] Building CUDA object k2/python/csrc/CMakeFiles/_k2.dir/version.cu.o
[ 64%] Building CUDA object k2/python/csrc/CMakeFiles/_k2.dir/torch/arc.cu.o
[ 64%] Building CUDA object k2/python/csrc/CMakeFiles/_k2.dir/torch/fsa.cu.o
[ 65%] Building CUDA object k2/python/csrc/CMakeFiles/_k2.dir/torch/fsa_algo.cu.o
[ 66%] Building CUDA object k2/python/csrc/CMakeFiles/_k2.dir/torch/index_add.cu.o
make[1]: *** [k2/torch/csrc/CMakeFiles/k2_torch.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
csukuangfj commented 1 year ago

There are several solutions:

  1. Comment out the code that is causing errors.

  2. Switch to another version of CUDA or PyTorch. For instance, PyTorch 10.1 + CUDA 10.2, or PyTorch 1.13.0 + CUDA 11.7

xIaott-s commented 1 year ago

There are several solutions:

  1. Comment out the code that is causing errors.
  2. Switch to another version of CUDA or PyTorch. For instance, PyTorch 10.1 + CUDA 10.2, or PyTorch 1.13.0 + CUDA 11.7

solution 1 works for me, thx a lot.

cantabile-kwok commented 1 year ago

@sty1992928 Sorry to bother on this issue, but may I ask how did you "comment out the code that is causing errors"? I am experiencing exactly the same issue.

xIaott-s commented 1 year ago

@cantabile-kwok, in my case, just comment out this function "/data1/sunty/miniconda3/envs/k2/lib/python3.8/site-packages/torch/include/torch/csrc/jit/frontend/tree_views.h:220". You should find the information from your building log.

cantabile-kwok commented 1 year ago

@sty1992928 Thank you for the instruction and now I found the function, it is

static Maybe<T> create(const SourceRange& range, const T& value) {
    return Maybe<T>(Compound::create(TK_OPTION, range, {value}));                                               
  } 

right?

But after commenting out this function, it seems another error will be caused at tree_views.h line 508 and 509:

Maybe<List<Property>>::create(range, properties),
Maybe<List<Assign>>::create(range, assigns)}));

where the commented function is being called. As it is commented, another function with the same name will be called but the arguments don't match. This produces the error message:

/mnt/lustre/xxx/home/ywg12/.conda/envs/a10/lib/python3.6/site-packages/torch/include/torch/csrc/jit/frontend/tree$
views.h(508): error: too many arguments in function call

/mnt/lustre/xxx/home/ywg12/.conda/envs/a10/lib/python3.6/site-packages/torch/include/torch/csrc/jit/frontend/tree$
views.h(509): error: too many arguments in function call

May I ask have you encountered this problem after commenting out that function?

cantabile-kwok commented 1 year ago

Oh, I magically found changing line 508 and 509 to Maybe<List<Property>>::create(range), and Maybe<List<Assign>>::create(range)})); solves the problem. Now k2 is installed successfully and can be run with no bugs.