aihwkit icon indicating copy to clipboard operation
aihwkit copied to clipboard

Code modification and application method

Open DoyoonKim0209 opened this issue 1 year ago • 4 comments

I want to apply the changes I made to the code in AIHWKIT and run the simulation.

I applied the method on Linux, but it doesn't seem to work well.

The method I used is as follows:

After downloading the files with git clone, I modified the cpp code and then executed the following code:

python setup.py build_ext --inplace -DUSE_CUDA=ON -DRPU_CUDA_ARCHITECTURES='86'

If I am wrong, I would like to know what method I should use.

DoyoonKim0209 avatar Feb 28 '24 14:02 DoyoonKim0209

To be honest, I endured a tough time when I tried to compile the library (c.f. #545). Hope my experience can help you.

BTW, there isn't enough information in your description. I guess you will get more help If you could provide more information like the warming and error information.

Zhaoxian-Wu avatar Mar 04 '24 23:03 Zhaoxian-Wu

Have you tried to following the instructions at this https://aihwkit.readthedocs.io/en/latest/developer_install.html#development-setup and https://aihwkit.readthedocs.io/en/latest/developer_install.html#via-python-command

Let me know if you run into issue.

kkvtran avatar Mar 05 '24 14:03 kkvtran

When using miniconda on Linux it should be very straightforward to compile the library. Otherwise, one has to know a bit about bash and linux to setup the dependencies and paths correctly, there should be ample advice about it in general in the Internet though as it is quite standard. Please refer also to the installation instructions.

For windows or MAC it is more experimental, but there are also instructions in the documentation about how to do that.

maljoras avatar Mar 08 '24 04:03 maljoras

Maybe this can help? On macOS, I try to avoid conda as much as possible and prefer the combination of venv, brew and pip. Following and adapting #541 and #545, I found the following to successfully install aihwkit and was able to run examples/simple_layer.py:

brew install openblas
pip install cmake torch scikit-build scikit-learn pybind11 mypy
OpenBLAS_HOME=/opt/homebrew/opt/openblas pip install aihwkit

Note that I had to reactivate my virtual environement for some imports (from a pytest session) to work

deactivate; source venv/bin/activate

I'm not sure if it helps the current issue, but @Zhaoxian-Wu seem interested in the question and this is the only open issue where this is discussed, so I take a chance.

simonverret avatar Jun 05 '24 15:06 simonverret

We are trying to make tutorials to help the user experience of compiling the kit on all platforms, due to the lack of information in the original comment and the lack of response to the request for more information we are closing this issue, however if the problem persists, we urge you to reopen it and we will get on with fixing the problem more quickly.

Borjagodoy avatar Aug 06 '24 10:08 Borjagodoy