Skip to content

Commit

Permalink
clean up: sep lines and remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Oct 7, 2024
1 parent 396b816 commit 9405162
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/cudf/source/cudf_pandas/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ There are a few known limitations that you should be aware of:
arr = pd.Series([1, 1, 2]).unique() # returns a proxy array
isinstance(arr, np.ndarray) # returns True, where arr is a proxy array
```
Because the proxy type ducktypes as a NumPy array, NumPy functions may attempt to access internal members, such as the [data buffer](https://numpy.org/doc/stable/dev/internals.html#internal-organization-of-numpy-arrays), via the NumPy C API. However, our proxy mechanism is designed to proxy function calls at the Python level, which is incompatible with these types of accesses. To handle these situations, we perform an eager device-to-host (DtoH) copy, which sets the data buffer correctly but incurs the cost of extra time when creating the proxy array. In the previous example, creating `arr` performed this kind of implicit DtoH transfer.
Because the proxy type ducktypes as a NumPy array, NumPy functions may attempt to
access internal members, such as the [data buffer](https://numpy.org/doc/stable/dev/internals.html#internal-organization-of-numpy-arrays), via the NumPy C API.
However, our proxy mechanism is designed to proxy function calls at the Python
level, which is incompatible with these types of accesses. To handle these
situations, we perform an eager device-to-host (DtoH) copy, which sets the data
buffer correctly but incurs the cost of extra time when creating the proxy array.
In the previous example, creating `arr` performed this kind of implicit DtoH transfer.

With this approach, we also get compatibility with third party libraries like `torch`.

Expand Down
1 change: 0 additions & 1 deletion python/cudf/cudf/_lib/string_casting.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ from cudf._lib.scalar import as_device_scalar
from cudf._lib.types import SUPPORTED_NUMPY_TO_LIBCUDF_TYPES

from libcpp.memory cimport unique_ptr
from libcpp.string cimport string
from libcpp.utility cimport move

from pylibcudf.libcudf.column.column cimport column
Expand Down

0 comments on commit 9405162

Please sign in to comment.