programmablebio / ptm-mamba

Other
33 stars 2 forks source link

pip install -e mamba returning a runtime error #2

Closed StevenGarrett083 closed 3 months ago

StevenGarrett083 commented 3 months ago

Hello!

Very excited about this model, and am in the process of setting up the docker workspace. However I keep running into an issue stemming from on line when I try to install the packages in the container. When I run

pip install -e mamba 

I receive either an EOF error or a runtime error, the traceback for the runtime is as follows:

 ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py", line 2105, in _run_ninja_build
        subprocess.run(
      File "/usr/lib/python3.10/subprocess.py", line 526, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/workspace/protein_lm/modeling/models/libs/mamba/setup.py", line 234, in <module>
        setup(
      File "/usr/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 103, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 989, in run_command
        super().run_command(command)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.10/dist-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/usr/local/lib/python3.10/dist-packages/setuptools/command/develop.py", line 109, in install_for_development
        self.run_command('build_ext')
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 989, in run_command
        super().run_command(command)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.10/dist-packages/setuptools/command/build_ext.py", line 88, in run
        _build_ext.run(self)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
        self.build_extensions()
      File "/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py", line 876, in build_extensions
        build_ext.build_extensions(self)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
        self._build_extensions_serial()
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
        self.build_extension(ext)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/command/build_ext.py", line 249, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/local/lib/python3.10/dist-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
        super(build_ext, self).build_extension(ext)
      File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
        objects = self.compiler.compile(
      File "/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py", line 689, in unix_wrap_ninja_compile
        _write_ninja_file_and_compile_objects(
      File "/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py", line 1777, in _write_ninja_file_and_compile_objects
        _run_ninja_build(
      File "/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py", line 2121, in _run_ninja_build
        raise RuntimeError(message) from e
    RuntimeError: Error compiling objects for extension

I was wondering if you have encountered this issue and/or know any way to mend it?

Thank you very much for your time and work on this project and I wish you best of luck with the continuation of your research.

pengzhangzhi commented 3 months ago

the cuda version and the pytorch aren't compatible. I would suggest following the docker installation which takes care of everything.

StevenGarrett083 commented 3 months ago

Thank you so much for your response, when following the docker installation again I happened upon a different error.

While running setup.py develop for mamba-ssm, I receive an unexpected EOF error which ends the installation.

Installing collected packages: safetensors, huggingface-hub, tokenizers, transformers, mamba-ssm
  Running setup.py develop for mamba-ssm
unexpected EOF

Any idea on what this error could be?

Thank you!

pengzhangzhi commented 3 months ago

weird, what command did you execute?

StevenGarrett083 commented 3 months ago

This one:

cd protein_lm/modeling/models/libs/ && pip install -e causal-conv1d && pip install -e mamba && cd ../../../../

the causal-conv1d works fine, but it errors out as it gets to the mamba. Everything is literally copied and pasted from the README

pengzhangzhi commented 3 months ago

Do you get the same error when you executing pip install -e mamba separately?

StevenGarrett083 commented 3 months ago

I did when I tried that yesterday, but trying it again today running only pip install -e mamba looks like it fixed my error for some reason.

Thank you for your help!

pengzhangzhi commented 3 months ago

happy PTM-Mamba hacking :)