-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Fix compile error in distance benchmark #596
[FIX] Fix compile error in distance benchmark #596
Conversation
Did this not get caught by CI because we are not building benchmarks by default in CI? I was going to look at that today, coincidentally. The old version of the code looks correct to me -- where did this fail? It doesn't fail locally for me or @isVoid . |
Given that all benchmarks compiled successfully in #597 this change is suspicious. Is this perhaps a compiler bug on a new system (Hopper)? |
Nope, I encountered this just attempting to build benchmarks with GCC 9.4 and CUDA 11.6.2 in rapids-compose. |
Here's the full error: $ gcc --version && g++ --version && nvcc --version
gcc (conda-forge gcc 9.4.0-16) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ (conda-forge gcc 9.4.0-16) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_Mar__8_18:18:20_PST_2022
Cuda compilation tools, release 11.6, V11.6.124
Build cuda_11.6.r11.6/compiler.31057947_0
FAILED: benchmarks/CMakeFiles/DISTANCES_BENCH.dir/pairwise_linestring_distance.cu.o
/usr/local/bin/nvcc -forward-unknown-to-host-compiler -DCUDF_VERSION=22.08.00 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DJITIFY_USE_CACHE -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -I/home/ptaylor/dev/rapids/cuspatial/cpp/benchmarks -I/home/ptaylor/dev/rapids/cuspatial/cpp -I/home/ptaylor/dev/rapids/cuspatial/cpp/src -I/home/ptaylor/dev/rapids/cuspatial/cpp/build/cuda-11.6.2/fea-drop-glue-code/release/_deps/benchmark-src/src/../include -I/home/ptaylor/dev/rapids/cudf/cpp/build/cuda-11.6.2/branch-22.08/release/_deps/libcudacxx-src/include -I/home/ptaylor/dev/rapids/cudf/cpp/build/cuda-11.6.2/branch-22.08/release/_deps/thrust-src -I/home/ptaylor/dev/rapids/cudf/cpp/build/cuda-11.6.2/branch-22.08/release/_deps/thrust-src/dependencies/cub -I/home/ptaylor/dev/rapids/cuspatial/cpp/include -I/home/ptaylor/dev/rapids/cuspatial/cpp/build/cuda-11.6.2/fea-drop-glue-code/release/_deps/nvbench-src -I/home/ptaylor/dev/rapids/cuspatial/cpp/build/cuda-11.6.2/fea-drop-glue-code/release/_deps/nvbench-build -isystem=/home/ptaylor/dev/rapids/cudf/cpp -isystem=/home/ptaylor/dev/rapids/cudf/cpp/src -isystem=/home/ptaylor/dev/rapids/compose/etc/conda/cuda_11.6/envs/rapids/include -isystem=/home/ptaylor/dev/rapids/cudf/cpp/build/cuda-11.6.2/branch-22.08/release/_deps/dlpack-src/include -isystem=/home/ptaylor/dev/rapids/cudf/cpp/build/cuda-11.6.2/branch-22.08/release/_deps/jitify-src -isystem=/home/ptaylor/dev/rapids/cudf/cpp/include -isystem=/home/ptaylor/dev/rapids/cudf/cpp/build/cuda-11.6.2/branch-22.08/release/include -isystem=/home/ptaylor/dev/rapids/rmm/include -isystem=/usr/local/cuda/include -Xcompiler=-fdiagnostics-color=always -Xcompiler=-Wno-deprecated-declarations -O3 -DNDEBUG --generate-code=arch=compute_75,code=[sm_75] -Xcompiler=-fPIE -Xcompiler=-Wno-parentheses --expt-extended-lambda --expt-relaxed-constexpr -Werror=all-warnings -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations -Xfatbin=-compress-all -Xcompiler=-Wno-deprecated-declarations -Werror=cross-execution-space-call -Xcompiler -pthread -std=c++17 -MD -MT benchmarks/CMakeFiles/DISTANCES_BENCH.dir/pairwise_linestring_distance.cu.o -MF benchmarks/CMakeFiles/DISTANCES_BENCH.dir/pairwise_linestring_distance.cu.o.d -x cu -c /home/ptaylor/dev/rapids/cuspatial/cpp/benchmarks/pairwise_linestring_distance.cu -o benchmarks/CMakeFiles/DISTANCES_BENCH.dir/pairwise_linestring_distance.cu.o
/home/ptaylor/dev/rapids/cuspatial/cpp/benchmarks/pairwise_linestring_distance.cu(80): error: too many initializer values
detected during:
instantiation of "std::tuple<rmm::device_vector<cuspatial::cartesian_2d<T>>, rmm::device_vector<int32_t>> generate_linestring(int32_t, int32_t, T, cuspatial::cartesian_2d<T>) [with T=float]"
(100): here
instantiation of "void pairwise_linestring_distance_benchmark(nvbench::state &, nvbench::type_list<T>) [with T=float]"
(140): here
instantiation of "void pairwise_linestring_distance_benchmark_line_140::operator()(nvbench::state &, nvbench::type_list<Ts...>) [with Ts=<float>]"
_deps/nvbench-src/nvbench/detail/type_list_impl.cuh(100): here
instantiation of "void nvbench::tl::detail::foreach<TypeList,Functor,Is...>(std::index_sequence<Is...>, Functor &&) [with TypeList=nvbench::type_list<nvbench::type_list<float>, nvbench::type_list<double>>, Functor=lambda [](auto)->auto, Is=<0UL, 1UL>]"
_deps/nvbench-src/nvbench/detail/type_list_impl.cuh(109): here
instantiation of "void nvbench::tl::detail::foreach<TypeList,Functor>(Functor &&) [with TypeList=nvbench::type_list<nvbench::type_list<float>, nvbench::type_list<double>>, Functor=lambda [](auto)->auto]"
_deps/nvbench-src/nvbench/type_list.cuh(140): here
[ 3 instantiation contexts not shown ]
instantiation of "void nvbench::benchmark<KernelGenerator, TypeAxes>::do_run() [with KernelGenerator=pairwise_linestring_distance_benchmark_line_140, TypeAxes=nvbench::type_list<floating_point_types>]"
_deps/nvbench-src/nvbench/benchmark.cuh(65): here
implicit generation of "nvbench::benchmark<KernelGenerator, TypeAxes>::~benchmark() noexcept [with KernelGenerator=pairwise_linestring_distance_benchmark_line_140, TypeAxes=nvbench::type_list<floating_point_types>]"
_deps/nvbench-src/nvbench/benchmark.cuh(65): here
instantiation of class "nvbench::benchmark<KernelGenerator, TypeAxes> [with KernelGenerator=pairwise_linestring_distance_benchmark_line_140, TypeAxes=nvbench::type_list<floating_point_types>]"
_deps/nvbench-src/nvbench/benchmark.cuh(65): here
instantiation of "nvbench::benchmark<KernelGenerator, TypeAxes>::benchmark() [with KernelGenerator=pairwise_linestring_distance_benchmark_line_140, TypeAxes=nvbench::type_list<floating_point_types>]"
/home/ptaylor/dev/rapids/compose/etc/conda/cuda_11.6/envs/rapids/x86_64-conda-linux-gnu/include/c++/9.4.0/bits/unique_ptr.h(857): here
instantiation of "std::_MakeUniq<_Tp>::__single_object std::make_unique<_Tp,_Args...>(_Args &&...) [with _Tp=nvbench::benchmark<pairwise_linestring_distance_benchmark_line_140, nvbench::type_list<floating_point_types>>, _Args=<>]"
(140): here
1 error detected in the compilation of "/home/ptaylor/dev/rapids/cuspatial/cpp/benchmarks/pairwise_linestring_distance.cu".
|
Hmmm, I think the original code should work -- it's initializing the two elements using an implicitly generated constructor. Your change forces it to use a different implicitly generated constructor (initializer list constructor?) |
I had the same error, @trxcllnt just now building cuspatial from |
The alternative is to add a constructor to |
bdc5c8d
to
567cd00
Compare
@jrhemstad that didn't work for me, but I pushed a new fix that does seem to be working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we really want is just return prev + segment_length * rad;
what if you change the auto const&
parameters to explicit cartesian_2d<T>
.
567cd00
to
64465c9
Compare
@gpucibot merge |
@gpucibot merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original seems to work on the latest ToT NVCC so the bug may be already fixed. In any case, this workaround is not as offensive so approving.
This PR fixes the following compile error: