Repository navigation
Commit 60715ad
authored
By default `cuml.accel` enables a `ManagedMemoryResource`, which allocates managed memory. While benchmarking some workloads, I've noticed a measurable performance improvement when wrapping this mr with a `PrefetchResourceAdaptor`. This adaptor schedules a prefetch of memory to the device immediately after allocation. For `cuml`/`cuml.accel` workloads this makes sense - we typically allocate an array, then call a kernel to fill it in, before returning it. This also matches some performance advice noted by other teams (and the official CUDA programming guide) that prefetching may be useful when working with managed memory.
This also more closely matches the rmm configuration used by `cudf.pandas` by default (see [here](https://github.com/rapidsai/cudf/blob/dd03be22ab12195be28ed4f4338c26f589485c90/python/cudf/cudf/pandas/__init__.py#L87-L97)). Note that `cudf.pandas` also uses a `PoolMemoryResource` by default, but always enables prefetching of managed memory even without the pool. My intuition is that pooling makes sense when you have many smaller allocations (like might happen with pandas), since it can amortize the upstream allocator cost across calls. cuml workloads typically do fewer and larger allocations, so I don't think investigating pooling is necessary for now.
Fixes #7846.
Authors:
- Jim Crist-Harif (https://github.com/jcrist)
Approvers:
- Divye Gala (https://github.com/divyegala)
URL: #7834
1 parent ea5f72b commit 60715ad
2 files changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
| |||
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
199 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
200 | 210 | | |
201 | 211 | | |
202 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
0 commit comments