intel / intel-xpu-backend-for-triton

OpenAI Triton backend for Intel® GPUs
MIT License
144 stars 44 forks source link

AttributeError: module 'triton' has no attribute 'jit' #2740

Open Yunaik opened 1 week ago

Yunaik commented 1 week ago

Describe the bug

Building triton from source using scripts/compile-triton.sh doesn't allow running example 1 -- triton kernel as the error AttributeError: module 'triton' has no attribute 'jit' is raised.

This issue was resolved in issue #2099 and issue #1693. A temporary solution was replacing pip install -v -e '.[build,tests]' with python setup.py install as suggested by the other issues

Environment details

Latest triton version (just pulled from main), A770 GPU

alexbaden commented 1 week ago

It sounds like there was a build failure somewhere - do you have any log files from the build that you can share with us?

Yunaik commented 1 week ago

I just re-compiled with pip install -v -e '.[build,tests]' and get AttributeError: module 'triton' has no attribute 'jit'

This is the build log: build.log

arunjose696 commented 1 day ago

A possible cause of this issue can be having a directory called triton being present in your current directory or one of the directories specified in PATH or PYTHON_PATH this would result in this directory being imported instead of installed triton. I had faced this issue when I had cloned the triton repo in my current directory where I executed my programs.

Could you share the output of below script and the "pip list"

import triton
print(triton.__path__)
print(dir(triton))

The triton.__path__should be ideally "/PATH_TO_TRITON/intel-xpu-backend-for-triton/python/triton" which should be same as the path mentioned in pip list.
If it is not remove or rename any conflicting local "triton" directories if they are present in your path, and python should then use the properly installed package instead.