Closed Duconnor closed 8 months ago
Thank you for trying the project out. triton latest has some breaking changes that make the 3rd party backends no longer work. You can check out triton at commit 56c284cf7e39f249cdf1d8d5dba7892deb0286d6
which is right before the breaking change.
The 3rd party refactor is still ongoing, once triton main finalizes all the changes, we will update triton-shared
to work with the new 3rd party backend integration.
Can you elaborate on how to get this working? First of all the triton-shared submodule in this triton sha doesn't contain the python/examples/
directory. Second, even if i update the submodule to latest, i still get an error ValueError: Cannot find backend for cpu
. Thanks in advance
So the setup should be something like (which I think you already have)
triton
at commit 56c284cf7e39f249cdf1d8d5dba7892deb0286d6
triton-shared
submodule to main
This is what our GitHub actions have as well, as you can see here: https://github.com/microsoft/triton-shared/blob/main/.github/workflows/integration-tests.yml
Perhaps a clean build would help, the steps in https://github.com/microsoft/triton-shared/blob/main/.github/workflows/test-plugin.yml are what we use to build locally. Note that the CPU backend requires having 2 environment variables TRITON_SHARED_OPT_PATH
and LLVM_BINARY_DIR
:
cd triton/python
export TRITON_SHARED_OPT_PATH=$(pwd)/build/$(ls $(pwd)/build | grep -i cmake)/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt
export LLVM_BINARY_DIR=${HOME}/.triton/llvm/$(ls ${HOME}/.triton/llvm/ | grep -i llvm)/bin
Thanks for all the info. I'll try this out and let you know if i run into any more issues
I'm curious what the timeline is for fixing this upstream. Is there a current PR out there I can track?
P.S. @nhat-nguyen, I was able to get it to work with your directions. Thanks again!
P.S. @nhat-nguyen, I was able to get it to work with your directions. Thanks again!
Glad that worked for you.
I'm curious what the timeline is for fixing this upstream. Is there a current PR out there I can track?
@srcarroll triton upstream still doesn't fully support 3rd party plugin after the recent refactor. I'm trying to get a fix out as soon as I can, but there are still some details to work out. You can follow this channel where we discuss the progress: https://app.slack.com/client/T01379XQ9FG/C05461NMQUU
@srcarroll We made some progress on this. Going forward, triton will require plugins to include triton as a submodule. There's an ongoing PR to support building 3rd party plugin using this new structure: https://github.com/openai/triton/pull/3007
While waiting for that PR to complete, we have updated our reference CPU backend to work with triton latest and include a submodule that points to the branch in the above PR (#87).
I have also updated the instructions on how to build with the new structure. Let me know if you have any issues. The instructions might change depending on the feedback in the ongoing PR.
@srcarroll We made some progress on this. Going forward, triton will require plugins to include triton as a submodule. There's an ongoing PR to support building 3rd party plugin using this new structure: https://github.com/openai/triton/pull/3007
While waiting for that PR to complete, we have updated our reference CPU backend to work with triton latest and include a submodule that points to the branch in the above PR (#87).
I have also updated the instructions on how to build with the new structure. Let me know if you have any issues. The instructions might change depending on the feedback in the ongoing PR.
Sweet! Thanks for the update. I'll give it a go in the next couple days and let you know.
I'm marking this as fixed by #87. Feel free to reopen the issue again if you have any other issues. 😄
I have successfully built triton along with the triton-shared project. I can use the
triton-shared-opt
command line tool to lower triton ir but I was unable to use triton-shared as a backend component. I've tried to runpython python/examples/test_reduce.py
but failed with the following error:The error seems to be caused by the fact that there is no available driver for the CPU backend in triton. By inspecting the relevant code, I found that there is only
HIPDriver
andCudaDriver
available in triton for now. So do I need to make any extra adjustment in order to run this example? Any suggestion would be greatly appreciated.By the way, this is a really interesting project that tries to lower triton IR to linalg. Nice job guys. :)