qrunch.tools.acceleration

Acceleration module for mac or linux with and without a metal or cuda GPU.

Functions

get_backend()

Select the appropriate acceleration backend based on hardware and environment.

get_backend() type[AcceleratedFunctions] | type[AcceleratedFunctions] | type[AcceleratedFunctions]

Select the appropriate acceleration backend based on hardware and environment.

The GPU backend is selected if: - CuPy or Mlx is installed - A CUDA or Metal device is available - QRUNCH_FORCE_CPU_ONLY environment variable is not set to “1”, “true”, “yes”, “t”, or “y” (case-insensitive)

Return type:

type[AcceleratedFunctions] | type[AcceleratedFunctions] | type[AcceleratedFunctions]

Modules

interface

Interface definitions for hardware-accelerated tensor operations.