Comments (7)
@Warvito I'm in the dark as much as you are :( I have been putting off custom CUDA code for as long as I could, but the results of this paper was irresistible
from performer-pytorch.
I had the same issue. I am not sure what worked for me but after some steps training with casual=True is working.
my steps:
- Add CUDA to the PATH variable
export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}
- Create LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- Create new environment and install fast-transformers as in that issue comment: idiap/fast-transformers#23 (comment)
- Install performer-pytorch after that
from performer-pytorch.
@Warvito ahh, so not often spoken about is the fact that the auto-regressive flavor of linear attention actually incurs a pretty big memory cost (x sequence length) and requires special CUDA code to be performant (it is probably why google chose to do this in Jax)
EPFL wrote up a nice implementation, but i think it is somehow failing to be imported on your machine https://github.com/idiap/fast-transformers/blob/master/fast_transformers/causal_product/__init__.py#L12
from performer-pytorch.
@Warvito could you try python-ing into the interactive session and run
> import fast_transformers.causal_product.causal_product_cuda
and see what happens?
from performer-pytorch.
@lucidrains Thank you for the quick reply.
I tried the command that you asked and I got the following error:
Traceback (most recent call last):
File "/home/walter/Desktop/minGPT/venv/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 3343, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-87c39b6d500c>", line 1, in <module>
import fast_transformers.causal_product.causal_product_cuda
File "/home/walter/pycharm-2020.1.1/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'fast_transformers.causal_product.causal_product_cuda'
I have the 0.3.0 version installed here, and it works as expected when using casual=False.
I tried to uninstall pytorch-fast-transformers and install it again. But it did not worked.
I had the chance to try also in a system with a V100 and CUDA 11. And it worked as expected.
I also tried it on Google colab with a Tesla T4 and CUDA 10.1. And it worked as expected. Maybe it is something related with the RTX architecture? In any case, it might be a issue from pytorch-fast-transformers.
Thank you again for the quick reply, and thank you very much for all your repositories. ^^
from performer-pytorch.
@arti32lehtonen is right, make sure c++ tool chain (gcc) and cuda tool chain (nvcc) is available in your environment. If not, use export command make it visible (try "nvcc --version" after that), then reinstall the package.
from performer-pytorch.
Thx @arti32lehtonen and @yygle !
I tried your suggestions and it worked!
from performer-pytorch.
Related Issues (20)
- hyperbolic cosine based estimator
- torch.max(data_dash) bug HOT 2
- Residual Connection HOT 3
- way to make two elements invisible?
- torch_tensorrt compilation fails
- Rotary Position Embedding
- Output inconsistent for autoregressive performer HOT 2
- How to test the performer architecture for training new models? HOT 1
- Performer Plain
- Attention map HOT 2
- Huge model state dict size?
- Using Performer with GNNs
- Question: Is Performer order equivariant? (can it transform an unordered set of tensors)
- Question about masking HOT 2
- I want to use Peroformer on MAE
- Using replicating nn.MultiHeadAttention with multiple performer SelfAttention modules
- Performer Pytorch Slower than Expected and Please Help with Understanding Parameter Count HOT 1
- Pretrained example
- Cross-attention with arbitrary causal mask
- Modify the transformer tutorial based on performer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from performer-pytorch.