Dao-AILab / causal-conv1d

Causal depthwise conv1d in CUDA, with a PyTorch interface
BSD 3-Clause "New" or "Revised" License
332 stars 61 forks source link

PyPi causal-conv1d 1.0.1 won't install, but git version does #4

Open HenkPoley opened 11 months ago

HenkPoley commented 11 months ago

I'm running the pip installs from the same terminal. 🤷‍♂️

Errors I'm spotting:

PS C:\Users\henk> pip install causal-conv1d
Collecting causal-conv1d
  Using cached causal_conv1d-1.0.1.tar.gz (6.4 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: torch in c:\python311\lib\site-packages (from causal-conv1d) (2.1.1+cu121)
Requirement already satisfied: packaging in c:\python311\lib\site-packages (from causal-conv1d) (23.2)
Collecting buildtools (from causal-conv1d)
  Using cached buildtools-1.0.6-py3-none-any.whl
Collecting ninja (from causal-conv1d)
  Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl.metadata (5.4 kB)
Requirement already satisfied: sqlalchemy in c:\python311\lib\site-packages (from buildtools->causal-conv1d) (2.0.23)
Collecting argparse (from buildtools->causal-conv1d)
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting twisted (from buildtools->causal-conv1d)
  Using cached twisted-23.10.0-py3-none-any.whl.metadata (9.5 kB)
Collecting simplejson (from buildtools->causal-conv1d)
  Using cached simplejson-3.19.2-cp311-cp311-win_amd64.whl.metadata (3.2 kB)
Collecting furl (from buildtools->causal-conv1d)
  Using cached furl-2.1.3-py2.py3-none-any.whl (20 kB)
Requirement already satisfied: requests in c:\python311\lib\site-packages (from buildtools->causal-conv1d) (2.28.1)
Collecting docopt (from buildtools->causal-conv1d)
  Using cached docopt-0.6.2-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil in c:\python311\lib\site-packages (from buildtools->causal-conv1d) (2.8.2)
Requirement already satisfied: jinja2 in c:\python311\lib\site-packages (from buildtools->causal-conv1d) (3.1.2)
Collecting redo (from buildtools->causal-conv1d)
  Using cached redo-2.0.4-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: filelock in c:\python311\lib\site-packages (from torch->causal-conv1d) (3.9.0)
Requirement already satisfied: typing-extensions in c:\python311\lib\site-packages (from torch->causal-conv1d) (4.4.0)
Requirement already satisfied: sympy in c:\python311\lib\site-packages (from torch->causal-conv1d) (1.12)
Requirement already satisfied: networkx in c:\python311\lib\site-packages (from torch->causal-conv1d) (3.0)
Requirement already satisfied: fsspec in c:\python311\lib\site-packages (from torch->causal-conv1d) (2023.4.0)
Requirement already satisfied: six>=1.8.0 in c:\python311\lib\site-packages (from furl->buildtools->causal-conv1d) (1.16.0)
Collecting orderedmultidict>=1.0.1 (from furl->buildtools->causal-conv1d)
  Using cached orderedmultidict-1.0.1-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: MarkupSafe>=2.0 in c:\python311\lib\site-packages (from jinja2->buildtools->causal-conv1d) (2.1.3)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d) (1.26.13)
Requirement already satisfied: certifi>=2017.4.17 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d) (2022.12.7)
Requirement already satisfied: greenlet!=0.4.17 in c:\python311\lib\site-packages (from sqlalchemy->buildtools->causal-conv1d) (3.0.1)
Requirement already satisfied: mpmath>=0.19 in c:\python311\lib\site-packages (from sympy->torch->causal-conv1d) (1.3.0)
Requirement already satisfied: attrs>=21.3.0 in c:\python311\lib\site-packages (from twisted->buildtools->causal-conv1d) (23.1.0)
Collecting automat>=0.8.0 (from twisted->buildtools->causal-conv1d)
  Using cached Automat-22.10.0-py2.py3-none-any.whl (26 kB)
Collecting constantly>=15.1 (from twisted->buildtools->causal-conv1d)
  Using cached constantly-23.10.4-py3-none-any.whl.metadata (1.8 kB)
Collecting hyperlink>=17.1.1 (from twisted->buildtools->causal-conv1d)
  Using cached hyperlink-21.0.0-py2.py3-none-any.whl (74 kB)
Collecting incremental>=22.10.0 (from twisted->buildtools->causal-conv1d)
  Using cached incremental-22.10.0-py2.py3-none-any.whl (16 kB)
Collecting twisted-iocpsupport<2,>=1.0.2 (from twisted->buildtools->causal-conv1d)
  Using cached twisted_iocpsupport-1.0.4-cp311-cp311-win_amd64.whl.metadata (2.2 kB)
Requirement already satisfied: zope-interface>=5 in c:\python311\lib\site-packages (from twisted->buildtools->causal-conv1d) (6.1)
Requirement already satisfied: setuptools in c:\python311\lib\site-packages (from zope-interface>=5->twisted->buildtools->causal-conv1d) (69.0.2)
Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl (312 kB)
Using cached simplejson-3.19.2-cp311-cp311-win_amd64.whl (75 kB)
Using cached twisted-23.10.0-py3-none-any.whl (3.2 MB)
Using cached constantly-23.10.4-py3-none-any.whl (13 kB)
Using cached twisted_iocpsupport-1.0.4-cp311-cp311-win_amd64.whl (47 kB)
Building wheels for collected packages: causal-conv1d
  Building wheel for causal-conv1d (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [121 lines of output]

      torch.__version__  = 2.1.1+cu121

      running bdist_wheel
      Guessing wheel URL:  https://github.com/Dao-AILab/causal-conv1d/releases/download/v1.0.1/causal_conv1d-1.0.1+cu122torch2.1cxx11abiFALSE-cp311-cp311-win_amd64.whl
      Precompiled wheel not found. Building from source...
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\causal_conv1d
      copying causal_conv1d\causal_conv1d_interface.py -> build\lib.win-amd64-cpython-311\causal_conv1d
      copying causal_conv1d\__init__.py -> build\lib.win-amd64-cpython-311\causal_conv1d
      running build_ext
      C:\Python311\Lib\site-packages\torch\utils\cpp_extension.py:383: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
      building 'causal_conv1d_cuda' extension
      creating C:\Users\henk\AppData\Local\Temp\pip-install-a7lroenh\causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a\build\temp.win-amd64-cpython-311
      creating C:\Users\henk\AppData\Local\Temp\pip-install-a7lroenh\causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a\build\temp.win-amd64-cpython-311\Release
      creating C:\Users\henk\AppData\Local\Temp\pip-install-a7lroenh\causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a\build\temp.win-amd64-cpython-311\Release\csrc
      Emitting ninja build file C:\Users\henk\AppData\Local\Temp\pip-install-a7lroenh\causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a\build\temp.win-amd64-cpython-311\Release\build.ninja...
      Compiling objects...
      Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
      ninja: error: 'C:/Users/henk/AppData/Local/Temp/pip-install-a7lroenh/causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a/csrc/causal_conv1d.cpp', needed by 'C:/Users/henk/AppData/Local/Temp/pip-install-a7lroenh/causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a/build/temp.win-amd64-cpython-311/Release/csrc/causal_conv1d.obj', missing and no known rule to make it
      Traceback (most recent call last):
        File "C:\Users\henk\AppData\Local\Temp\pip-install-a7lroenh\causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a\setup.py", line 207, in run
          urllib.request.urlretrieve(wheel_url, wheel_filename)
        File "C:\Python311\Lib\urllib\request.py", line 241, in urlretrieve
          with contextlib.closing(urlopen(url, data)) as fp:
                                  ^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\urllib\request.py", line 216, in urlopen
          return opener.open(url, data, timeout)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\urllib\request.py", line 525, in open
          response = meth(req, response)
                     ^^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\urllib\request.py", line 634, in http_response
          response = self.parent.error(
                     ^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\urllib\request.py", line 563, in error
          return self._call_chain(*args)
                 ^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\urllib\request.py", line 496, in _call_chain
          result = func(*args)
                   ^^^^^^^^^^^
        File "C:\Python311\Lib\urllib\request.py", line 643, in http_error_default
          raise HTTPError(req.full_url, code, msg, hdrs, fp)
      urllib.error.HTTPError: HTTP Error 404: Not Found

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 2100, in _run_ninja_build
          subprocess.run(
        File "C:\Python311\Lib\subprocess.py", line 571, 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 "C:\Users\henk\AppData\Local\Temp\pip-install-a7lroenh\causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a\setup.py", line 227, in <module>
          setup(
        File "C:\Python311\Lib\site-packages\setuptools\__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Python311\Lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\henk\AppData\Local\Temp\pip-install-a7lroenh\causal-conv1d_536c7162f02a42cfbd2a4be545b1a22a\setup.py", line 224, in run
          super().run()
        File "C:\Python311\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Python311\Lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
          self.run_command(cmd_name)
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Python311\Lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Python311\Lib\site-packages\setuptools\command\build_ext.py", line 88, in run
          _build_ext.run(self)
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 345, in run
          self.build_extensions()
        File "C:\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 873, in build_extensions
          build_ext.build_extensions(self)
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "C:\Python311\Lib\site-packages\setuptools\command\build_ext.py", line 249, in build_extension
          _build_ext.build_extension(self, ext)
        File "C:\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 548, in build_extension
          objects = self.compiler.compile(
                    ^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 845, in win_wrap_ninja_compile
          _write_ninja_file_and_compile_objects(
        File "C:\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1774, in _write_ninja_file_and_compile_objects
          _run_ninja_build(
        File "C:\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 2116, in _run_ninja_build
          raise RuntimeError(message) from e
      RuntimeError: Error compiling objects for extension
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for causal-conv1d
  Running setup.py clean for causal-conv1d
Failed to build causal-conv1d
ERROR: Could not build wheels for causal-conv1d, which is required to install pyproject.toml-based projects
PS C:\Users\henk\causal-conv1d> pip install .
Processing c:\users\henk\causal-conv1d
  Preparing metadata (setup.py) ... done
Requirement already satisfied: torch in c:\python311\lib\site-packages (from causal-conv1d==1.0.1) (2.1.1+cu121)
Requirement already satisfied: packaging in c:\python311\lib\site-packages (from causal-conv1d==1.0.1) (23.2)
Collecting buildtools (from causal-conv1d==1.0.1)
  Using cached buildtools-1.0.6-py3-none-any.whl
Collecting ninja (from causal-conv1d==1.0.1)
  Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl.metadata (5.4 kB)
Requirement already satisfied: sqlalchemy in c:\python311\lib\site-packages (from buildtools->causal-conv1d==1.0.1) (2.0.23)
Collecting argparse (from buildtools->causal-conv1d==1.0.1)
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting twisted (from buildtools->causal-conv1d==1.0.1)
  Using cached twisted-23.10.0-py3-none-any.whl.metadata (9.5 kB)
Collecting simplejson (from buildtools->causal-conv1d==1.0.1)
  Using cached simplejson-3.19.2-cp311-cp311-win_amd64.whl.metadata (3.2 kB)
Collecting furl (from buildtools->causal-conv1d==1.0.1)
  Using cached furl-2.1.3-py2.py3-none-any.whl (20 kB)
Requirement already satisfied: requests in c:\python311\lib\site-packages (from buildtools->causal-conv1d==1.0.1) (2.28.1)
Collecting docopt (from buildtools->causal-conv1d==1.0.1)
  Using cached docopt-0.6.2-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil in c:\python311\lib\site-packages (from buildtools->causal-conv1d==1.0.1) (2.8.2)
Requirement already satisfied: jinja2 in c:\python311\lib\site-packages (from buildtools->causal-conv1d==1.0.1) (3.1.2)
Collecting redo (from buildtools->causal-conv1d==1.0.1)
  Using cached redo-2.0.4-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: filelock in c:\python311\lib\site-packages (from torch->causal-conv1d==1.0.1) (3.9.0)
Requirement already satisfied: typing-extensions in c:\python311\lib\site-packages (from torch->causal-conv1d==1.0.1) (4.4.0)
Requirement already satisfied: sympy in c:\python311\lib\site-packages (from torch->causal-conv1d==1.0.1) (1.12)
Requirement already satisfied: networkx in c:\python311\lib\site-packages (from torch->causal-conv1d==1.0.1) (3.0)
Requirement already satisfied: fsspec in c:\python311\lib\site-packages (from torch->causal-conv1d==1.0.1) (2023.4.0)
Requirement already satisfied: six>=1.8.0 in c:\python311\lib\site-packages (from furl->buildtools->causal-conv1d==1.0.1) (1.16.0)
Collecting orderedmultidict>=1.0.1 (from furl->buildtools->causal-conv1d==1.0.1)
  Using cached orderedmultidict-1.0.1-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: MarkupSafe>=2.0 in c:\python311\lib\site-packages (from jinja2->buildtools->causal-conv1d==1.0.1) (2.1.3)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d==1.0.1) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d==1.0.1) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d==1.0.1) (1.26.13)
Requirement already satisfied: certifi>=2017.4.17 in c:\python311\lib\site-packages (from requests->buildtools->causal-conv1d==1.0.1) (2022.12.7)
Requirement already satisfied: greenlet!=0.4.17 in c:\python311\lib\site-packages (from sqlalchemy->buildtools->causal-conv1d==1.0.1) (3.0.1)
Requirement already satisfied: mpmath>=0.19 in c:\python311\lib\site-packages (from sympy->torch->causal-conv1d==1.0.1) (1.3.0)
Requirement already satisfied: attrs>=21.3.0 in c:\python311\lib\site-packages (from twisted->buildtools->causal-conv1d==1.0.1) (23.1.0)
Collecting automat>=0.8.0 (from twisted->buildtools->causal-conv1d==1.0.1)
  Using cached Automat-22.10.0-py2.py3-none-any.whl (26 kB)
Collecting constantly>=15.1 (from twisted->buildtools->causal-conv1d==1.0.1)
  Using cached constantly-23.10.4-py3-none-any.whl.metadata (1.8 kB)
Collecting hyperlink>=17.1.1 (from twisted->buildtools->causal-conv1d==1.0.1)
  Using cached hyperlink-21.0.0-py2.py3-none-any.whl (74 kB)
Collecting incremental>=22.10.0 (from twisted->buildtools->causal-conv1d==1.0.1)
  Using cached incremental-22.10.0-py2.py3-none-any.whl (16 kB)
Collecting twisted-iocpsupport<2,>=1.0.2 (from twisted->buildtools->causal-conv1d==1.0.1)
  Using cached twisted_iocpsupport-1.0.4-cp311-cp311-win_amd64.whl.metadata (2.2 kB)
Requirement already satisfied: zope-interface>=5 in c:\python311\lib\site-packages (from twisted->buildtools->causal-conv1d==1.0.1) (6.1)
Requirement already satisfied: setuptools in c:\python311\lib\site-packages (from zope-interface>=5->twisted->buildtools->causal-conv1d==1.0.1) (69.0.2)
Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl (312 kB)
Using cached simplejson-3.19.2-cp311-cp311-win_amd64.whl (75 kB)
Using cached twisted-23.10.0-py3-none-any.whl (3.2 MB)
Using cached constantly-23.10.4-py3-none-any.whl (13 kB)
Using cached twisted_iocpsupport-1.0.4-cp311-cp311-win_amd64.whl (47 kB)
Building wheels for collected packages: causal-conv1d
  Building wheel for causal-conv1d (setup.py) ... done
  Created wheel for causal-conv1d: filename=causal_conv1d-1.0.1-cp311-cp311-win_amd64.whl size=5713376 sha256=9f215776798defc3b90a031061a014ad9a83a048fdf4953b300ef65990a06b0f
  Stored in directory: c:\users\henk\appdata\local\pip\cache\wheels\f0\ce\ef\2ec334fc6ebbd87d2b9734de58bd3feb0d651cb93e67ddd764
Successfully built causal-conv1d
Installing collected packages: twisted-iocpsupport, redo, ninja, incremental, docopt, argparse, simplejson, orderedmultidict, hyperlink, constantly, automat, twisted, furl, buildtools, causal-conv1d
Successfully installed argparse-1.4.0 automat-22.10.0 buildtools-1.0.6 causal-conv1d-1.0.1 constantly-23.10.4 docopt-0.6.2 furl-2.1.3 hyperlink-21.0.0 incremental-22.10.0 ninja-1.11.1.1 orderedmultidict-1.0.1 redo-2.0.4 simplejson-3.19.2 twisted-23.10.0 twisted-iocpsupport-1.0.4
HenkPoley commented 11 months ago

Slightly off-topic: Small note to others, mamba-ssm depends on triton. The reason I was building this package.

triton has no Windows version: https://github.com/openai/triton/issues/1640

Compilation difference between PyPi & git still remains for this package of course 🤔. It just means I'm less invested in finding a fix at the moment.

tridao commented 11 months ago

For mamba-ssm I don't think the triton part is strictly necessary (RMS norm and generation), will add options to run without triton.