﻿# Dask-CUDA spilling: task-output eviction and cuDF buffer eviction see different memory

Diagnose Dask-CUDA memory pressure through spill granularity, task intermediates, exposed cuDF buffers and the separate host-worker memory policy.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-dask-cuda-spill-task-buffer-granularity/
Language: en

## Locate the allocation inside the task

A distributed feature transformation fails while building an intermediate table, even though completed outputs have already been spilled. The [Dask-CUDA spilling guide](https://docs.nvidia.com/dask-cuda/latest/spilling/) distinguishes ordinary task-output spilling from native cuDF buffer spilling. The former tracks whole task outputs, while the latter can move eligible buffers during a task. A low count of resident completed results does not describe every temporary allocation made by the running operation.

## Match the spill mechanism to the representation

For a dataframe workflow, native buffer management may see memory that task-level management cannot yet evict. Check the actual data representation and installed configuration before assuming either mechanism covers the calculation. A workload that converts tables into arrays or another library's objects can cross that management boundary. Describe where memory becomes visible to each manager instead of treating all GPU bytes as interchangeable resources under a single spill setting.

## Identify exposed and unspillable buffers

The [cuDF spilling reference](https://docs.nvidia.com/cudf/latest/cudf/spilling/) explains that tracked buffer limits are soft and do not cap total GPU memory. Buffers whose pointers are exposed or in use may be temporarily or permanently unspillable. Inspect conversions and external-library handoffs near the memory peak. Increasing the spill frequency cannot make a manager relocate memory that another component is actively relying on through a stable device pointer.

## Budget the host destination separately

Moving data off GPU consumes another memory tier. The [Dask worker-memory guide](https://distributed.dask.org/en/stable/worker-memory.html) describes host-worker spilling, pausing and other memory-management actions. Keep its process-memory policy separate from the device-buffer policy. An operation can reduce device pressure while increasing host pressure, and a disk-backed worker has additional I/O behavior. Record both tiers when interpreting a task that becomes slower or stops accepting further work after spilling begins.

## Inspect a representative peak before resizing the cluster

Use spill statistics and task context to identify whether the peak belongs to intermediate buffers, exposed arrays or retained outputs. Consider smaller partitions or a different conversion boundary when supported by the algorithm. The guides on [reserved versus allocated GPU memory](/journal/cuda-oom-reserved-vs-allocated/) and [container memory pressure](/journal/cgroup-v2-memory-high-events/) provide related distinctions. The relevant question is which memory can move at that moment, not merely whether some spilling feature is enabled.
