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

Sageattention2 fails to build on torch nightly 2.7.0 (8th feb), because ambiguous symbol from torch dynamo (Windows) #101

Open
Panchovix opened this issue Feb 9, 2025 · 3 comments

Comments

@Panchovix
Copy link
Contributor

Panchovix commented Feb 9, 2025

Hi there, thanks for the great work.

I did update torch to latest nightly of 8th Feb, but got

FAILED: G:/Stable difussion/stable-diffusion-webui-reForge/SageAttention/build/temp.win-amd64-cpython-312/Release/csrc/qattn/qk_int_sv_f16_cuda_sm80.obj

....

G:/Stable difussion/stable-diffusion-webui-reForge/venv/Lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(962): error C2872: 'std': ambiguous symbol
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/include\valarray(20): note: could be 'std'
G:/Stable difussion/stable-diffusion-webui-reForge/venv/Lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(962): note: or       'std'
G:/Stable difussion/stable-diffusion-webui-reForge/venv/Lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(962): note: the template instantiation context (the oldest one first) is
G:/Stable difussion/stable-diffusion-webui-reForge/venv/Lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1007): note: see reference to class template instantiation 'torch::dynamo::autograd::IValuePacker<__int64>' being compiled
G:/Stable difussion/stable-diffusion-webui-reForge/venv/Lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(945): note: while compiling class template member function 'c10::TypePtr torch::dynamo::autograd::IValuePacker<__int64>::packed_type(void)'
G:/Stable difussion/stable-diffusion-webui-reForge/venv/Lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1007): note: see the first reference to 'torch::dynamo::autograd::IValuePacker<__int64>::packed_type' in 'torch::dynamo::autograd::IValuePacker<unsigned __int64>::packed_type'
  File "C:\Program Files\Python312\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 "G:\Stable difussion\stable-diffusion-webui-reForge\SageAttention\setup.py", line 202, in <module>
    setup(
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
    dist.run_commands()
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\dist.py", line 967, in run_command
    super().run_command(command)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
    cmd_obj.run()
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\wheel\_bdist_wheel.py", line 387, in run
    self.run_command("build")
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\dist.py", line 967, in run_command
    super().run_command(command)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
    cmd_obj.run()
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
    self.run_command(cmd_name)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\dist.py", line 967, in run_command
    super().run_command(command)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
    cmd_obj.run()
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\command\build_ext.py", line 91, in run
    _build_ext.run(self)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
    self.build_extensions()
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\torch\utils\cpp_extension.py", line 921, in build_extensions
    build_ext.build_extensions(self)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 479, in build_extensions
    self._build_extensions_serial()
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 505, in _build_extensions_serial
    self.build_extension(ext)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\command\build_ext.py", line 252, in build_extension
    _build_ext.build_extension(self, ext)
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 560, in build_extension
    objects = self.compiler.compile(
              ^^^^^^^^^^^^^^^^^^^^^^
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\torch\utils\cpp_extension.py", line 893, in win_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\torch\utils\cpp_extension.py", line 1899, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "G:\Stable difussion\stable-diffusion-webui-reForge\venv\Lib\site-packages\torch\utils\cpp_extension.py", line 2256, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

Mostly to catch it now.

Using nightly of 1 week ago (2025-02-01) works fine. Probably some related dynamo changes affected this.

Thanks in advance!

@Panchovix Panchovix changed the title Sageattention2 fails to build on torch nightly 2.7.0 (8th feb), because ambiguous symbol from torch dynamo Sageattention2 fails to build on torch nightly 2.7.0 (8th feb), because ambiguous symbol from torch dynamo (Windows) Feb 9, 2025
@jason-huang03
Copy link
Member

can it work on ealier stable release of pytorch like torch 2.5.1?

@Panchovix
Copy link
Contributor Author

It works fine on torch 2.5.1 or 2.6.0.

But for the future stable 2.7.0, not sure how It will behave. Could also report it on the pytorch repo.

@jason-huang03
Copy link
Member

jason-huang03 commented Feb 15, 2025

@Panchovix It's weird. People have successfully build SageAttention with torch 2.7 on RTX5090. What GPU do you use?

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