benchopt.helpers.requires_gpu.gpu_available

Contents


benchopt.helpers.requires_gpu.gpu_available#

benchopt.helpers.requires_gpu.gpu_available(solver)#

Whether the runs of solver will have a GPU.

Use it in Solver.skip to check this consistently across backends from the machine running benchopt run. With submitit, a GPU is requested by gres or a gpus* option. With dask, workers are assumed to have one.

Parameters:
solverbenchopt.BaseSolver

The solver whose runs are checked.

Returns:
availablebool

True if the runs of solver will have a GPU.