r"""Specifies how to pre-allocate from raw device allocator. Args: alignment: specifies the alignment in bytes. min_req: min request size in bytes. max_overhead: max overhead above required size in bytes. growth_factor: request size / cur allocated` devic
(
alignment: int = 1,
min_req: int = 32 * 1024 * 1024,
max_overhead: int = 0,
growth_factor=2.0,
device_type=DeviceType.CUDA,
)
| 258 | |
| 259 | |
| 260 | def set_prealloc_config( |
| 261 | alignment: int = 1, |
| 262 | min_req: int = 32 * 1024 * 1024, |
| 263 | max_overhead: int = 0, |
| 264 | growth_factor=2.0, |
| 265 | device_type=DeviceType.CUDA, |
| 266 | ): |
| 267 | r"""Specifies how to pre-allocate from raw device allocator. |
| 268 | |
| 269 | Args: |
| 270 | alignment: specifies the alignment in bytes. |
| 271 | min_req: min request size in bytes. |
| 272 | max_overhead: max overhead above required size in bytes. |
| 273 | growth_factor: request size / cur allocated` |
| 274 | device_type: the device type |
| 275 | alignment: int: |
| 276 | min_req: int: |
| 277 | max_overhead: int: |
| 278 | """ |
| 279 | assert alignment > 0 |
| 280 | assert min_req > 0 |
| 281 | assert max_overhead >= 0 |
| 282 | assert growth_factor >= 1 |
| 283 | _set_prealloc_config(alignment, min_req, max_overhead, growth_factor, device_type) |
| 284 | |
| 285 | |
| 286 | def what_is_xpu(): |
no outgoing calls