Skip to content

PY-NUMB0006 · default_stream_numba_kernel_launch

Count Numba kernel launches that omit a stream where streams exist.

This is a deterministic rule for python. Read its implementation.

Report a Numba dispatcher launch whose configuration supplies only grid and block in a Python module that creates a CUDA stream. Numba’s third launch item is the stream, so omitting it sends the kernel to the default stream and can serialize otherwise concurrent work.

Each finding identifies the launch and owning function. The value is the number of launches with fewer than three top-level configuration items in a stream-using module.

A module that creates no stream has no local overlap to drain. An explicit third configuration item is accepted. Nested tuples used for multidimensional grids count as one item because the syntax tree retains the top-level configuration shape.

stream = cuda.stream()
scale[grid, block](values)
stream = cuda.stream()
scale[grid, block, stream](values)
  • Cites “Numba CUDA documentation”, CUDA Kernel API and launch configuration. Open reference
  • Cites “CUDA C++ Programming Guide”, default stream behavior. Open reference