Closed videodanchik closed 8 months ago
Please try #1249
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
2) 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.
| ^~~
Please change https://github.com/k2-fsa/k2/blob/44a9d5682af9fd3ef77074777e15278ec6d390eb/CMakeLists.txt#L201 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.
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!
Closing via #1249
You can find a list of pre-built wheels at
I'm building k2 from source with Cuda installed but without GPU attached to the work instance (pure CPU), this enforces k2 build binaries for all possible GPU architectures starting from
compute_35
and tillcompute_90
. So I have installedCuda 12.1
along withPyTorch 2.1.0+cu121
on Ubuntu 22.04 and run:Here is my environment:
And here is my error:
Basically there are 2 issues here:
I think this is related to the fact that Cuda 12.1 doesn't support
compute_35
anymore (see here).And the main error itself most probably related to https://github.com/pytorch/pytorch/pull/100557.