Skip to content

AttributeError: 'NoneType' object has no attribute 'start' #10

@Gavin-jay

Description

@Gavin-jay

thank you for your amazing work! I am your fans! but I get some wrong when I run 'python test_triton_nsa.py', Can you help me?

torch 2.6.0
torchaudio 2.6.0
torchvision 0.21.0
triton 3.2.0

the traceback is below
File "NSA/native-sparse-attention-pytorch/native_sparse_attention_pytorch/triton_native_sparse_attention.py", line 431, in
@triton.jit
^^^^^^^^^^
File "anaconda3/envs/remoe/lib/python3.11/site-packages/triton/runtime/jit.py", line 852, in jit
return decorator(fn)
^^^^^^^^^^^^^
File "anaconda3/envs/remoe/lib/python3.11/site-packages/triton/runtime/jit.py", line 840, in decorator
return JITFunction(
^^^^^^^^^^^^
File "anaconda3/envs/remoe/lib/python3.11/site-packages/triton/runtime/jit.py", line 682, in init
self.src = self.src[re.search(r"^def\s+\w+\s*(", self.src, re.MULTILINE).start():]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'start'

As a beginner, I have no idea about it, I try to call deepseek to fix it, but failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions