SOFT icon indicating copy to clipboard operation
SOFT copied to clipboard

About from SOFT import _c library file problem

Open handsomezhuo opened this issue 2 years ago • 4 comments

Hello, I read your article and code, but I found an error in the section of from SOFT import _c in the subtraction file, would you please tell me where to find this library

handsomezhuo avatar Nov 02 '22 06:11 handsomezhuo

You may first install SOFT with

python -m pip install -e SOFT

Or, we have provided a pytorch version implementation, you can just delete C-related sentences in Python codes and use our pytorch implementation.

VictorLlu avatar Nov 07 '22 03:11 VictorLlu

I have carefully reviewed the code you provided,for example, image After the _c sentence is deleted, there is no way to put key,query and output into the Gaussian kernel for operation at the same time. I haven't found the code about the Gaussian kernel written by pytorch, perhaps I haven't noticed it. Could you please give me a hint? Thank you

handsomezhuo avatar Nov 07 '22 08:11 handsomezhuo

You would better first install SOFT with

python -m pip install -e SOFT

This will solve most of the issues caused by library SOFT. And then, if you want to avoid using CUDA, please set the parameter --kernel-method as torch. It will lead to code https://github.com/fudan-zvg/SOFT/blob/41debdd7c5de192f9c09e9c42e8cf2361f3d61fd/models/softmax_free_transformer.py#L38 You can now delete https://github.com/fudan-zvg/SOFT/blob/41debdd7c5de192f9c09e9c42e8cf2361f3d61fd/models/softmax_free_transformer.py#L5

VictorLlu avatar Nov 07 '22 09:11 VictorLlu

Thanks for your kind instruction, now I can run the program successfully.

handsomezhuo avatar Nov 07 '22 11:11 handsomezhuo