cuperiod.suggest_gpu_workers

cuperiod.suggest_gpu_workers(method='GLS', *, n_points_hint=2000, grid_size=None, headroom=0.2, device_id=0)[source]

Suggest a GPU worker count from probed free memory and a footprint estimate.

Parameters:
  • method (str, default "GLS") – Method name, used to pick a per-worker footprint estimate.

  • n_points_hint (int, default 2000) – Assumed grid size when grid_size is not given.

  • grid_size (int, optional) – Actual grid size, if known.

  • headroom (float, default 0.20) – Fraction of free memory to leave unused (driver/fragmentation slack).

  • device_id (int, default 0) – CUDA device ordinal.

Returns:

int – A worker count >= 1. Returns 1 when no GPU is available. Capped at a sane maximum; without MPS, 1-2 workers usually saturate a single device.

Return type:

int