Repository navigation
numr 0.11.0
GPU scatter_reduce is deterministic and bit-equal to the CPU, and the CUDA client works from any thread.
Fixed
- CUDA and WebGPU
scatter_reduce— float results no longer change from run to run.- Contributions are grouped by destination with a stable radix sort. Each destination then folds its run in source order, the order the CPU kernel uses.
- F32 and F64 results on CUDA, and F32 results on WebGPU, are bit-equal to the CPU reference for every op: sum, prod, max, min and mean.
- No float accumulates through an atomic. Before, an overlap-add (an inverse STFT) gave different low bits on each run.
- WebGPU mean rounds exactly as the CPU does:
f32(f64(acc) / count).
scatter_reduceshapes — a source shorter than the destination on an axis other thandimgives the right result on CUDA and WebGPU, which assumed equal shapes. A source longer than the destination on such an axis returns an error on every backend. The CPU path wrote out of bounds.- CUDA client on any thread — a
CudaClientworks from a thread that did not create it, with no bind by the caller.- Every direct driver call makes the client's context current on the calling thread first. This covers the allocator, the copies, events, the Sobol cache,
CudaDevice::sync,CudaDevice::memory_infoand the NCCL communicator. - Before,
record_event,record_event_on_compute,syncandmemory_infofailed withCUDA_ERROR_INVALID_CONTEXTon a fresh thread. On a thread where another device's context was current, they acted on that device.
- Every direct driver call makes the client's context current on the calling thread first. This covers the allocator, the copies, events, the Sobol cache,
- CUDA scalar readbacks — histogram,
logm,sqrtm,signmand the scan totals read on the compute stream and return copy errors.- Histogram,
logm,sqrtmandsignmread after the kernels that produce the value. Before, the read raced those kernels. - F32 inputs to
logm,sqrtmandsignmread their scalars as F32. Before, each read took eight bytes as one F64.
- Histogram,
- CUDA copy and allocation errors — a device-to-host copy returns an error when the stream synchronize fails. An allocation error other than out-of-memory keeps its driver code instead of reading as
OutOfMemory.
Changed
-
GuardedStream::enqueue_permitreturnsResult<EnqueuePermit, DriverError>. It makes the stream's context current before it takes the capture lock. -
Integer
scatter_reduceon CUDA and WebGPU — integers go through the same sorted pipeline. The old CUDA integer path scanned every source element per destination. -
WebGPU
scatter_reducelimits — a call errors withBackendLimitationwhen the sort scratch exceeds the device's storage-binding limit, or the shape holds more than 8 axes after merging aligned ones.
Full diff: v0.10.0...v0.11.0