ImportError: cannot import name 'RESERVED_KWS' from 'triton.runtime.interpreter'
when i run python puzzles.py -h, an error occurred.
ImportError: cannot import name 'RESERVED_KWS' from 'triton.runtime.interpreter' (/data6/user23215417/anaconda3/envs/triton/lib/python3.10/site-packages/triton/runtime/interpreter.py)
same here, I'm using colab
cannot import name 'RESERVED_KWS' from 'triton.runtime.interpreter' (/usr/local/lib/python3.12/dist-packages/triton/runtime/interpreter.py)
%%capture
# Only need to run the first time.
# Works with latest triton. Sorry, this takes a minute to install.
...
!pip install triton==3.1.0
...
To resolve the issue, you are requested to modify the installation command in the first code cell. The problem arises from the incorrect version for the triton package.
But it will meet another error that mentioned in other issues like triton-lang/triton/issue#4730. Taking this method Triton-Puzzles-Lite/issues#1 seems fail to tackle the issue
https://github.com/VachanVY/gpu-programming/tree/main
you can use my uv config, it works with it
@srush can reproduce this on my end. is there a suggested workaround?
!pip install --upgrade --force-reinstall triton==3.1.0 git+https://github.com/Deep-Learning-Profiling-Tools/[email protected]
thanks @txfs19260817 this works locally(but only on x86_64 not on arm because triton doesn't have python bindings for arm yet) - still didn't work on colab on first try but i didn't try to start from scratch.
!pip install --upgrade --force-reinstall triton==3.1.0 git+https://github.com/Deep-Learning-Profiling-Tools/[email protected]
Thanks @txfs19260817. This also works on colab for me after disconnecting and reconnecting to runtime.
Had the same issue when using the Colab notebook, the issue was solved by running @txfs19260817's command (thanks!)
It's kindof weird, since theoretically the notebook is trying to install the same versions of triton and triton-viz (namely 3.1.0 and 1.1.1) as in @txfs19260817's command.
I originally thought the issue was that Colab comes with Triton 3.4.0 pre-installed (according to pip list), so the --force-reinstall was necessary to install the older version.
Upon some further experimentation, it seems the triton install command was broken (at least on Colab), and changing the triton-3.1.0 to triton==3.1.0 seems to fix it.
As is, the !pip install triton-3.1.0 command gives the following output:
ERROR: Could not find a version that satisfies the requirement triton-3.1.0 (from versions: none)
ERROR: No matching distribution found for triton-3.1.0
So, to summarize, the issue seems to be fixed by changing the first code block in the Colab notebook to:
%%capture
# Only need to run the first time.
# Works with latest triton. Sorry, this takes a minute to install.
!apt install libcairo2-dev pkg-config python3-dev
!pip install jaxtyping
!pip install git+https://github.com/Deep-Learning-Profiling-Tools/[email protected]
!pip install triton==3.1.0
!pip install pycairo
!export LC_ALL="en_US.UTF-8"
!export LD_LIBRARY_PATH="/usr/lib64-nvidia"
!export LIBRARY_PATH="/usr/local/cuda/lib64/stubs"
!ldconfig /usr/lib64-nvidia
I'll put out a PR in a bit.
(EDIT: Just noticed that @Bakameow already mentioned this a few comments earlier! Seems like there might still be some other dependency issues too then?)