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

ninja: error: 'xLSTM/xlstm/xlstm/blocks/slstm/src/cuda/slstm.cc', needed by 'slstm.o', missing and no known rule to make it #23

Open
haustzhb opened this issue Jun 15, 2024 · 0 comments

Comments

@haustzhb
Copy link

haustzhb commented Jun 15, 2024

{'verbose': True, 'with_cuda': True, 'extra_ldflags': ['-LC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\lib', '-lcublas'], 'extra_cflags': ['-DSLSTM_HIDDEN_SIZE=128', '-DSLSTM_BATCH_SIZE=8', '-DSLSTM_NUM_HEADS=4', '-DSLSTM_NUM_STATES=4', '-DSLSTM_DTYPE_B=float', '-DSLSTM_DTYPE_R=nv_bfloat16', '-DSLSTM_DTYPE_W=nv_bfloat16', '-DSLSTM_DTYPE_G=nv_bfloat16', '-DSLSTM_DTYPE_S=nv_bfloat16', '-DSLSTM_DTYPE_A=float', '-DSLSTM_NUM_GATES=4', '-DSLSTM_SIMPLE_AGG=true', '-DSLSTM_GRADIENT_RECURRENT_CLIPVAL_VALID=false', '-DSLSTM_GRADIENT_RECURRENT_CLIPVAL=0.0', '-DSLSTM_FORWARD_CLIPVAL_VALID=false', '-DSLSTM_FORWARD_CLIPVAL=0.0', '-U__CUDA_NO_HALF_OPERATORS', '-U__CUDA_NO_HALF_CONVERSIONS', '-U__CUDA_NO_BFLOAT16_OPERATORS', '-U__CUDA_NO_BFLOAT16_CONVERSIONS', '-U__CUDA_NO_BFLOAT162_OPERATORS__', '-U__CUDA_NO_BFLOAT162_CONVERSIONS__'], 'extra_cuda_cflags': ['-Xptxas="-v"', '-gencode', 'arch=compute_80,code=compute_80', '-res-usage', '--use_fast_math', '-O3', '-Xptxas -O3', '--extra-device-vectorization', '-DSLSTM_HIDDEN_SIZE=128', '-DSLSTM_BATCH_SIZE=8', '-DSLSTM_NUM_HEADS=4', '-DSLSTM_NUM_STATES=4', '-DSLSTM_DTYPE_B=float', '-DSLSTM_DTYPE_R=nv_bfloat16', '-DSLSTM_DTYPE_W=nv_bfloat16', '-DSLSTM_DTYPE_G=nv_bfloat16', '-DSLSTM_DTYPE_S=nv_bfloat16', '-DSLSTM_DTYPE_A=float', '-DSLSTM_NUM_GATES=4', '-DSLSTM_SIMPLE_AGG=true', '-DSLSTM_GRADIENT_RECURRENT_CLIPVAL_VALID=false', '-DSLSTM_GRADIENT_RECURRENT_CLIPVAL=0.0', '-DSLSTM_FORWARD_CLIPVAL_VALID=false', '-DSLSTM_FORWARD_CLIPVAL=0.0', '-U__CUDA_NO_HALF_OPERATORS', '-U__CUDA_NO_HALF_CONVERSIONS', '-U__CUDA_NO_BFLOAT16_OPERATORS', '-U__CUDA_NO_BFLOAT16_CONVERSIONS', '-U__CUDA_NO_BFLOAT162_OPERATORS__', '-U__CUDA_NO_BFLOAT162_CONVERSIONS__']}
Using C:\Users\31786\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file C:\Users\31786\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121\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)
ninja: error: 'D:/zhb/AIѧϰ����/xLSTM/xlstm/xlstm/blocks/slstm/src/cuda/slstm.cc', needed by 'slstm.o', missing and no known rule to make it
Traceback (most recent call last):
File "D:\software\anaconda_install\envs\xlstm\Lib\site-packages\torch\utils\cpp_extension.py", line 2096, in _run_ninja_build
subprocess.run(
File "D:\software\anaconda_install\envs\xlstm\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 "xLSTM\xlstm\test\test.py", line 35, in
xlstm_stack = xLSTMLMModel(cfg)
^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\xlstm_lm_model.py", line 38, in init
self.xlstm_block_stack = xLSTMBlockStack(config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\xlstm_block_stack.py", line 83, in init
self.blocks = self._create_blocks(config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\xlstm_block_stack.py", line 104, in _create_blocks
blocks.append(sLSTMBlock(config=config))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\blocks\slstm\block.py", line 32, in init
super().init(
File "xLSTM\xlstm\xlstm\blocks\xlstm_block.py", line 62, in init
self.xlstm = sLSTMLayer(config=self.config.slstm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\blocks\slstm\layer.py", line 78, in init
self.slstm_cell = sLSTMCell(self.config)
^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\blocks\slstm\cell.py", line 780, in new
return sLSTMCell_cuda(config, skip_backend_init=skip_backend_init)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\blocks\slstm\cell.py", line 690, in init
self.func = sLSTMCellFuncGenerator(self.training, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\blocks\slstm\cell.py", line 536, in sLSTMCellFuncGenerator
slstm_cuda = sLSTMCellCUDA.instance(config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xLSTM\xlstm\xlstm\blocks\slstm\cell.py", line 515, in instance
cls.mod[repr(config)] = load(
^^^^^
File "xLSTM\xlstm\xlstm\blocks\slstm\src\cuda_init.py", line 84, in load
mod = _load(name + suffix, sources, **myargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\software\anaconda_install\envs\xlstm\Lib\site-packages\torch\utils\cpp_extension.py", line 1306, in load
return _jit_compile(
^^^^^^^^^^^^^
File "D:\software\anaconda_install\envs\xlstm\Lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile
_write_ninja_file_and_build_library(
File "D:\software\anaconda_install\envs\xlstm\Lib\site-packages\torch\utils\cpp_extension.py", line 1823, in _write_ninja_file_and_build_library
_run_ninja_build(
File "D:\software\anaconda_install\envs\xlstm\Lib\site-packages\torch\utils\cpp_extension.py", line 2112, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'slstm_HS128BS8NH4NS4DBfDRbDWbDGbDSbDAfNG4SA1GRCV0GRC0d0FCV0FC0d0'

"Hello! I am configuring the environment on Windows, but after running, I found that when trying to compile the C++ extension, Ninja cannot find the 'slstm.cc' file. How should I solve this issue?"

@haustzhb haustzhb changed the title ninja: error: 'D:/zhb/AIѧϰ����/xLSTM/xlstm/xlstm/blocks/slstm/src/cuda/slstm.cc', needed by 'slstm.o', missing and no known rule to make it ninja: error: 'xLSTM/xlstm/xlstm/blocks/slstm/src/cuda/slstm.cc', needed by 'slstm.o', missing and no known rule to make it Jun 15, 2024
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

1 participant