Commit 995fe0a
authored
Closes [#2049](NVIDIA/cuvs#2049)
`raft::matrix::detail::sortColumnsPerRow` passed `n_rows + 1` to [cub as `num_segments`](https://github.com/NVIDIA/cccl/blob/01b00d00edff5e5ed01fa4921ed9a5ad703c3219/cub/cub/device/device_segmented_radix_sort.cuh#L217). Per the cub contract, an aliased CSR offsets array must have length `num_segments + 1`, so cub read one int past the offsets allocation. This crashes with `cudaErrorIllegalAddress` when `n_rows + 1` is a power of two ≥ 64 and `n_columns ≥ ~16384` (silent otherwise).
Surfaces in `cuvs::stats::trustworthiness_score` whenever `n % batch_size ∈ {63, 127, 255, …}` (e.g. `n=76927, batch_size=512`).
Fix : pass `n_rows` to cub; size the offsets array as `n_rows + 1`.
Authors:
- Victor Lafargue (https://github.com/viclafargue)
- Corey J. Nolet (https://github.com/cjnolet)
Approvers:
- Divye Gala (https://github.com/divyegala)
- Corey J. Nolet (https://github.com/cjnolet)
- Tarang Jain (https://github.com/tarang-jain)
URL: #3010
1 parent 2f724f5 commit 995fe0a
1 file changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
| |||
248 | 253 | | |
249 | 254 | | |
250 | 255 | | |
251 | | - | |
252 | | - | |
| 256 | + | |
| 257 | + | |
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
| |||
264 | 269 | | |
265 | 270 | | |
266 | 271 | | |
267 | | - | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
272 | 277 | | |
273 | 278 | | |
274 | | - | |
| 279 | + | |
275 | 280 | | |
276 | 281 | | |
277 | 282 | | |
| |||
0 commit comments