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

Circular Import when using sageattn #126

Open
MercuryB1 opened this issue Mar 3, 2025 · 0 comments
Open

Circular Import when using sageattn #126

MercuryB1 opened this issue Mar 3, 2025 · 0 comments

Comments

@MercuryB1
Copy link

attn_output = sageattn(
            query_states, 
            key_states, 
            value_states, 
            tensor_layout="HND", 
            is_causal=False
        )
       
attn_output = attn_output.transpose(1, 2).contiguous()
attn_output = attn_output.view(bsz, q_len, -1)
attn_output = self.o_proj(attn_output)

I use SageAttn like this, but got error

Traceback (most recent call last):
  File "/opt/tiger/mariana/llm-jsq/main.py", line 21, in <module>
    from sageattention import sageattn
  File "/opt/tiger/lab-speech/byteslim/sageattention/__init__.py", line 1, in <module>
    from .core import sageattn, sageattn_varlen
  File "/opt/tiger/lab-speech/byteslim/sageattention/core.py", line 47, in <module>
    from .quant import per_block_int8 as per_block_int8_cuda
  File "/opt/tiger/lab-speech/byteslim/sageattention/quant.py", line 20, in <module>
    from . import _fused
ImportError: cannot import name '_fused' from partially initialized module 'sageattention' (most likely due to a circular import) (/opt/tiger/lab-speech/byteslim/sageattention/__init__.py)
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