Skip to content

[BUG]: Many cuco functions incorrectly marked as noexcept #510

@wence-

Description

@wence-

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions