Installation¶
The preferred way to install this package is by using the Python package index:
pip install aihwkit
Note
During the initial beta stage, we do not provide pip wheels (as in, pre-compiled binaries) for all the possible platform, version and architecture combinations (in particular, only CPU versions are provided).
Please refer to the Advanced installation guide page for instruction on how to compile the library for your environment in case you encounter errors during installing from pip.
The package require the following runtime libraries to be installed in your system:
OpenBLAS: 0.3.3+
CUDA Toolkit: 9.0+ (only required for the GPU-enabled simulator 1)
Note
Please note that the current pip wheels are only compatible with PyTorch
1.6.0
. If you need to use a different PyTorch
version, please
refer to the Advanced installation guide section in order to compile a custom
version. More details about the PyTorch
compatibility can be found in
this issue.
Verifying the installation¶
If the library was installed correctly, you can use the following snippet for creating an analog layer and predicting the output:
from torch import Tensor
from aihwkit.nn import AnalogLinear
model = AnalogLinear(3, 2)
model(Tensor([[0.1, 0.2], [0.3, 0.4]]))
If you encounter any issues during the installation or executing the snippet, please refer to the Advanced installation guide section for more details and don’t hesitate on using the issue tracker for additional support.
Next steps¶
You can read more about the PyTorch layers in the Using the pytorch integration section, and about the internal analog tiles in the Using analog tiles section.
- 1
Note that GPU support is not available in OSX, as it depends on a platform that has official CUDA support.