Skip to content

Commit

Permalink
Replace cuDF (de)serializer with cuDF spill-aware (de)serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
pentschev committed Jul 26, 2024
1 parent 13a5f47 commit 8113d72
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dask_cuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import dask.dataframe.shuffle
import dask.dataframe.multi
import dask.bag.core
from distributed.protocol.cuda import cuda_deserialize, cuda_serialize
from distributed.protocol.serialize import dask_deserialize, dask_serialize

from ._version import __git_commit__, __version__
from .cuda_worker import CUDAWorker
Expand Down Expand Up @@ -48,3 +50,17 @@
dask.dataframe.shuffle.shuffle_group
)
dask.dataframe.core._concat = unproxify_decorator(dask.dataframe.core._concat)


def _register_cudf_spill_aware():
import cudf

# Only enable Dask/cuDF spilling if cuDF spilling is disabled
if not cudf.get_option("spill"):
from cudf.comm import serialize


for registry in [cuda_serialize, cuda_deserialize, dask_serialize, dask_deserialize]:
for lib in ["cudf", "dask_cudf"]:
if lib in registry._lazy:
registry._lazy[lib] = _register_cudf_spill_aware

0 comments on commit 8113d72

Please sign in to comment.