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

ImportError: /home/dosisiddhesh/.cache/torch_extensions/py39_cu117/slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0/slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0.so: cannot open shared object file: No such file or directory #61

Open
git-siddhesh opened this issue Nov 18, 2024 · 3 comments

Comments

@git-siddhesh
Copy link

git-siddhesh commented Nov 18, 2024

I installed xlstm using
pip install xlstm

My system is

   0  Quadro RTX 5000                On  | 00000000:AF:00.0 Off |                  Off |
| 33%   49C    P2              55W / 230W |   3825MiB / 16384MiB |      3%      Default |

nvcc --version
11.7

Logs

Using /home/dosisiddhesh/.cache/torch_extensions/py39_cu117 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /home/dosisiddhesh/.cache/torch_extensions/py39_cu117/slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0/build.ninja...
Building extension module slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
1.11.1.git.kitware.jobserver-1
Loading extension module slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0...
Traceback (most recent call last):
  File "/home/dosisiddhesh/SIDDHESH/PCN_XLSTM/train.py", line 442, in <module>
    train()
  File "/home/dosisiddhesh/SIDDHESH/PCN_XLSTM/train.py", line 119, in train
    net = model_module.Model(args).cuda()
  File "/home/dosisiddhesh/SIDDHESH/PCN_XLSTM/models/pcn.py", line 235, in __init__
    self.encoder = XL_encoder()
  File "/home/dosisiddhesh/SIDDHESH/PCN_XLSTM/models/pcn.py", line 165, in __init__
    self.xlstm_point_stack = xLSTMBlockStack(cfg)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/xlstm_block_stack.py", line 84, in __init__
    self.blocks = self._create_blocks(config=config)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/xlstm_block_stack.py", line 105, in _create_blocks
    blocks.append(sLSTMBlock(config=config))
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/slstm/block.py", line 33, in __init__
    super().__init__(
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/xlstm_block.py", line 63, in __init__
    self.xlstm = sLSTMLayer(config=self.config.slstm)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/slstm/layer.py", line 78, in __init__
    self.slstm_cell = sLSTMCell(self.config)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/slstm/cell.py", line 780, in __new__
    return sLSTMCell_cuda(config, skip_backend_init=skip_backend_init)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/slstm/cell.py", line 690, in __init__
    self.func = sLSTMCellFuncGenerator(self.training, config)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/slstm/cell.py", line 536, in sLSTMCellFuncGenerator
    slstm_cuda = sLSTMCellCUDA.instance(config=config)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/slstm/cell.py", line 515, in instance
    cls.mod[repr(config)] = load(
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/xlstm/blocks/slstm/src/cuda_init.py", line 84, in load
    mod = _load(name + suffix, sources, **myargs)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1284, in load
    return _jit_compile(
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1535, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/dosisiddhesh/.conda/envs/xlstm/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1929, in _import_module_from_library
    module = importlib.util.module_from_spec(spec)
  File "<frozen importlib._bootstrap>", line 565, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1173, in create_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: /home/dosisiddhesh/.cache/torch_extensions/py39_cu117/slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0/slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0.so: cannot open shared object file: No such file or directory
@HungNguyen4864
Copy link

You can change the backend of sLSTM to 'vanilla', as the author commented.

@git-siddhesh
Copy link
Author

git-siddhesh commented Nov 23, 2024

You can change the backend of sLSTM to 'vanilla', as the author commented.

@HungNguyen4864
I am bit confused about the use of backend parameter in the sLSTM defination.
What is the use of 'cuda' or 'vanilla' as the backend.

>>> import torch
>>> torch.cuda.is_available()
True

Also, in the notebook you have provided in the repo says,
backend: {'cuda' if torch.cuda.is_available() else 'vanilla'} #! only vanilla here works

But I want to run my model on GPU.

I have another question, which I didn't found anywhere.

What system architecture does xlstm supports?
like: Ampere (A-100), Volta (V-100), RTX(5000)?

I am asking this because, the exact same script is running on A-100 but not on other systems.

@HungNguyen4864
Copy link

HungNguyen4864 commented Nov 23, 2024

In the sLSTMCell_vanilla class, it uses.reshape()and .permute() operations. These do not inherently require a GPU, indicating that this class is designed to operate without the need for GPU acceleration.

In contrast, the sLSTMCell_cuda class includes an __init__ constructor that has a skip_backend_init parameter. This allows the class to skip initializing components necessary for GPU operation, which is useful for converting models between different hardware configurations. Methods _impl and _impl_step in this class use self.func.apply, a function specifically designed for GPU execution. Input tensors are required to be .contiguous() before being passed to this function, a requirement essential for efficient operations on CUDA.

If there's still a desire to use a GPU, adjustments in the source code would be necessary. I'm not able to provide specifics on how to make these changes but can confirm the information as stated.

You can follow this path to read more : xlstm/blocks/slstm/cell.py
Because i don't know how to fix it so If you can fix it, if it's not too much trouble, could you please provide me with a way to fix it?

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