triton-lang / triton

Development repository for the Triton language and compiler
https://triton-lang.org/
MIT License
12.53k stars 1.52k forks source link

AttributeError: module 'triton._C.libtriton.triton.runtime' has no attribute 'num_sm' #1257

Open aldesilv opened 1 year ago

aldesilv commented 1 year ago

for example when I do:

from triton.testing import get_max_simd_tflops
import torch
get_max_simd_tflops(torch.float32)

then it says:

AttributeError: module 'triton._C.libtriton.triton.runtime' has no attribute 'num_sm'

and I looked in:

print(dir(triton._C.libtriton.triton.runtime))
['CUDA', 'HOST', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'backend']

I installed from source:

git clone https://github.com/openai/triton.git;
cd triton/python;
pip install cmake; # build time dependency
pip install -e .
perone commented 1 year ago

I'm getting the same issue with 2.0.0post1 as well.

lw commented 1 year ago

I'm also hitting this bug with PyTorch 2.0.0 (although only on a P100 or V100 GPU, and only with fp32 tensors).

However, I suspect it has already been fixed upstream by https://github.com/openai/triton/pull/1318. I'll try to see if by updating Triton this bug disappears.