IBM / aihwkit

IBM Analog Hardware Acceleration Kit
https://aihwkit.readthedocs.io
Apache License 2.0
342 stars 143 forks source link

Sample Validation Failure #669

Closed 24367452 closed 3 weeks ago

24367452 commented 1 month ago

Sample Validation Failure I have successfully installed AIHWKIT via pip install aihwkit but when I run the following example :

from torch import Tensor
from aihwkit.nn import AnalogLinear

model = AnalogLinear(2, 2)
model(Tensor([[0.1, 0.2], [0.3, 0.4]]))

But there was an error : ··· Traceback (most recent call last): File "E:\aihwkit_CNN\test.py", line 2, in from aihwkit.nn import AnalogLinear File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\nn__init.py", line 17, in from aihwkit.nn.modules.container import AnalogSequential, AnalogWrapper File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\nn\modules\container.py", line 23, in from aihwkit.nn.modules.base import AnalogLayerBase File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\nn\modules\base.py", line 22, in from aihwkit.simulator.tiles.module import TileModule File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\simulator\tiles\init.py", line 17, in from aihwkit.simulator.tiles.analog import AnalogTile File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\simulator\tiles\analog.py", line 21, in from aihwkit.simulator.tiles.rpucuda import RPUCudaSimulatorTileWrapper File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\simulator\tiles\rpucuda.py", line 24, in from aihwkit.simulator.parameters.base import RPUConfigGeneric File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\simulator\parameters\init__.py", line 31, in from .training import UpdateParameters File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\simulator\parameters\training.py", line 20, in from .helpers import _PrintableMixin File "C:\Users\Administrator.conda\envs\cq\lib\site-packages\aihwkit\simulator\parameters\helpers.py", line 20, in from aihwkit.simulator import rpu_base ImportError: DLL load failed while importing rpu_base: The specified module could not be found. ··· What's the reason for this?

24367452 commented 1 month ago

Hello, can you guide me on how to resolve this? @maljoras

ShiJLdot commented 1 month ago

I have the same problem,have you solved it?

24367452 commented 1 month ago

I haven't solved it yet. If you have already solved this problem, please let me know and I will be very grateful!

我有同样的问题,你解决了吗?

ShiJLdot commented 1 month ago

I tried Linux system instead and it works

---- Replied Message ---- | From | @.> | | Date | 07/28/2024 16:52 | | To | IBM/aihwkit @.> | | Cc | ShiJLdot @.>, Comment @.> | | Subject | Re: [IBM/aihwkit] Sample Validation Failure (Issue #669) |

I haven't solved it yet. If you have already solved this problem, please let me know and I will be very grateful!

我有同样的问题,你解决了吗?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

PabloCarmona commented 1 month ago

Hello @24367452, can you give more info on what OS and versions of Python you are using to run this script? @ShiJLdot is saying that Linux is working but I'm not sure if that is a problem with the OS or how the package is installed.

If this is in Windows, are you using the python shell or WSL? The best way and less error-prone to do it is through WSL.

PabloCarmona commented 3 weeks ago

We are closing this issue as it seems to be a problem of the user OS and can be solved using WSL in the case of Windows and using pip instead of conda for OSX systems. We planned a new bundle version to be compatible with OSX in conda-forge here https://github.com/IBM/aihwkit/issues/676.

If you have any new concerns or problems @24367452 let us know in a new issue or reopen this. Thank you so much for working on the project and if we can help you with anything more don't hesitate to let us know! :)