Is this a duplicate?
Type of Bug
Runtime Error
Describe the bug
Many cuco functions, both ctors and methods, are incorrectly marked as noexcept, despite them making calls into the cuda runtime that might potentially fail.
Some (non-exhaustive) examples:
aow_storage::initialize, calls cuda_stream_ref::synchronize which might throw
aow_storage ctor, allocates memory which might throw
open_addressing_impl ctor, allocates memory which might throw
open_addressing_impl::size calls a kernel and syncs the stream which might throw
open_addressing_impl::initialize calls aow_storage::initialize and therefore transitively might throw
distinct_count_estimator::add_async is marked as noexcept, but the impl class's method (hyperloglog::add_async) is not noexcept, and indeed might throw since it launches kernels and calls CUCO_CUDA_TRY(cudaLaunchKernel(...)).
static_map::clear is marked noexcept, but open_addressing_impl::clear calls aow_storage::initialize and therefore transitively might throw
How to Reproduce
Try and construct a static set requiring more storage than there is device memory (or perhaps using RMM with a limited memory resource). RMM will throw a subclass of std::bad_alloc but we will not be able to catch it with:
try {
make_cuco_static_set(...);
} catch (...) {
// expect to get here
}
and instead the program will abort.
Expected behavior
It should be possible to catch exceptions thrown inside cuco functions.
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
Is this a duplicate?
Type of Bug
Runtime Error
Describe the bug
Many cuco functions, both ctors and methods, are incorrectly marked as
noexcept, despite them making calls into the cuda runtime that might potentially fail.Some (non-exhaustive) examples:
aow_storage::initialize, callscuda_stream_ref::synchronizewhich might throwaow_storagector, allocates memory which might throwopen_addressing_implctor, allocates memory which might throwopen_addressing_impl::sizecalls a kernel and syncs the stream which might throwopen_addressing_impl::initializecallsaow_storage::initializeand therefore transitively might throwdistinct_count_estimator::add_asyncis marked asnoexcept, but the impl class's method (hyperloglog::add_async) is notnoexcept, and indeed might throw since it launches kernels and callsCUCO_CUDA_TRY(cudaLaunchKernel(...)).static_map::clearis marked noexcept, butopen_addressing_impl::clearcallsaow_storage::initializeand therefore transitively might throwHow to Reproduce
Try and construct a static set requiring more storage than there is device memory (or perhaps using RMM with a limited memory resource). RMM will throw a subclass of
std::bad_allocbut we will not be able to catch it with:and instead the program will abort.
Expected behavior
It should be possible to catch exceptions thrown inside cuco functions.
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response