Skip to content

Installation

HSF is thought to be easily installable.

However, as it can be used with several different hardware acceleration platforms, some of the installation steps may vary.

Setting up a new environment

We encourage you to use the conda environment manager to use HSF.

To create a new environment, run the following commant:

conda create -n hsf python=3.9

Then, activate the new environment:

source activate hsf

Installation from PyPI

You'll be able to to install HSF from PyPI by following the instructions:

pip install hsf["cpu"]

First of all, please have a working CUDA and cuDNN installation.

  • The path to the CUDA installation must be provided via the CUDA_PATH environment variable,
  • The path to the cuDNN installation (include the cuda folder in the path) must be provided via the cuDNN_PATH environment variable. The cuDNN path should contain bin, include and lib directories.
  • The path to the cuDNN bin directory must be added to the PATH environment variable.

ONNXRuntime 1.8 requires at least CUDA 11.0.3, and cuDNN 8.0.4. For newer versions, please check the ONNXRuntime documentation

Then run the following commands (please note that if you already installed HSF before, you need to uninstall onnxruntime for the GPU to be detected correctly):

pip install hsf["gpu"]

DirectML is compatible with Windows 10, version 1709 (10.0.16299; RS3, “Fall Creators Update”) and newer.

pip install hsf
pip install onnxruntime-directml

See the ONNXRuntime documentation or the Microsoft documentation for more details.

You can now check the installation and default parameters of HSF using hsf -h.

Please note that using pip install hsf will install HSF without any execution provider.

Installation from sources

HSF is using Poetry to manage its dependencies. To install HSF from sources, be sure to have a working Poetry installation.

Then, run:

git clone git@github.com:clementpoiret/HSF.git
cd HSF
poetry install

Taken from the Poetry documentation, poetry creates a virtual environment in {cache-dir}/virtualenvs. You can change the cache-dir value by editing the poetry config. Additionally, you can use the virtualenvs.in-project configuration variable to create virtual environment within your project directory.

To use HSF, activate the environment created by Poetry by doing source {path_to_venv}/bin/activate.