|
9 | 9 | New features |
10 | 10 | ------------ |
11 | 11 |
|
12 | | -- Added :func:`utils.copy_batch`, which submits many buffer-to-buffer copies |
13 | | - in a single ``cuMemcpyBatchAsync`` call. Per-copy behavior is controlled |
14 | | - by the new :class:`utils.CopyOptions` dataclass. Requires ``cuda.core`` |
15 | | - built against CUDA 13, ``cuda.bindings`` 13.0+, and a driver reporting |
16 | | - CUDA 13.0 or newer; otherwise falls back to a per-copy ``cuMemcpyAsync`` |
17 | | - loop. On that fallback, ``src_access_order`` values of ``STREAM`` and |
18 | | - ``ANY`` are silently ignored (stream-ordered access already satisfies |
19 | | - both), while ``DURING_API_CALL`` raises ``RuntimeError`` instead of |
20 | | - silently downgrading its stronger guarantee. Graph capture and |
21 | | - ``LEGACY_DEFAULT_STREAM`` are rejected (``PER_THREAD_DEFAULT_STREAM`` is |
22 | | - accepted). Copies within a batch must not alias. |
23 | | - (`#1333 <https://github.com/NVIDIA/cuda-python/issues/1333>`__) |
24 | | - |
25 | | -- :meth:`Buffer.copy_to` and :meth:`Buffer.copy_from` now accept an optional |
26 | | - ``options`` keyword argument (:class:`~utils.CopyOptions`), submitted via |
27 | | - ``cuMemcpyWithAttributesAsync``. Matching :func:`utils.copy_batch`, passing |
28 | | - ``options`` together with ``LEGACY_DEFAULT_STREAM`` or a capturing stream |
29 | | - raises ``TypeError`` (``PER_THREAD_DEFAULT_STREAM`` is accepted). On |
30 | | - ``cuda.bindings``/driver older than CUDA 13.2, ``src_access_order`` values |
31 | | - of ``STREAM`` and ``ANY`` fall back to ``cuMemcpyAsync`` silently, while |
32 | | - ``DURING_API_CALL`` raises ``RuntimeError`` instead of silently |
33 | | - downgrading its stronger guarantee. |
34 | | - (`#2365 <https://github.com/NVIDIA/cuda-python/issues/2365>`__) |
| 12 | +- Added :class:`utils.CopyOptions` (source access order, location hints, |
| 13 | + overlap mode) for buffer-to-buffer copies. The new |
| 14 | + :func:`utils.copy_batch` accepts it and submits many copies in a single |
| 15 | + ``cuMemcpyBatchAsync`` call, requiring ``cuda.core`` built against CUDA 13 |
| 16 | + plus ``cuda.bindings``/driver 13.0 or newer. :meth:`Buffer.copy_to` and |
| 17 | + :meth:`Buffer.copy_from` also accept it now, as a new ``options`` keyword, |
| 18 | + submitting a single copy via ``cuMemcpyWithAttributesAsync`` and requiring |
| 19 | + ``cuda.bindings``/driver 13.2 or newer. Both reject |
| 20 | + ``LEGACY_DEFAULT_STREAM`` with ``TypeError`` (``PER_THREAD_DEFAULT_STREAM`` |
| 21 | + is accepted); ``copy_batch`` always rejects graph capture, while |
| 22 | + ``Buffer.copy_to``/``copy_from`` reject it only when ``options`` is given. |
| 23 | + On an older ``cuda.bindings``/driver install, ``src_access_order`` values |
| 24 | + of ``STREAM`` and ``ANY`` silently fall back to plain ``cuMemcpyAsync``; |
| 25 | + ``DURING_API_CALL`` raises ``RuntimeError`` instead, since that fallback |
| 26 | + cannot honor its guarantee that all source reads complete before the call |
| 27 | + returns. Copies within a ``copy_batch`` call must not alias. |
| 28 | + (`#1333 <https://github.com/NVIDIA/cuda-python/issues/1333>`__, |
| 29 | + `#2365 <https://github.com/NVIDIA/cuda-python/issues/2365>`__) |
35 | 30 |
|
36 | 31 | Fixes and enhancements |
37 | 32 | ---------------------- |
|
0 commit comments