Git Product home page Git Product logo

Comments (5)

csukuangfj avatar csukuangfj commented on August 22, 2024 2

Please change

set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ version to be used.")

to

 set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ version to be used.") 

and delete your build directory and retry.


Note I was using set(CMAKE_CXX_STANDARD 14) in the PR.

from k2.

csukuangfj avatar csukuangfj commented on August 22, 2024

Please try #1249

from k2.

videodanchik avatar videodanchik commented on August 22, 2024

Hi @csukuangfj, thanks for quick reply, but I'm still experiencing issues:

  1. I see this warning:
/home/videodanchik/k2_builds/k2_gpu/k2/csrc/intersect.cu(889): warning #177-D: variable "num_threads" was declared but never referenced
                num_threads = g.size();
                ^

Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"

Probably the variable can be removed

  1. The error happens later now:
[ 48%] Building CUDA object k2/csrc/CMakeFiles/context.dir/timer.cu.o
[ 49%] Building CUDA object k2/csrc/CMakeFiles/context.dir/top_sort.cu.o
[ 50%] Building CUDA object k2/csrc/CMakeFiles/context.dir/torch_util.cu.o
In file included from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/pytorch_context.h:26,
                 from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/torch_util.h:30,
                 from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/torch_util.cu:23:
/home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4:2: error: #error C++17 or later compatible compiler is required to use PyTorch.
    4 | #error C++17 or later compatible compiler is required to use PyTorch.
      |  ^~~
In file included from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/c10/util/string_view.h:4,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/c10/util/StringUtil.h:6,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/c10/util/Exception.h:5,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/c10/core/Device.h:5,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/ATen/core/TensorBody.h:11,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/ATen/core/Tensor.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/ATen/Tensor.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
                 from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/pytorch_context.h:26,
                 from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/torch_util.h:30,
                 from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/torch_util.cu:23:
/home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/c10/util/C++17.h:27:2: error: #error You need C++17 to compile PyTorch
   27 | #error You need C++17 to compile PyTorch
      |  ^
In file included from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:4,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/all.h:9,
                 from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/pytorch_context.h:26,
                 from /home/videodanchik
/k2_builds/k2_gpu/k2/csrc/torch_util.h:30,
                 from /home/videodanchik/k2_builds/k2_gpu/k2/csrc/torch_util.cu:23:
/home/videodanchik/envs/py311/.venv/lib/python3.11/site-packages/torch/include/ATen/ATen.h:4:2: error: #error C++17 or later compatible compiler is required to use ATen.
    4 | #error C++17 or later compatible compiler is required to use ATen.
      |  ^~~

from k2.

videodanchik avatar videodanchik commented on August 22, 2024

Thanks @csukuangfj, now the build went without any problem, except few warnings like this:

/home/videodanchik/k2_builds/k2_gpu/k2/csrc/intersect.cu(889): warning #177-D: variable "num_threads" was declared but never referenced
                num_threads = g.size();
                ^
Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/wave_reader.cu(61): warning #177-D: variable "p" was declared but never referenced
        const char *p = reinterpret_cast<const char *>(&subchunk2_id);
                    ^

Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/beam_search.cu: In function ‘std::vector<std::vector<int>, std::allocator<std::vector<int> > > k2::ModifiedBeamSearch(const torch::jit::Module&, const at::Tensor&, const at::Tensor&, int32_t)’:
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/beam_search.cu:272:20: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘std::vector<k2::Hypotheses>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  272 |     if (cur_batch_size < cur.size()) {
      |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~
/home/videodanchik/k2_builds/k2_gpu/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]
  298 |     for (int32_t k = 0; k != prev.size(); ++k) {
      |                     ^~~~~~~~~~~~
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu: In function ‘void k2::_GLOBAL__N__f882773b_18_deserialization_cu_4aae5ec1::restoreAccurateTypeTags(const c10::IValue&, const TypePtr&)’:
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘StorageType’ not handled in switch [-Wswitch]
  101 |     switch (w.static_type->kind()) {
      |        ^
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘ComplexType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘AwaitType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘StreamObjType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘MemoryFormatType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘SymIntType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘SymFloatType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘SymBoolType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘UnionType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/csrc/deserialization.cu:101:8: warning: enumeration value ‘DynamicType’ not handled in switch [-Wswitch]
/home/videodanchik/k2_builds/k2_gpu/k2/torch/bin/attention_rescore.cu: In function ‘int main(int, char**)’:
/home/videodanchik/k2_builds/k2_gpu/k2/torch/bin/attention_rescore.cu:288:17: warning: loop variable ‘tids’ creates a copy from type ‘const std::vector<int>’ [-Wrange-loop-construct]
  288 |   for (const auto tids : token_ids) {
      |                 ^~~~
/home/videodanchik/k2_builds/k2_gpu/k2/torch/bin/attention_rescore.cu:288:17: note: use reference type to prevent copying
  288 |   for (const auto tids : token_ids) {
      |                 ^~~~
      |                 &

Thanks for help!

from k2.

csukuangfj avatar csukuangfj commented on August 22, 2024

Closing via #1249

You can find a list of pre-built wheels at

from k2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.