Skip to content

Installation

Dependencies

TorchApprox relies on the ninja build system and OpenMP in order to JIT-compile kernels. Make sure they are available on your system.

Ubuntu

$ sudo apt install libomp-dev ninja-build

Pip Installation

$ pip install git+ssh://github.com/etrommer/torch-approx

Development

If you want to help actively develop TorchApprox, clone TorchApprox from Github and make sure to install additional dependencies as well as pre-commit hooks:

git clone git@github.com:etrommer/torch-approx.git
cd torch-approx
poetry install --with dev extras
poetry run pre-commit install

Unit Tests

TorchApprox uses pytest for unit testing. Unit tests can be run with:

poetry run pytest test
If a CUDA device is detected, tests will be run on CPU and GPU. Otherwise, tests run on CPU only.

Micro-Benchmarking

TorchApprox uses the pytest-benchmark plugin to perform benchmarking of low-level kernels. Benchmarking can be run with:

poetry run pytest benchmarks