Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error on causal_product_cpu on GCC/G++ 11 #110

Open
lsisoft opened this issue Feb 8, 2022 · 3 comments
Open

Runtime error on causal_product_cpu on GCC/G++ 11 #110

lsisoft opened this issue Feb 8, 2022 · 3 comments

Comments

@lsisoft
Copy link

lsisoft commented Feb 8, 2022

I've build pytorch fast transformers on Ubuntu 21.10, CUDA 11.6, GCC/G++ 11. Build worked fine. On:

import fast_transformers.causal_product.causal_product_cpu

from an init file, it throws the following error:
[...]
File "python3.8/site-packages/fast_transformers/builders/init.py", line 42, in
from ..attention import
File "python3.8/site-packages/fast_transformers/attention/init.py", line 13, in
from .causal_linear_attention import CausalLinearAttention
File "python3.8/site-packages/fast_transformers/attention/causal_linear_attention.py", line 15, in
from ..causal_product import causal_dot_product
File "python3.8/site-packages/fast_transformers/causal_product/init.py", line 9, in
from .causal_product_cpu import causal_dot_product as causal_dot_product_cpu,
ImportError: python3.8/site-packages/fast_transformers/causal_product/causal_product_cpu.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNSt15__exception_ptr13exception_ptr9_M_addrefEv

used update-alternatives and pointed to GCC/G++ 10, the runtime error is gone.

More versions, in verbose format. Due to the update-alternatives, I'm calling g++-11 and gcc-11 specifically, they were the default in Ubuntu 21.10:

✗ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Fri_Dec_17_18:16:03_PST_2021
Cuda compilation tools, release 11.6, V11.6.55
Build cuda_11.6.r11.6/compiler.30794723_0

✗ gcc-11 --version
gcc-11 (Ubuntu 11.2.0-7ubuntu2) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

✗ g++-11 --version
g++-11 (Ubuntu 11.2.0-7ubuntu2) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

@li-car-fei
Copy link

I've build pytorch fast transformers on Ubuntu 21.10, CUDA 11.6, GCC/G++ 11. Build worked fine. On:

import fast_transformers.causal_product.causal_product_cpu

from an init file, it throws the following error: [...] File "python3.8/site-packages/fast_transformers/builders/init.py", line 42, in from ..attention import File "python3.8/site-packages/fast_transformers/attention/init.py", line 13, in from .causal_linear_attention import CausalLinearAttention File "python3.8/site-packages/fast_transformers/attention/causal_linear_attention.py", line 15, in from ..causal_product import causal_dot_product File "python3.8/site-packages/fast_transformers/causal_product/init.py", line 9, in from .causal_product_cpu import causal_dot_product as causal_dot_product_cpu, ImportError: python3.8/site-packages/fast_transformers/causal_product/causal_product_cpu.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNSt15__exception_ptr13exception_ptr9_M_addrefEv

used update-alternatives and pointed to GCC/G++ 10, the runtime error is gone.

More versions, in verbose format. Due to the update-alternatives, I'm calling g++-11 and gcc-11 specifically, they were the default in Ubuntu 21.10:

✗ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Fri_Dec_17_18:16:03_PST_2021 Cuda compilation tools, release 11.6, V11.6.55 Build cuda_11.6.r11.6/compiler.30794723_0

✗ gcc-11 --version gcc-11 (Ubuntu 11.2.0-7ubuntu2) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

✗ g++-11 --version g++-11 (Ubuntu 11.2.0-7ubuntu2) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

I meet the same problem, have you solved it ?

@lsisoft
Copy link
Author

lsisoft commented Sep 22, 2022

My solution was to use ubuntu 'update-alternatives' to set GCC and G++ to the earlier version that works, for the duration of the compile time. The possibly proper solution would be to make it compile on the latest version.

@li-car-fei
Copy link

maybe the question is from conda dependence

I have found the solution like this: https://github.com/li-car-fei/fast-transformers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants