Skip to content

v0.5.2

Latest

Choose a tag to compare

@peremartra peremartra released this 29 Nov 16:15
· 1 commit to main since this release

✨ New Features

  • Added Apple Silicon (MPS / Metal) support alongside CUDA and CPU. New optipfair.device
    helpers (get_device, get_default_dtype, empty_cache, synchronize,
    memory_allocated, is_mps_available) are exported from the package root. All of them
    accept None, "" and "auto"; synchronize("cuda:1") synchronizes that specific GPU.
  • get_device() / --device auto now picks CUDA, then MPS, then CPU, and honours the new
    OPTIPFAIR_DEVICE environment variable. Explicitly requesting an unavailable backend now
    fails with a clear error instead of falling back to CPU.
  • CLI --dtype auto now selects bfloat16 on MPS (macOS 14+) instead of float32.

🔧 Bug Fixes

  • Calibration for data-driven width pruning now releases cached memory on MPS as well as
    CUDA.
  • time_inference() synchronizes the GPU (CUDA/MPS) before reading the clock and uses
    time.perf_counter(), so asynchronous kernels are included in measured latency.
  • Fixed optipfair prune --pruning-type DEPTH crashing with KeyError: 'expansion_rate'
    before saving the pruned model; the CLI now logs the number of layers removed (#60).
  • pytest now only collects tests/ by default, so example scripts named *_test.py
    (which load gated models and open plot windows) are no longer imported (#62).