PY-NUMB0007 · device_wide_numba_synchronization_in_stream_scope
Count device-wide Numba synchronization in modules that create streams.
This is a deterministic rule for python. Read its implementation.
Definition
Section titled “Definition”Report cuda.synchronize() in a module that creates a Numba CUDA stream. The call waits for
all work on the device, including independent work on other streams. Synchronize the stream or
an event that represents the actual dependency instead.
Evidence
Section titled “Evidence”Each finding identifies the device-wide wait. The value is the number of global Numba waits in modules that otherwise use streams.
Exceptions
Section titled “Exceptions”An explicit benchmark boundary or process shutdown may need a device-wide wait. Retain such a call only with a project waiver that states the measured boundary.
Examples
Section titled “Examples”stream = cuda.stream()cuda.synchronize()stream = cuda.stream()stream.synchronize()References
Section titled “References”- Cites “Numba CUDA documentation”, CUDA Kernel API and synchronization. Open reference
- Cites “CUDA C++ Programming Guide”, explicit synchronization. Open reference